ComfyUI Node

UV Pin

The islands you refuse to let the packer touch

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

UV Pin is how you tell Blender "this island is placed exactly where I want it, leave it alone." Unwrap and pack operators are perfectly happy to move, rescale, and rotate your carefully-placed UVs - pinning locks selected UV vertices in place so they survive the next operation. If you've hand-positioned the character's face on the texture map and dread what a pack pass might do to it, this is the node that gives you peace of mind.

How it works

Yet another auto-generated Blender wrapper in the Avatar Graph pack, this one calling bpy.ops.uv.pin. It takes your BPY_OBJ, enters edit mode, and pins (or unpins) the selected UV vertices. The single input beyond the mesh is clear: off (default) means pin the selection; on means unpin it. Output is the same BPY_OBJ.

Pinning works because the operators respect it. In particular, UV Pack Islands (also in this pack) has a pin toggle plus pin_method options (SCALE, ROTATION, ROTATION_SCALE, LOCKED) that decide how strictly pinned islands are protected - LOCKED won't even scale them. So Pin is less of a standalone feature and more of a flag that downstream nodes honor. No pinning, and the packer treats your hand-placed islands as fair game.

Where it fits

In an Avatar Graph workflow, pinning is the "lock the important bit" move. Typical sequence: select the mouth or eye island, run UV Pin, then run UV Pack Islands with pin: true - the important island stays put while everything else packs around it. Given the pack's embedded Blender has no visible UV editor, this is your way to make sure the face stays where it belongs on the texture without eyeballing it after every pass. Use clear: true on a copy of the node when you're done if you want the flags gone before export.

One note: pinning without a pack/unwrap after it does nothing visible - it's a constraint, not an edit. If the node seems useless on its own, that's because it's meant to be chained.

Installing Avatar Graph

This node ships in the Avatar Graph pack from Avatech. From ComfyUI/custom_nodes:

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

then restart ComfyUI with --enable-cors-header. Or ComfyUI Manager → search Avatar Graph → Install.

Pack-wide gotchas: bpy==3.6.0 is pinned and only builds on Python 3.10.x - other versions fail the pip install and load zero nodes. First run downloads the ~2.5 GB SAM model, which looks like a freeze. And the pack is explicitly still in development, so pin the version once things work.

Categoryblender

Inputs (2)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
clearoptBOOLEANfalse

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ