Nodes/BrainDead Nodes/BD Apply Color Field
ComfyUI Node

BD Apply Color Field

Reapply colors to a decimated mesh without breaking the topology

By BizaNator·Created 8 months ago·Updated 3 days ago· 15
BD Apply Color Field
  • mesh
  • color_field
  • mesh
  • status
sampling_modeface
preserve_materialtrue
default_color0.5,0.5,0.5,1.0
distance_threshold3.0

Here's a classic image-to-3D trap: your generated mesh has colors baked into its vertices, then you decimate or remesh it, and the color information is gone - or worse, still there but wrong. BD Apply Color Field exists to stop that. It takes a COLOR_FIELD (the voxelgrid color data from earlier in the pipeline) and re-applies it to whatever mesh you've processed, after the processing is done.

That ordering is the whole point. The pack's own docs are explicit: sample colors first, then process the mesh, then apply colors. If you bake colors onto a mesh before you decimate it, the color boundaries force the decimator to split faces to hold the color seams, and your clean low-poly work turns back into soup. Sampling spatially on clean topology, then applying later, keeps the geometry intact.

Where the COLOR_FIELD comes from

You get a COLOR_FIELD from BD_SampleVoxelgridColors (which pulls colors out of a TRELLIS2 voxelgrid) or from BD_UnpackBundle (which takes a mesh bundle apart into components, color field included). The pattern is:

  1. BD_SampleVoxelgridColors → COLOR_FIELD
  2. BD_BlenderDecimate / remesh / whatever on the raw mesh
  3. BD_ApplyColorField → recolored processed mesh

The inputs that matter

  • sampling_mode - the one you'll actually think about. face gives one solid color per face with no bleeding, which is what you want when edge-marking or stylized flat colors are next. sharp is per-vertex nearest-neighbor, smooth is a k=4 weighted blend for soft gradients.
  • preserve_material (default true) - stashes the original UVs in mesh metadata so downstream PBR reconstruction still works. Colors are always applied natively to mesh.visual.vertex_colors, so you're not destroying anything.
  • distance_threshold (default 3) and default_color - vertices whose nearest voxel is farther than the threshold get default_color (default 0.5,0.5,0.5,1.0). If your processed mesh pokes outside the voxel bounds you'll see gray patches; nudge the threshold up.

Outputs are the recolored mesh (TRIMESH) and a status string. Feed the mesh onward into exports, edge marking, or the pack's Blender tools.

Install

Part of ComfyUI-BrainDead, so the usual - ComfyUI Manager, search "BrainDead", or:

cd ComfyUI/custom_nodes
git clone https://github.com/BizaNator/ComfyUI-BrainDead
cd ComfyUI-BrainDead
pip install -r requirements.txt

Restart, and all the BD nodes appear under 🧠BrainDead. Note this pack runs on the ComfyUI V3 API, so keep ComfyUI updated or nothing registers. This node itself is pure Python (no Blender, no big model), so it's one of the friendlier ones to start with.

One last tip: if you're feeding a COLOR_FIELD into BD_BlenderDecimate, the decimator accepts it directly as an optional color_field input - that's the recommended path and avoids pre-applying entirely. Use this node when you've already processed the mesh and need colors back on it.

Category🧠BrainDead/Mesh

Inputs (6)

NameTypeDefaultDescription
meshTRIMESH
color_fieldCOLOR_FIELD
sampling_modeoptCOMBOfaceface=per-face solid | sharp=nearest | smooth=blended
preserve_materialoptBOOLEANtrueSave original UVs in metadata for downstream PBR reconstruction. Colors always applied natively to mesh.visual.vertex_colors.
default_coloroptSTRING0.5,0.5,0.5,1.0RGBA for vertices beyond distance threshold
distance_thresholdoptFLOAT3.00.5–20Max voxel-units distance before using default color

Outputs (2)

NameTypeDescription
meshTRIMESH
statusSTRING