Nodes/Avatar Graph/Create Shape Flow
ComfyUI Node

Create Shape Flow

The node that carries your avatar's runtime behavior

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Create Shape Flow
    • SHAPE_FLOW
    shape_flow{"nodes": []}

    This node is the bridge between two graphs. Avatar Graph, avatech.ai's pack for rigging character illustrations into interactive avatars inside ComfyUI, actually contains two separate systems: the ComfyUI node graph that builds your avatar's mesh and shape keys once, and a second, entirely separate runtime graph - Shape Flow - that decides how those shape keys respond to live input after export. CreateShapeFlow is what carries that second graph's definition into the rest of the pack.

    What Shape Flow actually is

    Shape keys give you named, blendable deformations - a blink, a mouth shape - but something still has to decide when and how much each one activates once your avatar is live: a microphone's amplitude driving a mouth shape for lipsync, a periodic timer triggering a blink, a viseme signal switching between mouth poses. That mapping logic is Shape Flow, and it's built visually in avatech's own embedded editor - a second node-graph interface, separate from ComfyUI's, that opens inside the pack's Avatar View panel. This ComfyUI-side node doesn't build that logic itself; it holds the serialized result and hands it forward so it gets baked into your final export.

    Inputs and outputs

    One required field: shape_flow, a string defaulting to '{"nodes": []}' - literally an empty Shape Flow graph. In normal use you don't hand-author this JSON; you build the actual behavior graph visually in avatech's editor, and this field carries that graph's serialized state. The default matters mainly as a reminder: leave it untouched and your avatar exports with the mesh and shape keys you built, but with no live behavior wired up at all - every shape key sits static until something drives it, which likely means nothing animates.

    The output is a single SHAPE_FLOW socket, which feeds directly into AvatarMainOutput's own SHAPE_FLOW input - the final export node the README describes as "the primary output of the .ava file." Skip wiring this in, and your .ava export has geometry and shape keys but no runtime logic driving them.

    Installing it

    ComfyUI Manager: search avatar-graph-comfyui. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/avatechai/avatar-graph-comfyui
    cd avatar-graph-comfyui && python -m pip install -r requirements.txt
    

    The pack overall depends on bpy for its mesh tooling, and bpy only installs against Python 3.10.x - that's the constraint governing the whole install, this node included, even though CreateShapeFlow itself doesn't touch Blender directly. Use a dedicated conda environment on Mac/Linux, or the README's prebuilt Python 3.10 ComfyUI zip on Windows. Restart with --enable-cors-header afterward - this one matters specifically for this node's workflow, since it's what lets ComfyUI and avatech's Shape Flow editor exchange the graph data this node needs in the first place.

    Troubleshooting

    If your exported avatar looks correct but doesn't do anything once loaded - no blink, no lipsync response - check whether shape_flow actually got populated with real graph data or is still sitting at its empty default. That happens most often when --enable-cors-header wasn't set at launch, which blocks the communication between ComfyUI and the Shape Flow editor the README describes; without it, whatever you build in the editor panel never makes it back into this field. Beyond that, the README itself is candid that this whole area of the pack was still actively changing as of its last real update in 2023 - don't expect deep documentation beyond what's shown in the "Shape Flow" section of the README, and lean on the pack's Discord for anything this specific.

    Categorymesh

    Inputs (1)

    NameTypeDefaultDescription
    shape_flowSTRING{"nodes": []}

    Outputs (1)

    NameTypeDescription
    SHAPE_FLOWSHAPE_FLOW