Nodes/Avatar Graph/Object Assign Texture
ComfyUI Node

Object Assign Texture

Getting your ComfyUI image onto the mesh

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Object Assign Texture
  • BPY_OBJ
  • texture
  • BPY_OBJ
texture_namemy_image

Every other node covered in this pack's mesh-editing family only ever touches geometry - vertices, faces, UVs. None of them get pixels onto a mesh. Object_AssignTexture is the bridge: it's the node that actually connects a ComfyUI IMAGE to a Blender material on your object.

What it is and why you'd reach for it

There's no bpy.ops.object.assign_texture() in Blender's own API - like Object_AddShapeKeys and Object_AssignPropertyDefaults, this is pack-authored code rather than a raw operator wrap, built specifically to close the gap between "a tensor coming out of a ComfyUI generation node" and "an actual image texture on a Blender material."

This is the step that makes the rest of the pipeline visible. You generate or load a character image in ComfyUI, segment it, build mesh layers from the segments (Create Mesh Layer), UV-unwrap them (Plane Texture Unwrap, possibly after a Mesh_UvTextureAdd/Mesh_UvsRotate/Mesh_UvsReverse cleanup pass) - and none of that puts a visible surface on the mesh by itself. Object_AssignTexture is what takes an IMAGE and actually paints it onto the object, so what you see in the embedded editor.avatech.ai preview (or in an exported .GLB) matches the artwork you generated.

Inputs and outputs that matter

  • BPY_OBJ (optional) - the mesh object to assign the texture to. It needs a UV map already in place (see Mesh_UvTextureAdd / Plane Texture Unwrap) for the texture to land correctly rather than projecting arbitrarily.
  • texture (IMAGE) - the image to apply, from any ComfyUI image-producing node.
  • texture_name (string, default "my_image") - the name given to the resulting texture/material data-block. Worth setting to something meaningful if your graph is building an object with multiple textured parts (eyes, mouth, body), since the placeholder default won't distinguish them from each other.

Output: a single BPY_OBJ, now with the image assigned as a texture.

Installing Avatar Graph

bpy, the library the whole pack runs on, only ships wheels for Python 3.10.x - get that pinned before anything else.

ComfyUI Manager: search avatar-graph-comfyui, install, restart. Or manually:

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

Restart with python main.py --enable-cors-header (--force-fp16 too on Mac). Windows gets a prebuilt Python 3.10 environment from the README; macOS/Linux is pointed at a dedicated conda create --name comfyui python=3.10.

Common issues

Texture applied but looks stretched or misaligned. That's almost always a UV problem, not a texture-assignment problem - check the mesh actually went through an unwrap step (Plane Texture Unwrap) before reaching this node, and consider Mesh_UvsRotate/Mesh_UvsReverse if it's just rotated or mirrored wrong rather than genuinely distorted.

Multiple objects end up sharing one texture name and get confused downstream. Set texture_name explicitly per object rather than leaving the my_image default on more than one mesh in the same graph.

Nodes not appearing in ComfyUI at all. Check python --version reads 3.10.x - bpy fails to import outside that range and the whole pack won't register.

No live avatar preview panel. Needs --enable-cors-header on launch to reach the embedded editor.avatech.ai panel. Without it, the graph still runs and applies the texture correctly - export the result via right-click → Save File on Avatar Main Output to check it in Blender or another viewer.

Categoryblender

Inputs (3)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
textureoptIMAGE
texture_nameoptSTRINGmy_image

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ