ComfyUI Node

UV Weld

Merge the duplicate UVs that projections leave behind

By avatechai·Created 3 years ago·Updated 2 years ago· 264
UV Weld
  • BPY_OBJ
  • BPY_OBJ

UV Weld is the "remove doubles" of UV space. Auto-generated avatar meshes come out of projections with duplicated UV vertices sitting on top of each other - same spot in the texture, separate entries in the data, which means seams, splits, and weird pinning behavior. Weld merges those coincident UVs into one, collapsing the duplicates.

It wraps Blender's bpy.ops.uv.weld() in the Avatar Graph pack's auto-generated Blender operator family, and it is the simplest possible node: one input, one output, zero settings. It operates on whatever UVs are selected, merging any that are close enough to count as the same point.

Why duplicates appear and why they matter

Every time a mesh is projected or its UVs are split (seams, separate islands sharing a boundary), Blender ends up with multiple UV vertices that occupy the same texture coordinate. They look identical in the layout but they're distinct data - so a pin on one doesn't pin the other, a snap moves one and leaves the other behind, and the two edges can disagree during export. For an avatar that gets driven by shape keys, that disagreement shows up as a crack that opens and closes as the mesh deforms.

Weld is the cleanup that closes the loop: run it after projections, after stitching, before export. It's often the last node in the "select → stitch → weld" chain that leaves the UV layout watertight.

How it works

Standard wrapper behavior: edit mode on your BPY_OBJ, call the operator, return the same object. Selected UVs that coincide are merged, and the selection becomes the merged set. Because the node has no threshold input exposed, it welds within Blender's internal tolerance - which is exactly right for cleanup of coincident duplicates and exactly wrong for trying to snap together far-apart UVs (that's UV Stitch's job).

Inputs and outputs

  • BPY_OBJ in - the mesh with duplicated UVs.
  • BPY_OBJ out - the same mesh, duplicates merged.

Nothing else. If you want more control, you're looking for a different node; this one is deliberately boring.

Installing it

Avatar Graph installs as one pack with the usual wall in front of it: bpy==3.6.0 is pinned, so Python 3.10 is required in your ComfyUI environment. ComfyUI Manager: search "Avatar Graph." Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/avatechai/avatar-graph-comfyui
cd avatar-graph-comfyui
python -m pip install -r requirements.txt

Restart ComfyUI and let the first launch download the SAM ViT-H model (~2.5 GB) plus mediapipe face/pose landmarkers in the background - that startup download is expected, not an error. For the live preview in editor.avatech.ai, start ComfyUI with --enable-cors-header.

Troubleshooting

The silent trap: Weld only merges selected UVs, and only ones that already coincide. If it "does nothing," your duplicates probably aren't selected, or they're close-but-not-identical - in which case you need UV Stitch (or a snap) first to bring them together, then Weld to seal the merge. And don't reach for Weld to snap islands together; that's not its job, and the fixed tolerance will just refuse. The pack's README also warns the nodes are still changing, so if a template workflow's weld behavior looks off, update the pack before assuming the node is at fault.

Categoryblender

Inputs (1)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ