Skip to content

PBR maps

sakalond edited this page Oct 28, 2026 · 2 revisions

StableGen can derive physically based material maps from the generated images. After texturing, it runs material-estimation models on each camera image and projects the resulting maps onto the mesh in the same way as the color texture. The maps are estimates made from images; they are not measured material properties.

A textured log house with PBR maps, beside its base color, roughness, metallic and normal maps projected onto the model

Requirements

PBR extraction needs two ComfyUI custom nodes, plus optional model files for Marigold V2:

Node pack Used for Installer package
ComfyUI-Marigold Albedo, roughness, metallic, normal, height and the lighting residual 9 (also included in 3, 4 and 10)
ComfyUI StableDelight Highlight-free albedo 10 (also included in 3 and 4)
Marigold V2 models (ComfyUI core nodes, September 2026 or newer) Optional sharper albedo and normals; about 23 GB 12

StableGen checks for both when it connects to the server. If either is missing, the PBR section shows PBR nodes not detected on server. The Marigold models download from Hugging Face on first use.

Enabling extraction

Enable PBR map extraction (1) in the Output & materials section of the Texture page, then switch on the maps you want; each map has its own card with its settings (Maps to Extract in the legacy panel).

The PBR settings in Output & materials: (1) PBR map extraction, the Albedo card with (2) its extraction model and saturation correction, the Roughness, Metallic, Normal, Height and Ambient occlusion cards, and the Emission card with (3) its detection method, cutoff and strength

Map Source
Albedo Depends on Albedo Source (below).
Roughness Marigold IID-Appearance.
Metallic Marigold IID-Appearance.
Normal Depends on Normal Model: Marigold Normals or Marigold V2. Converted from camera space to world space. May cause triangle artifacts on voxel-remeshed geometry.
Height Marigold depth estimation. Connected to the material's Displacement node, scaled by Material displacement scale.
AO Geometry-based ambient occlusion using Blender's AO shader node, not a model. Bake it to get an image map.
Emission Experimental. Detects self-illuminating regions (see below).

Albedo, Roughness, Metallic and Normal are enabled by default.

The README treasure chest under a light sweeping across it, textured with the generated colors only and with its PBR maps: the generated colors keep their painted-in highlights wherever the light is, while with PBR maps the brass and wood respond to the light

The README treasure chest built up one map at a time while a light sweeps across it: base color only, then with roughness, metallic (the brass turns reflective) and normal; each panel shows that map as an inset

Albedo source

Albedo Source is the Extraction model menu on the Albedo card (2).

Option Behavior
Marigold IID (Flat Albedo) Removes all lighting. May lose texture detail and tends to desaturate colors.
StableDelight (Delighted) Removes specular highlights only and keeps diffuse shading and detail. Delight Strength controls how strongly.
Marigold IID-Lighting (Vibrant) Albedo from the IID-Lighting model; usually more saturated.
Marigold V2 (Sharp Albedo) Removes lighting while keeping fine texture detail and color, at up to Marigold V2 resolution (px). Albedo of metals tends to come out dark.

The chest's generated view and the albedo each source extracts from it, with a close-up of the brass lock plate: Marigold IID washes the brass out to pale yellow, StableDelight keeps the shading but shifts toward red, IID-Lighting comes out very dark, and Marigold V2 stays closest to the generated colors

Correct Albedo Saturation (Correct saturation on the card) compares the albedo with the original render and adjusts saturation to match. Only the object is measured; the area outside the generated image's alpha is ignored. It is recommended for Marigold IID (Flat Albedo), and choosing that source turns it on. Choosing Marigold V2 turns it off, because the V2 albedo already keeps the generated colors and the correction would only dull them. Saturation Mode (Correction across views) chooses how the per-camera correction ratios are combined: Median (default), Mean or Per Camera.

Use Albedo as Base Color (Use as material base color, on by default) uses the extracted albedo instead of the generated color texture as the material's base color.

Emission

The method is the Detection method menu on the Emission card (3).

Method Behavior
IID-Lighting Residual Runs Marigold IID-Lighting and uses the residual between the image and albedo times shading. Costs an extra model pass.
HSV Threshold Selects bright, saturated pixels using Minimum saturation and Minimum brightness, blurred by Detection blur (px). Fast; suits neon or sci-fi styles.

The same neon jacket view, and the emission each method detects in it: HSV Threshold keeps the painted cyan, the IID-Lighting Residual shifts it toward blue

Both methods can mistake highlights for emission. Emission detection cutoff removes weak candidates; Emission Strength sets the material's emission multiplier.

Resolution and quality

Setting Effect
Use source size for inference Run the models at the generated image's size instead of Inference resolution (px) (default 768). On by default.
Tiling Process maps as a grid of tiles for more pixels per region: Off, Selective (albedo only, default), All, or Custom (choose the maps).
Tile grid 2, 3 or 4, giving 4, 9 or 16 tiles. Time grows with the tile count.
Tile inference Tile Source Size (default) processes each tile upscaled to the source image's size; Inference Resolution processes each tile at Inference resolution (px).
Keep tiled output resolution Keep the larger tiled result instead of resizing to the source size. Uses more memory.
Inference steps Sampling steps per map (default 4).
Predictions per map Number of predictions averaged for each map (default 1).
Marigold V2 resolution (px) Longest edge Marigold V2 processes at (default 2048). Images are processed at their own size within 1024 px and this limit. Marigold V2 ignores the other settings in this table.

The normal map of the chest's lock plate inferred at 768 px, at the source image's size, and at the source size tiled 2 x 2: at 768 px the keyhole and bolt edges wobble; at the source size they are crisp, and tiling sharpens edges slightly further

Studio Lighting adds a three-point light rig after projection to show the materials.

StableGen stores the settings used for each map and reuses existing maps when you reproject without changing them.

Baking PBR maps

Bake turns the projected maps into UV image textures. With Bake PBR Maps enabled (the default), each channel connected to the material is baked to its own file in the baked folder: <object>_BaseColor.png, _Roughness, _Metallic, _Normal, _Emission, _Height and _AO. Normal maps are baked in tangent space.

Baked maps of the courier with the neon jacket: base color, roughness, metallic, tangent-space normal and emission

Option Effect
Pack ORM Texture Also writes <object>_ORM.png with ambient occlusion in red, roughness in green and metallic in blue. Requires roughness and metallic maps; red is white if there is no AO map.
Normal Convention OpenGL (Y+) for glTF, Unity and Blender, or DirectX (Y-) for Unreal Engine, which flips the green channel.

See Export for the other bake options.

Clone this wiki locally