ComfyUI Node

UV Align

The tiny fix for 'why is my texture slightly smeared'

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

UV Align straightens UV vertices. It wraps Blender's bpy.ops.uv.align, which lines up the selected UVs along a chosen direction - and in Avatar Graph's world that's a small but real quality-of-life win, because everything in this pack is texture-mapped. Characters are segmented images stretched over mesh planes, and a UV that's off by a fraction of a degree shows up immediately as a smear along an edge or a lip. This is the node that fixes it.

It's not a glamorous tool. There's no creative output, no "wow." It's a correctness tool, the kind you pull out when a texture boundary doesn't line up and the quickest fix is "select those UVs, align them, move on." Blender users will recognize it as the align tool in the UV editor's menu; this node just makes it available mid-graph.

How it works

A UV_* node, so it inherits EditOps: deselect all, set your BPY_OBJ active, enter edit mode, run bpy.ops.uv.align on the UV editor's current selection, exit, pass the object back. The single exposed input is axis, and it's the whole game:

  • ALIGN_S - line UVs up along the S axis.
  • ALIGN_T - line them up along the T axis.
  • ALIGN_U - align to the U direction.
  • ALIGN_X / ALIGN_Y - align to a specific UV axis (Blender's UV-space X or Y).
  • ALIGN_AUTO - let Blender pick the dominant direction.

In practice you'll mostly reach for the two axis options (align to horizontal or vertical) and AUTO when you want the lazy version. The node acts on whatever UVs are selected in the shared scene - the same selection caveat that runs through every edit-mode node in this pack.

Inputs that matter

  • BPY_OBJ - the mesh whose UVs you're fixing.
  • axis - the direction to align to. ALIGN_AUTO for quick cleanups, an explicit axis when you know exactly what you want.

Output: BPY_OBJ - the mesh, UVs adjusted, for the next node.

Installing it

Part of the Avatar Graph pack. ComfyUI Manager → search "Avatar Graph", or:

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 after. Pack gotchas: bpy==3.6.0 requires Python 3.10.x (a 3.11+ env breaks the pack's import), and first launch downloads the SAM ViT-H model (~2.5 GB) to ComfyUI/models/sams plus two MediaPipe landmarker files.

Common issues

  • "No module named bpy" → Python 3.10.x. The pack's constant companion.
  • Alignment did nothing → no UVs selected, or the mesh has no UV layer. Check the selection upstream and confirm the object is unwrapped (a UV_CubeProject before this is the usual setup).
  • It aligned the wrong UVs → selection. The node works on the UV editor's current selection, so select deliberately upstream.
  • Scene resets between runs - unwrap, align, and export in one graph.

If your character textures look almost right but not quite, this is the 30-second fix. Not a node you build workflows around - just one you're glad exists when the smear shows up.

Categoryblender

Inputs (2)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
axisoptCOMBO6 options: ALIGN_S, ALIGN_T, ALIGN_U, ALIGN_AUTO, ALIGN_X, ALIGN_Y

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ