π UV Unwrap (Standard Xatlas)
Real UVs Without Leaving the Graph
- mesh
- info
- mesh
What it's actually for
xatlas is the unwrapper everybody actually uses - it's the thing that made "generate a mesh and texture it in the next step" workflows possible at all, and it's the named fix in the community's complaint that generated meshes arrive with broken UVs. This node wraps it: feed in a TRIMESH, get out the same shape with a fresh UV atlas, no Blender trip required.
If you're baking textures, projecting a texture, or feeding the mesh to anything that expects a sane 0-1 UV layout, you run this first. If you only want a preview for a 3D print, you don't need it.
How it works
The node hands your vertices and faces to xatlas, generates the atlas with two packing options - the target atlas resolution and the pixel padding between charts - then rebuilds the output mesh from xatlas's vertex remap, adding a texture visual carrying the new UVs.
Two consequences you should know before you wire it up:
- Vertex count grows. xatlas splits vertices along seams, which is exactly what you want (clean UV islands) and exactly why the output mesh isn't vertex-index-identical to the input. Anything that cached per-vertex data against the old indexing - curvature arrays, vertex colours, a rig - is no longer aligned.
- The old UVs are gone. This replaces the visual, it doesn't merge.
After the unwrap it calls gc.collect() and ComfyUI's soft cache empty, which is the author being tidy about the fact that a 4096 atlas on a dense mesh allocates real memory.
The inputs that matter
- mesh - your TRIMESH. Welded, non-degenerate geometry unwraps far better; run the pack's
AntonioilevUVWatertighthard weld first if you're getting shattered islands. - resolution (default 2048, 512-8192) - the atlas resolution the packer targets. Set this to the texture size you actually intend to bake at, because it's what
paddingis measured against. Unwrapping at 2048 and baking at 1024 means your padding is half as wide as you thought. - padding (default 4, 0-64) - pixels of empty space between charts. Zero padding will bite you the moment a bake bleeds or a mip level samples across a seam; 4-8 is the usual range.
Outputs are info, a short string reporting the resolution and padding used, and mesh - the re-unwrapped TRIMESH. Chain info into any string display node if you like a paper trail; chain mesh into preview.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Antonioilev/ComfyUI_Antonioilev_Lightpack.git
# restart ComfyUI
Search "Antonioilev Light Pack" in ComfyUI Manager if you'd rather not touch a terminal. The pack has no requirements.txt and swallows import failures, so if the node is missing from the Antonioilev/UV menu, look for the [...] Loaded N nodes (M failed) line in your console - that's where the actual error hides. This node needs:
pip install xatlas
Where people get burned
- Degenerate faces break charts. Zero-area triangles and duplicated faces are the classic cause of "unwrapped into 900 islands". Weld and clean first.
- Order matters. Weld β unwrap β bake. Unwrapping after you've painted a texture throws the texture away.
- Padding isn't optional for baking. If your baked maps have seam streaks, raise
paddingbefore you blame the bake settings. - It's an atlas packer, not a retopology tool. The output has the same triangles, just cut and laid flat. If the geometry itself is soup,
AntonioilevRemeshGPUis the node before this one.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| mesh | TRIMESH | β | |
| padding | INT | 40β64 | β |
| resolution | INT | 2048512β8192 | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| info | STRING | β |
| mesh | TRIMESH | β |