ComfyUI Node

UV Stitch

Sew the islands back together so seams disappear

By avatechai·Created 3 years ago·Updated 2 years ago· 264
UV Stitch
  • BPY_OBJ
  • objects_selection_count
  • BPY_OBJ
use_limitfalse
snap_islandstrue
limit0.01
static_island0
active_object_index0
midpoint_snapfalse
clear_seamstrue
mode
stored_mode

Every unwrap cuts seams, and seams are where avatars show their seams. UV Stitch is the node that sews the islands back together: you select the shared edges of two islands, run it, and Blender snaps them into one continuous island with no boundary between them. On a character face, this is how you keep the texture flowing across the nose bridge or the chin instead of splitting into visible halves.

It wraps Blender's bpy.ops.uv.stitch() - one of the pack's auto-generated UV operators, and comfortably the most configurable of them. The wrapper enters edit mode on your BPY_OBJ, fires the operator, and returns the same mesh with the stitched layout.

The settings that matter

  • mode (VERTEX / EDGE) - what you're stitching. Edge mode stitches whole selected edges together; vertex mode stitches individual UV vertices. Edge is the common case for island boundaries.
  • snap_islands (bool, default on) - after stitching the edges, snap the whole islands together so they actually touch. Leave it on unless you specifically want edges aligned without merging the islands.
  • use_limit + limit (float) - only stitch vertices within limit distance of each other. The safety valve: turn it on so the operator doesn't weld two nearby-but-unrelated boundaries by accident. Default limit is tiny (~0.01), which is fine.
  • static_island (int) / active_object_index (int) - which island stays put while the others move to it. Zero is the first island; this is how you control which side does the moving during the merge.
  • midpoint_snap (bool) - snap the merged vertices to the midpoint of the gap instead of to the moving island's position. Niche, but handy for symmetric meshes.
  • clear_seams (bool, default on) - clear the seam marks on the stitched edges. Usually exactly what you want: a stitched seam should stop being a seam.

When to reach for it

After any projection (UV Smart Project, UV Sphere Project), the pack's avatar meshes come back with islands separated by seams. Run Stitch along the shared edges of the face islands - say, the two halves of the mouth - and the texture runs across the boundary cleanly. It's also the natural partner to UV Weld for seam cleanup before export.

Inputs and outputs

  • BPY_OBJ in/out - the mesh object. (The pack's schema also surfaces stored_mode, objects_selection_count and friends - those are plumbing for Blender's multi-object stitch state; you can ignore them.)

Installing it

Same pack-wide story: Avatar Graph pins bpy==3.6.0, so your ComfyUI environment must be Python 3.10. 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; first launch downloads the SAM ViT-H model (~2.5 GB) and mediapipe landmarkers. --enable-cors-header gets you the live editor preview; otherwise export a .GLB from Avatar Main Output's right-click menu.

Troubleshooting

The most common "nothing happened" is a selection that doesn't span a real boundary - Stitch needs the edges you selected to actually be shared by two islands. If you selected one island's edge alone, there's nothing to stitch to. And keep an eye on use_limit: with it off, the operator will happily weld the closest UVs even if they aren't the ones you meant. When in doubt, turn it on and keep the limit small.

Categoryblender

Inputs (11)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
use_limitoptBOOLEANfalse
snap_islandsoptBOOLEANtrue
limitoptFLOAT0.010–3.402823466385289e+38
static_islandoptINT00–2147483647
active_object_indexoptINT00–2147483647
midpoint_snapoptBOOLEANfalse
clear_seamsoptBOOLEANtrue
modeoptCOMBO2 options: VERTEX, EDGE
stored_modeoptCOMBO2 options: VERTEX, EDGE
objects_selection_countoptB_VECTOR6

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ