Nodes/Avatar Graph/UV Export Layout
ComfyUI Node

UV Export Layout

Baking a UV layout image so you can paint your avatar texture by hand

By avatechai·Created 3 years ago·Updated 2 years ago· 264
UV Export Layout
  • BPY_OBJ
  • size
  • BPY_OBJ
filepath
export_allfalse
modifiedfalse
mode
opacity0.25
check_existingtrue

UV Export Layout writes your UV islands to an image file you can actually look at and paint on. It wraps bpy.ops.uv.export_layout, Blender's "Export UV Layout" - the tool that dumps an SVG, EPS, or PNG of the current UV layout. In the avatar pipeline this is the bridge to hand-work: Avatar Graph handles the automatic part (segmentation, meshing, unwrapping), but the moment you want to touch up a character texture in an image editor while keeping the UVs lined up, this node gives you the stencil to paint against.

It's the output side of the UV story, and a genuinely practical one. The pack's other UV nodes fix and arrange your islands; this one turns them into something a human (or a texture model) can work with. SVG in particular is gold - it's vector, so you can scale it without losing the island outlines, then drop the painted result back onto the mesh.

How it works

A UV_* EditOps node: enter edit mode, run the export operator, exit, pass the object through. The inputs that matter:

  • filepath - where to write the file. No file browser in a headless graph; you type an absolute path, and the format is implied by the extension you give it (.svg, .eps, .png).
  • mode - SVG, EPS, or PNG. SVG for painting-friendly vectors; PNG for a quick raster preview.
  • size - a B_VECTOR2 for the output resolution/scale of the layout image.
  • opacity - the island fill opacity (default 0.25) for the raster modes. Lower = fainter islands, useful when you're painting on top.
  • export_all - export every island on the mesh instead of just the selected ones.
  • modified - use the modified (deformed) mesh rather than the base geometry for the layout.
  • check_existing (default true) - refuse to overwrite an existing file unless told otherwise.

The selection caveat applies: by default it exports the current UV selection; flip export_all if you want the whole mesh's layout.

Inputs that matter

BPY_OBJ, filepath (absolute path, right extension), mode (SVG is usually the one), and export_all when you want everything.

Output: BPY_OBJ - the mesh, unchanged, passed through. The real output is the file on disk.

Installing it

Part of the Avatar Graph pack (Avatech AI). 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 needs Python 3.10.x or the whole pack fails to 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. Standard for this pack.
  • No file appears → check the path is absolute, the parent directory exists, and the extension matches the mode. check_existing can also silently skip if it thinks the target exists.
  • Only part of the layout exportedexport_all was off and you exported the selection. Flip it on for the full layout.
  • Blurry layout image → PNG was rasterized at a low size. Export SVG, or raise the size.
  • Scene resets between runs - unwrap and export in one graph.

For anyone who finishes the automatic pipeline and wants to hand-polish the texture, this is the node that makes it possible. Export the layout, paint outside the graph, bring it back.

Categoryblender

Inputs (8)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
filepathoptSTRING
export_alloptBOOLEANfalse
modifiedoptBOOLEANfalse
modeoptCOMBO3 options: SVG, EPS, PNG
sizeoptB_VECTOR2
opacityoptFLOAT0.250–1
check_existingoptBOOLEANtrue

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ