Comfy3D Texture Splitter
Break a textured mesh into separate parts by color — no AI required
- input_3d
- GLB_PATH
Every image-to-3D model in ComfyUI - Hunyuan3D, TripoSR, TRELLIS, the lot - hands you back one textured mesh. One object, one baked texture, no parts. That's fine until you want the base separated from the figure, or the red accent piece on its own to re-texture or print. Comfy3D Texture Splitter cuts the mesh into separate GLB parts by color. It's deliberately dumb, and that's the compliment: it's not a semantic segmenter, it groups faces whose baked texture looks the same color, and it's honest about that limit.
How it works
Under the hood it's pure trimesh and numpy - no model weights, no GPU. It loads the scene, reads the base color texture, and samples each face's color through its UVs. Then it converts RGB to HSV and quantizes. The clever bit is in the weighting: hue gets quantized much more aggressively than saturation and value, so the shading stripes on a wall merge into one region instead of fragmenting into ten, and near-gray faces are pinned to hue zero so they don't scatter. Two rounds of majority voting across neighboring faces smooth the labels. Each color group becomes a submesh - keeping the original material and UVs - and the whole thing exports as a new multi-part .glb (parts named part_0, part_1, …) into your ComfyUI temp folder.
The inputs that matter
Just two, and the first is the flexible one:
input_3d(wildcard, required) - a mesh path string, a{"mesh": ...}dict from ComfyUI-3D-Pack, or a raw trimesh object. Same tolerant intake as the Studio node this pack is built around.quantization_steps(float, default 16, range 0.1–64) - the dial. Crank it up to separate finer color differences into more parts; drop it toward 2–4 to merge similar-looking faces into big chunks. Hue drives the split, so this mostly controls how many hue bands you get.
The single output is GLB_PATH - a string path to the split GLB. Wire it back into Comfy3D-Studio's input_3d to eyeball the result in the viewport, or into any node that consumes a mesh path for saving or further processing.
Installing it
Same pack as the Studio node: ComfyUI Manager - search Comfy3D-Studio - or:
cd ComfyUI/custom_nodes
git clone https://github.com/Aero-Ex/Comfy3D-Studio
Restart, and here's the trap: this node hard-requires trimesh, but the pack's pyproject doesn't declare it (the import is lazy, and the Studio viewport doesn't need it). If you hit ModuleNotFoundError: trimesh, install it into ComfyUI's Python:
cd ComfyUI
../venv/bin/pip install trimesh # or however your environment is set up
No models, no CUDA builds, no downloads. MIT licensed.
When it won't do what you want
A few honest limits, straight from how it's built:
- No texture or no UVs → it skips. It prints a message and returns the original path unchanged. There's nothing to split by color without a texture to sample.
- Same color means same part. A white table and a white wall will not separate. This is color segmentation, not understanding.
- Low-saturation grays get lumped together. That's usually the desired behavior (shading stripes merge), but it can also merge two distinct gray objects you wanted apart.
- Big organic meshes are slow. The per-face numpy work is fast, but a million-triangle mesh with a 4K texture takes a while. Fine for props, less fine for characters.
Reach for it when you want color-boundary cuts: separating a colored prop into base plus accents for 3D printing, isolating one piece to re-render through img2img, or prepping parts for a join pass. For real semantic part separation you'd want an actual segmentation model - but for "cut this thing apart along its colors," this is zero-drama and usually good enough.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| input_3d | * | — | |
| quantization_steps | FLOAT | 16.00.1–64 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| GLB_PATH | * | — |