Nodes/Avatar Graph/UV Select Mode
ComfyUI Node

UV Select Mode

Vertex, edge, face, or island

By avatechai·Created 3 years ago·Updated 2 years ago· 264
UV Select Mode
  • BPY_OBJ
  • BPY_OBJ
type

UV_SelectMode is a one-knob node that does exactly what its name says: it switches what "select" means in UV space. You feed it a mesh and pick between VERTEX, EDGE, FACE, or ISLAND, and the node tells the headless Blender driving the Avatar Graph pack which selection mode to use for everything that comes after. If you've ever done UV work in Blender you've used this dropdown a hundred times - this is just that dropdown, promoted to a node.

Why you'd bother

In the avatar pipeline, UVs are where the texture actually lives. A generated character image gets cut into layers, each layer becomes a mesh, and Plane Texture Unwrap (or a cube/sphere projection) lays out those UVs so the texture maps onto the geometry. The whole reason these meshes exist is so they can deform in real time without tearing the image apart. Once your UVs exist, a lot of the fiddly cleanup - selecting a UV island to reposition it, selecting a seam edge to mark it, straightening a region - starts with choosing the right selection mode. UV_SelectMode is that first step, and it's also the node you reach for when a UV operator is silently doing nothing because it's selecting the wrong element type.

How it works

This is an auto-generated wrapper around Blender's bpy.ops.uv.select_mode operator. Look at blender/ops_mesh.py and you'll find the uv_api list of operators, each turned into a UV_-prefixed node by create_ops_class. The wrapper inherits from EditOps, which means the node:

  1. Deselects everything and makes your object active,
  2. switches to edit mode,
  3. runs the operator,
  4. switches back to object mode,
  5. hands the same object back.

That last point is the important part: like every node in this pack, UV_SelectMode mutates the Blender scene and then passes the same BPY_OBJ out the other side. The value travels forward as state, not as a data change you can inspect on the wire.

Inputs and outputs

  • BPY_OBJ (optional) - the mesh whose UV selection mode you're setting.
  • type - the enum: VERTEX, EDGE, FACE, or ISLAND. ISLAND is the one people usually want for arranging texture regions; FACE is the sensible default for most other work.

Output: BPY_OBJ, the same object, ready to feed the next UV operation.

Install and gotchas

It comes with the whole Avatar Graph pack. Install via ComfyUI Manager (search "Avatar Graph") or:

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

The pack pins bpy==3.6.0, which requires Python 3.10, and it downloads the SAM checkpoint plus mediapipe models on first load, so don't be surprised by the initial multi-gigabyte download.

The setup has three quirks that trip people up. The headless Blender scene resets to factory settings each run, so every execution rebuilds the world from scratch. The object handles are only valid within that single run. And the live avatar preview needs ComfyUI launched with --enable-cors-header; without it, you still get the final GLB/GLTF export via Avatar Main Output, just no real-time viewer.

UV_SelectMode is a utility node, not a headline feature - but when you're massaging UV islands for a clean texture wrap, it's the difference between selecting what you meant to and wondering why nothing happens.

Categoryblender

Inputs (2)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
typeoptCOMBO4 options: VERTEX, EDGE, FACE, ISLAND

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ