Nodes/Avatar Graph/Object Call Shape Key Add
ComfyUI Node

Object Call Shape Key Add

Object Call Shape Key Add — ComfyUI Node from Avatar Graph

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Object Call Shape Key Add
  • BPY_OBJ
  • BPY_OBJ
nameKey
from_mixtrue

Avatar Graph, Avatech AI's pack for turning a single character portrait into a real-time interactive 2D avatar, is basically a shape-key machine dressed up as a node graph: eye blinks, mouth movement, lip sync - all of it is shape keys getting driven by their "Shape Flow" runtime at playback time. So of everything in this pack's large ObjectCall_* family - auto-generated wrappers around Blender's bpy.types.Object API, one node per method, none of them individually documented in the README's own node table - Object Call Shape Key Add is one of the handful that's actually load-bearing to what this pack does, rather than incidental plumbing.

It wraps object.shape_key_add(name, from_mix), Blender's call for adding a new shape key to a mesh. from_mix controls what the new key starts as: True (the default) bakes it as a snapshot of the current mix of all existing shape keys' values - useful for capturing a pose you've built up interactively as its own reusable key - while False gives you a fresh copy of the mesh's basis shape, an untouched starting point to sculpt a new expression from scratch. Either way, once a shape key exists, it's a target the pack's Shape Flow graph can drive with a live input value (a slider, an audio-driven lipsync signal, whatever the workflow wires up).

Inputs from the schema: BPY_OBJ (optional per the schema, but pointless without a mesh object wired in from upstream - typically something coming out of the pack's own Create Mesh Layer or Join Meshes), name, a plain STRING defaulting to "Key" - worth setting to something meaningful ("Blink_L", "MouthOpen") since that's the string you'll reference later in the Shape Flow graph or in Shape Key Remove, and from_mix, a BOOLEAN defaulting true. Both of those are genuine, ordinary ComfyUI widgets - no code-gen placeholder types here, which makes this one of the more approachable nodes in the family. Output is BPY_OBJ, the same object passed through, now carrying the new shape key, ready to chain into whatever configures it next.

Installing it means installing the whole Avatar Graph pack. Via ComfyUI Manager: search "Avatar Graph" and install. Manually: cd ComfyUI/custom_nodes && git clone https://github.com/avatechai/avatar-graph-comfyui, then cd avatar-graph-comfyui && pip install -r requirements.txt, restart ComfyUI. The requirement that actually bites: bpy needs Python 3.10.x exactly, so the README's recommendation of a dedicated conda create --name comfyui python=3.10 environment, rather than reusing whatever's running your Flux or SDXL work, is worth taking at face value. Restart with --enable-cors-header (add --force-fp16 on macOS) so the live avatar preview through Avatech's editor actually works.

Troubleshooting: bpy failing to import at ComfyUI startup because the interpreter isn't exactly 3.10.x is the wall you're most likely to actually hit, and it's a common, recurring category of pain for Blender-Python-based ComfyUI nodes generally. Naming clashes are the more node-specific gotcha - Blender silently appends a number if you add two shape keys with the same name in the same session, so if a downstream Shape Key Remove node can't find the key you expect, check for a stray .001 suffix before assuming anything else is wrong. Skipping --enable-cors-header costs you the live preview panel only; the graph and its .glb/.gltf export off Avatar Main Output keep working either way.

Categoryblender

Inputs (3)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
nameoptSTRINGKey
from_mixoptBOOLEANtrue

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ