Nodes/Avatar Graph/Plane Texture Unwrap
ComfyUI Node

Plane Texture Unwrap

The node that gives your flat avatar plane real UVs and a texture

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Plane Texture Unwrap
  • BPY_OBJ
  • image
  • BPY_OBJ
scale1.00
texture_nameTexture

Every character in the Avatar Graph pipeline starts as a flat plane with an image stuck on it. Plane Texture Unwrap is the node that turns that flat image into a mesh Blender can actually texture-map, and it's the quiet workhorse of the whole rig. If your textured layers come out black, blank, or distorted further down the graph, this is usually where it went wrong.

It's one of the few hand-written nodes in the pack. Most of Avatar Graph's ~300 nodes are auto-generated thin wrappers around Blender's bpy operator API; this one was written by hand because the "make an image plane texturable" sequence doesn't map to a single operator. Under the hood it runs three Blender ops in order: mesh.fill with beauty fill (closes any holes in the face so you don't get a gappy surface), uv.cube_project with scale_to_bounds=True (packs the UV islands so the whole texture maps cleanly to the face), and then an assign_texture call that binds your image to the object's material.

Inputs and outputs that matter

  • BPY_OBJ - the mesh layer object coming out of Create Mesh Layer (or whatever flat mesh you're unwrapping).
  • image - the segment image that becomes the texture. Usually the same segment that made the mesh.
  • scale - cube projection size, default 1. Because scale_to_bounds is on, this mostly matters when you want the texture to tile or wrap differently; for a single avatar layer, leave it.
  • texture_name - what the texture gets called in the material, default "Texture". Keep it consistent if you're assigning materials downstream.

Output is a single BPY_OBJ, the same object now with filled faces, proper UVs, and a texture assigned. That wires straight into Join Meshes or Match Texture Aspect Ratio in the basic rigging template.

Installing it

It ships in the Avatar Graph pack, so installing the pack gives you this node too. Via ComfyUI Manager, search "Avatar Graph" (repo avatechai/avatar-graph-comfyui) → Install → restart. Or by hand:

cd 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. The heavy lifting here is the dependency stack: the pack needs bpy==3.6.0, which only installs on Python 3.10 (use a conda env or the bundled Windows 3.10 runtime from the README), plus SAM, mediapipe, and opencv. On first launch it auto-downloads a ~2.5GB SAM checkpoint and two mediapipe landmarker files, so the first boot is slow.

Common issues

  • Black/blank texture - check the image wire and texture_name; a name mismatch means the texture never lands on the material.
  • Nothing visibly changes - this node operates in the headless Blender scene that resets between runs, so you'll only see results after the whole graph runs to Avatar Main Output (or a preview node). Don't judge it mid-graph.
  • Distorted UVs on very wide layers - remember the mesh layer is created at 1:1 aspect, which is why the workflow puts Match Texture Aspect Ratio after this node, not before.
Categoryblender

Inputs (4)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
imageoptIMAGE
scaleoptFLOAT1.00
texture_nameoptSTRINGTexture

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ