Nodes/comfyui-stable-materials/Generate PBR (Text)
ComfyUI Node

Generate PBR (Text)

Type 'rusty metal', get five PBR maps out the other end

By P5ina·Created 7 months ago·Updated 7 months ago· 1
Generate PBR (Text)
  • pipeline
  • basecolor
  • normal
  • height
  • roughness
  • metallic
promptRusty weathered metal surface with scratches
negative_promptblurry, low quality, distorted
seed0
steps4
guidance_scale7.5
tileabletrue

This is the headline node of the pack. Wire it after Load StableMaterials, type a material description, and it hands you five separate images: basecolor, normal, height, roughness, and metallic. No upscaling stage, no "then extract the normal map" choreography - one pass, all five channels, already aligned to each other.

That alignment is the whole point. PBR maps only work together: the normal map has to match the basecolor's geometry, the height has to match the normals, and so on. This model generates them jointly, which is why people reach for it instead of bolting DeepBump (normal-only) plus a hand-rolled roughness pass onto an image and hoping they line up.

How it works

The node takes the pipeline from Load StableMaterials and calls it exactly like a diffusers generation: prompt, negative_prompt, num_inference_steps, guidance_scale, and a seeded torch.Generator. The model returns a material object whose five fields get converted into ComfyUI IMAGE tensors.

The tileable boolean is genuinely built in, not post-processed - the model itself generates seamless textures when it's on. That's a rare and valuable default for game/texture work; a material that tiles saves you hours of clone-stamping seams in Substance.

The inputs that matter

  • prompt - the material description. Default is "Rusty weathered metal surface with scratches". The README's example prompts are worth stealing: "Weathered rusty metal with scratches and peeling paint", "Polished marble with gold veins", "Old wooden planks with moss", "Red brick wall with white mortar".
  • negative_prompt - defaults to "blurry, low quality, distorted". Standard stuff.
  • steps - defaults to 4, and this is the trap: 4 is right for the LCM loader, 50 for standard. If you mismatch - 50 steps on an LCM pipeline or 4 on standard - you get either wasted time or an undercooked material.
  • guidance_scale - default 7.5, how hard it follows the prompt.
  • tileable - default on. Leave it on unless you specifically want a non-tiling sheet.

The outputs are all IMAGE: basecolor, normal, height, roughness, metallic. Height, roughness, and metallic come back as grayscale carried in an RGB tensor - fine to save as-is or take the channel if your engine wants it.

What to do with the output

You'll typically wire each of the five into its own Save Image, or into PBR Preview Grid to eyeball them together first. If you're building a game-ready sheet, the normal map goes into your engine's normal slot, basecolor into albedo, roughness and metallic into their channels, and height into displacement. The maps are tileable and already UV-agnostic, so they drop straight into Blender's material nodes or an engine's material editor.

Install & gotchas

It's the same install as the rest of the pack - ComfyUI Manager, search "StableMaterials", or clone https://github.com/P5ina/comfyui-stable-materials and pip install -r requirements.txt (just diffusers, transformers, accelerate). First run downloads the model from HuggingFace.

Where people get burned: prompt style. This is a material model, not a scene model - "a brick wall in fog" will wander; "red brick wall with white mortar" lands. Keep the description to the surface and its wear. And match your steps to the loader mode you're actually using.

CategoryStableMaterials

Inputs (7)

NameTypeDefaultDescription
pipelineSM_PIPELINE
promptSTRINGRusty weathered metal surface with scratches
negative_promptSTRINGblurry, low quality, distorted
seedINT00–18446744073709550000
stepsINT41–50
guidance_scaleFLOAT7.51–20
tileableBOOLEANtrue

Outputs (5)

NameTypeDescription
basecolorIMAGE
normalIMAGE
heightIMAGE
roughnessIMAGE
metallicIMAGE