PBR Generator
The fast lane from flat texture to PBR material
- image
- BaseColor
- Normal
- Roughness
- Displacement
- AO
- Metallic
- ORM
You generated a killer brick texture in ComfyUI, and now you want it as an actual material - normal map, roughness, metallic, AO, displacement, the works. That's the whole job of this node. Drop one image in, get seven maps out, all without leaving the graph. It's a port of Joey Ballentine's Material-Map-Generator, a GAN-based material tool that's been kicking around the Stable Diffusion community since 2022, and honestly it still beats hand-rolling maps in a photo editor for speed.
How it works
The node bundles two small RRDB models (the same architecture family as ESRGAN) right inside the pack: NormalMapGenerator-CX-Lite handles the normal map, FrankenMapGenerator-CX-Lite produces the raw displacement and roughness data. Both run a single pass over your image. Then the deterministic part takes over:
- Roughness comes from one channel of the FrankenMap output, remapped to your
roughness_min/roughness_max. - Displacement is a straight copy of another channel - it's your height field.
- AO is derived from the displacement map: inverted, blurred, and scaled by
ao_strength. It's a fake but a serviceable one. - Metallic is a heuristic, not AI: pixels that are low-saturation and bright get flagged as metal (that's
metallic_threshold), with some edge detail added in. Good enough for a rusty pipe, mediocre on a shiny robot. - ORM packs AO into the red channel, Roughness into green, Metallic into blue - the standard glTF/real-time renderer convention, so you can feed it straight to a game engine.
seamless_mode is where the "seamless texture" magic lives: the node pads your image with a 16px border (seamless wraps it, mirror reflects it, replicate copies the edge), runs the models, then crops the border back off. That's why output textures tile.
The inputs that matter
Most of these you can leave alone. The few you'll actually touch:
image- wired from Load Image (it's forced as a graph input, you can't type a value).texture_name- prefix for saved filenames, likeStone_Wall.seamless_mode-off/seamless/mirror/replicate.seamlessis the default and usually what you want for tiling materials.normal_strengthandnormal_invert_y- the strength multiplier, and the Y-channel flip. Defaultnormal_invert_yis on, which is the Unreal-style convention; if your normals look indented or "sunken" in your renderer, toggle it for the DirectX/OpenGL flip.roughness_min/roughness_max- remaps the grayscale range. Want a wetter look? Pushroughness_maxdown.
The outputs
BaseColor, Normal, Roughness, Displacement, AO, Metallic, and ORM - seven IMAGE outputs. They preview right in the UI and, if save_textures is on (default), get written as {texture_name}_{Map}.png into your ComfyUI output folder. ORM is the one you wire into engines like Unreal or Blender's EEVEE; the individual maps are for compositing or further editing.
Installing it
Via ComfyUI Manager, search for ComfyUI-QFX-PBRGenerator and hit install. Or the manual way:
cd ComfyUI/custom_nodes
git clone https://github.com/qornflex/ComfyUI-QFX-PBRGenerator
cd ../.. && source venv/bin/activate # or however you activate your venv
pip install -r custom_nodes/ComfyUI-QFX-PBRGenerator/requirements.txt
Then restart ComfyUI. The two models (~20MB each) ship inside the repo - there's no separate HuggingFace download to chase. Dependencies are light: pillow, opencv-python, scipy, numpy. On a bare install, opencv-python and scipy are the ones that tend to be missing, so if it errors on import, start there.
Where people get burned
- It's heuristic, not PBR-perfect. The AI part is real, but metallic/AO are approximations. Don't expect Substance-quality metal detection on a busy scene - this is the fast lane, and it shows if you zoom in.
- CPU-only works but crawls. It falls back to CPU gracefully, yet you're running two GAN passes per image. Expect it to be slow.
- Files appear but no preview. If PNGs show up in your output folder but the canvas shows nothing, check whether
save_texturesis on - that toggle controls the writes, and the image previews are separate. - It copies your input straight to BaseColor. Baked-in lighting and shadows come along for the ride. That's the whole reason the pack's other node, the Advanced PBR Generator, exists - it's the delighting version that needs a Marigold appearance/lighting model. For flat AI textures without heavy shadows, this one's all you need.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| texture_name | STRING | MyTexture | — |
| seamless_mode | COMBO | seamless | 4 options: off, seamless, mirror, replicate |
| normal_strength | FLOAT | 1.000–5 | — |
| normal_invert_y | BOOLEAN | true | — |
| roughness_min | FLOAT | 0.000–1 | — |
| roughness_max | FLOAT | 1.000–1 | — |
| metallic_min | FLOAT | 0.000–1 | — |
| metallic_max | FLOAT | 1.000–1 | — |
| metallic_threshold | FLOAT | 0.150–1 | — |
| ao_blur | INT | 20–10 | — |
| ao_strength | FLOAT | 1.000–2 | — |
| save_textures | BOOLEAN | true | — |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| BaseColor | IMAGE | — |
| Normal | IMAGE | — |
| Roughness | IMAGE | — |
| Displacement | IMAGE | — |
| AO | IMAGE | — |
| Metallic | IMAGE | — |
| ORM | IMAGE | — |