Nodes/BrainDead Nodes/BD UV Unwrap
ComfyUI Node

BD UV Unwrap

Give a machine-generated mesh a UV layout that doesn't look like a crime scene

By BizaNator·Created 8 months ago·Updated 3 days ago· 15
BD UV Unwrap
  • mesh
  • mesh
  • status
methodblender_smart_uv
seams_from_sharptrue
angle_limit66
island_margin0.02
chart_refine_iterations0
chart_global_iterations1
chart_smooth_strength1.0
timeout300

If you've ever loaded an image-to-3D result and found the texture smeared across the mesh like melted paint, you've met the "machine-generated UV unwrap" problem. The KB doc for 3D generation calls it out bluntly: the shapes look great and the geometry underneath is junk - and "messed-up UV unwrapping" is the second half of that sentence. This node is the fix that fits inside ComfyUI. BD UV Unwrap takes a TRIMESH and produces a clean UV layout using either the GPU-accelerated xatlas path or Blender's Smart UV Project, so you can actually bake a texture onto the thing without seams going everywhere.

It's the node to run before you texture-bake or export an atlas - part of the BrainDead recipe for turning TRELLIS2/Pixal3D voxel output into something a game engine will accept.

The two engines

  • blender_smart_uv (default) - Blender's Smart UV Project, the quality option. It respects seams, and with seams_from_sharp on (default), it auto-creates UV seams from sharp edges - which in this pack means color boundaries, so a stylized character's color-coded parts get clean seams instead of cuts through the middle of a face.
  • cumesh_gpu / xatlas_gpu - CuMesh chart clustering plus xatlas packing. Fast, GPU-accelerated, good for game assets where speed matters more than packing perfection.

The shared knobs:

  • angle_limit (default 66°) - Smart UV's angle limit on Blender; the cone half-angle on the CuMesh side. Lower = more islands.
  • island_margin (default 0.02) - spacing between UV islands. If you see texel bleed at island edges under mipmapping, bump this up.

The CuMesh-only chart controls (chart_refine_iterations, chart_global_iterations, chart_smooth_strength) tune the chart clustering; the timeout (default 300s) caps how long the Blender subprocess is allowed to run.

The Blender gotcha

The blender_smart_uv method runs a real Blender headlessly via subprocess, and it needs a Blender binary to exist. The pack ships one under lib/blender/, and the loader also checks sibling packs (ComfyUI-GeometryPack, ComfyUI-UniRig) and system Blender. If none is found, the node bails. First thing to check when this node errors: is there actually a Blender on disk?

Installation

Pack install as usual:

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

Or ComfyUI Manager → search "BrainDead". The xatlas/CuMesh method needs CuMesh (it's part of the pack's mesh tooling; if you get a cumesh import error you're missing that piece), and the Blender method needs the bundled or system Blender described above. No model downloads.

Common issues

  • "Blender not found" - the loader searched its known paths and came up empty. Check the bundled lib/blender/ survived the clone, or point it at a system Blender.
  • Textures still look smeared after baking - bump island_margin so islands don't bleed into each other, and check seams_from_sharp is on if your mesh has distinct color regions. A color-coded part mesh without seams is exactly how you get a texture smeared across the wrong island.
  • Slow unwrap on big meshes - either raise timeout (the Blender pass is a subprocess and the clock is ticking) or switch to xatlas_gpu for the speed.
Category🧠BrainDead/Mesh

Inputs (9)

NameTypeDefaultDescription
meshTRIMESH
methodCOMBOblender_smart_uvUV unwrap algorithm. cumesh_gpu uses CuMesh chart clustering + xatlas packing.
seams_from_sharpBOOLEANtrueAuto-create UV seams from sharp edges (color boundaries) [Blender only]
angle_limitFLOAT661–89Smart UV angle limit (Blender) / cone half-angle in degrees (CuMesh)
island_marginFLOAT0.020–0.5UV island margin
chart_refine_iterationsoptINT00–1000Chart clustering refinement iterations (CuMesh only). Higher = better charts, slower.
chart_global_iterationsoptINT11–10Chart clustering global iterations (CuMesh only)
chart_smooth_strengthoptFLOAT1.00–5Chart boundary smoothing strength (CuMesh only)
timeoutoptINT30060–1800Maximum processing time in seconds (Blender only)

Outputs (2)

NameTypeDescription
meshTRIMESH
statusSTRING