Nodes/Avatar Graph/Object Add Shape Keys
ComfyUI Node

Object Add Shape Keys

Batch-creating the keys your rig actually needs

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Object Add Shape Keys
  • BPY_OBJ
  • BPY_OBJ
shape_keyskey1,key2
from_mixfalse

This is the node where Avatar Graph stops being "Blender's mesh toolkit exposed as ComfyUI nodes" and starts being purpose-built for what the pack actually does: rigging a character for real-time blinking and lipsync.

What it is and why you'd reach for it

Blender's own shape-key operator, bpy.ops.object.shape_key_add(), adds one shape key at a time, and takes a single from_mix argument - nothing else. Object_AddShapeKeys isn't that operator wrapped directly; its schema (a comma-separated shape_keys string, defaulting to the placeholder key1,key2) makes clear it's pack-authored glue on top: give it a list of names and it creates a shape key for each one on the object in a single pass.

This is exactly the step that sits between getting a clean mesh (via the Mesh_* cleanup nodes) and actually rigging it. Avatar Graph's whole pitch is real-time interactive avatars - an eye blink, a mouth that opens for lipsync - and those are driven by shape keys wired into the pack's "Shape Flow" runtime graph. Before you can pose or drive a shape key with Mesh Modify Shape Key (the pack's node for actually deforming a named key), the key has to exist on the object. This node is how you create a batch of them - blink_L, blink_R, mouth_open, or whatever your rig needs - in one step instead of one node call per key.

Inputs and outputs that matter

  • BPY_OBJ (optional) - the mesh object to add shape keys to.
  • shape_keys (string, multiline, default "key1,key2") - a comma-separated list of the shape key names to create. Replace the placeholder with your actual names, matching whatever you plan to reference downstream when posing them.
  • from_mix (bool, default False) - whether each new key starts as a copy of the object's current mixed shape (all active shape keys blended together) or as a plain copy of the basis mesh. Leave this False for a standard rig where you'll be posing each key from a clean base.

Output: a single BPY_OBJ, now carrying the newly created (empty) shape keys, ready to be posed.

Installing Avatar Graph

bpy, the library the whole pack runs on, only ships wheels for Python 3.10.x - pin your environment to that 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 has a prebuilt Python 3.10 environment linked from the README; macOS/Linux is pointed at a dedicated conda create --name comfyui python=3.10.

Common issues

Downstream node can't find a shape key by name. The most likely cause is a typo or mismatched name between what you typed into shape_keys here and what a later posing node references - since it's a free-text comma list, there's no autocomplete or validation to catch a misspelling.

Left the placeholder text in by accident. The default key1,key2 is exactly that - a placeholder, not a sensible pair of keys for a real rig. Easy to miss if you're moving fast through a graph.

Nodes not loading in ComfyUI. 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. Needs --enable-cors-header at launch to reach the embedded editor.avatech.ai panel. Without it, export via right-click → Save File on Avatar Main Output instead of relying on the live view.

Categoryblender

Inputs (3)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
shape_keysoptSTRINGkey1,key2
from_mixoptBOOLEANfalse

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ