Nodes/ComfyUI_PHRenderFormerWrapper/RenderFormer Random Colors
ComfyUI Node

RenderFormer Random Colors

Instant material variety when you're out of ideas (or patience)

By paulh4x·Created about a year ago·Updated about a year ago· 37
RenderFormer Random Colors
  • mesh
  • MESH
mode
seed0
max_brightness1.00

There are times in a 3D workflow when you just want to see what a scene looks like with a bunch of different colors on the objects - without hand-tuning diffuse values on every single mesh. RenderFormerRandomizeColors is that shortcut: it takes a MESH and regenerates its materials with random colors in one of three modes. It's one of the 15 nodes in paulh4x/ComfyUI_PHRenderFormerWrapper, the "100% vibecoded" wrapper around Microsoft's RenderFormer (SIGGRAPH 2025).

How it works

It uses a NumPy RNG seeded by your seed, then rewrites the material list on a deep copy of the mesh - the original node data is untouched, so you can branch off one MESH into both a randomized version and an original. The three modes behave very differently, so pick with intent:

  • per-object - one random color for the whole object. The classic "assign each model a random diffuse color" mode, great for instantly separating characters from backgrounds.
  • per-shading - random colors per shading group, driven by the backend (random_diffuse_type = "per-shading-group"). This is the renamed version of what used to be called "per-triangle" in early builds - it colors by the mesh's shading regions, which tends to look more natural and segmented.
  • per-triangle - a true per-face coloring: every single triangle gets its own color via the renderer's rand_tri_diffuse_seed. This is the loud, experimental, technicolor mode.

The inputs

  • mesh - any MESH.
  • mode - one of the three above.
  • seed - an integer up to 10 digits. Set it to reproduce a color scheme; change it to reroll. The code limits it to 999,999,999, so the old "way too big seed" crash is a fixed bug, not a feature.
  • max_brightness - 0 to 1, default 1. Scales the generated colors down; set it low for muted, pastel-ish palettes or to keep random colors from blowing out the render.

One output, MESH, which flows into the Scene Builder (or through Combine first).

Getting a specific color scheme

Because the seed fully determines the colors, this is the poor man's palette control: pick a seed you like, keep it, and you get reproducible material sets. It's also handy for generating color variants for a video - render the same camera move several times with different seeds and composite.

Installing it

# ComfyUI Manager: search "ComfyUI_PHRenderFormerWrapper"
cd ComfyUI/custom_nodes/
git clone https://github.com/paulh4x/ComfyUI_PHRenderFormerWrapper.git
cd ComfyUI_PHRenderFormerWrapper
git clone https://github.com/microsoft/renderformer.git renderformer
pip install -r requirements.txt
python -c "import imageio; imageio.plugins.freeimage.download()"

Restart ComfyUI.

Common issues

  • A WrongTypeError on old versions - earlier builds had a bug where random_diffuse_type was set to the invalid string "per triangle". That's fixed in 0.3.35+, so update via Manager if you see it.
  • Colors don't change / all white - check max_brightness; at 0 everything is black, and per-shading/per-triangle modes delete the direct diffuse so the renderer's random path is in charge. If your material override is coming from a connected MATERIAL, that can fight the randomization.
  • Everything looks like a disco floor - you're in per-triangle. Switch to per-object for something calmer.

It's the node you reach for when iteration speed matters more than art direction - and it's a genuinely fun way to discover what your scene geometry does in color.

CategoryPHRenderFormer

Inputs (4)

NameTypeDefaultDescription
meshMESH
modeCOMBO3 options: per-object, per-shading, per-triangle
seedINT00–999999999
max_brightnessFLOAT1.000–1

Outputs (1)

NameTypeDescription
MESHMESH