Nodes/Avatar Graph/UV Select Box
ComfyUI Node

UV Select Box

ComfyUI Node Guide

By avatechai·Created 3 years ago·Updated 2 years ago· 264
UV Select Box
  • BPY_OBJ
  • BPY_OBJ
pinnedfalse
xmin0
xmax0
ymin0
ymax0
wait_for_inputtrue
mode

UV Select Box is Avatar Graph's version of a very familiar interaction: dragging a rectangle to select things - except instead of selecting objects or vertices in 3D space, it selects points in a mesh's flattened UV layout. It's part of Avatech's node pack for rigging character illustrations into real-time interactive avatars inside ComfyUI, and it's a supporting tool for the texturing side of that pipeline.

It's a direct wrapper of Blender's bpy.ops.uv.select_box operator - the box-select tool in Blender's UV editor, the 2D equivalent of box-selecting vertices in the 3D viewport. Once a mesh has been UV unwrapped (see the pack's UV Unwrap node), you sometimes need to select a specific region of that UV layout - say, to isolate one part of a texture for a targeted operation, or to feed a specific UV region into another step in your graph.

The inputs map directly onto the interactive tool's own coordinates:

  • xmin, xmax, ymin, ymax - the corners of the selection rectangle, in the UV editor's own screen-space coordinates. This is worth flagging clearly because it's a common trip-up: these are not normalized 0–1 UV coordinates, they're the raw pixel/screen coordinates the interactive tool uses while you're dragging in the editor. Getting a useful selection out of these numbers in a headless graph run means you need to know what coordinate space your particular setup is actually working in - it's inherited straight from the interactive operator's own signature.
  • mode - SET replaces the current selection with the new box, ADD adds to it, SUB subtracts from it. SET is the default behavior most people want.
  • pinned - restricts the operation to pinned UVs only, if you're using UV pinning to lock certain points in place during other unwrap operations.
  • wait_for_input - defaults to true, which in Blender's interactive context means "wait for the user to actually drag before doing anything." In a scripted ComfyUI graph, there's no interactive drag happening - so if this node seems to do nothing when run headlessly, this is the first thing to check. Setting it to false should make the operator act immediately using the xmin/xmax/ymin/ymax values you've supplied, rather than waiting on input that will never come.

Output is the same BPY_OBJ, with its UV selection updated.

Installing it: no standalone install - comes with the full Avatar Graph pack. Easiest route is ComfyUI Manager, searching "Avatar Graph" or avatar-graph-comfyui. Manual install: cd ComfyUI/custom_nodes, git clone https://github.com/avatechai/avatar-graph-comfyui, cd in, pip install -r requirements.txt, restart ComfyUI.

The install issue that actually breaks setups: Avatar Graph needs Python 3.10.x specifically, because its bpy dependency only ships wheels for that version - a newer Python and the install fails outright. The README's fix is a dedicated environment: conda create --name comfyui python=3.10, activate, install ComfyUI's requirements first, then this pack's. For the live avatar preview inside Avatech's web editor, also launch with --enable-cors-header (Mac: add --force-fp16); without it, UV editing and everything else still works, you just export .glb/.gltf and check texturing in Blender instead of a live in-browser preview.

Categoryblender

Inputs (8)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
pinnedoptBOOLEANfalse
xminoptINT0-2147483648–2147483647
xmaxoptINT0-2147483648–2147483647
yminoptINT0-2147483648–2147483647
ymaxoptINT0-2147483648–2147483647
wait_for_inputoptBOOLEANtrue
modeoptCOMBO3 options: SET, ADD, SUB

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ