Extensions/comfyui-stable-materials
ComfyUI Extension

comfyui-stable-materials

Generate PBR material maps from text or image using StableMaterials. Supports 5 PBR maps, text-to-PBR, image-to-PBR, with seamless texture generation and fast LCM mode (~2 seconds).

By P5ina·Created 7 months ago·Updated 7 months ago· 1
P5ina/comfyui-stable-materials
Nodes
On cloudLocal install
Stars1
Updated7 months ago
Readme

ComfyUI-StableMaterials

Generate PBR material maps from text or image using StableMaterials.

preview

Features

  • 5 PBR maps: basecolor, normal, height, roughness, metallic
  • Text-to-PBR: Generate materials from text description
  • Image-to-PBR: Generate materials from input image
  • Tileable: Built-in seamless texture generation
  • Fast: LCM mode generates in ~2 seconds (4 steps)
  • Commercial use: OpenRAIL license

Installation

ComfyUI Manager (Recommended)

Search for "StableMaterials" in ComfyUI Manager and install.

Manual

cd ComfyUI/custom_nodes
git clone https://github.com/P5ina/comfyui-stable-materials.git
cd comfyui-stable-materials
pip install -r requirements.txt

Restart ComfyUI.

Nodes

| Node | Description | |------|-------------| | Load StableMaterials | Load pipeline (LCM or Standard mode) | | Generate PBR (Text) | Text prompt → 5 PBR maps | | Generate PBR (Image) | Input image → 5 PBR maps | | PBR Preview Grid | Combine maps into 2x3 preview | | Split PBR Maps | Utility for routing outputs |

Usage

Basic Text-to-PBR

[Load StableMaterials] → [Generate PBR (Text)] → [Save Image] x5
       (LCM mode)              ↓
                         5 outputs: basecolor, normal, height, roughness, metallic

Image-to-PBR

[Load Image] → [Generate PBR (Image)] → [Save Image] x5
                       ↑
              [Load StableMaterials]

Parameters

Generate PBR (Text)

| Parameter | Default | Description | |-----------|---------|-------------| | prompt | - | Material description | | negative_prompt | "blurry, low quality" | What to avoid | | seed | 0 | Random seed for reproducibility | | steps | 4 | Inference steps (4 for LCM, 50 for standard) | | guidance_scale | 7.5 | How closely to follow prompt | | tileable | True | Generate seamless texture |

Generate PBR (Image)

| Parameter | Default | Description | |-----------|---------|-------------| | image | - | Input reference image | | prompt | "" | Optional text guidance | | image_guidance_scale | 1.5 | How much to follow input image |

Example Prompts

Weathered rusty metal with scratches and peeling paint
Polished marble with gold veins
Old wooden planks with moss
Rough concrete with cracks
Red brick wall with white mortar
Brushed aluminum surface

Output Maps

| Map | Description | |-----|-------------| | Basecolor | Albedo/diffuse color (RGB) | | Normal | Surface normals in tangent space (RGB) | | Height | Displacement/bump map (Grayscale) | | Roughness | Surface roughness 0-1 (Grayscale) | | Metallic | Metalness 0-1 (Grayscale) |

Performance

| Mode | Steps | RTX 4090 | RTX 3080 | |------|-------|----------|----------| | LCM | 4 | ~2s | ~4s | | Standard | 50 | ~15s | ~30s |

Credits

License

MIT License (this repo) OpenRAIL License (StableMaterials model)