Nodes/Avatar Graph/ExportGLTF
ComfyUI Node

ExportGLTF

The terminal node that actually writes your avatar to disk

By avatechai·Created 3 years ago·Updated 2 years ago· 264
ExportGLTF
  • bpy_objects
  • blendshapes
    filenameout
    model_type
    write_mode

    Every Avatar Graph workflow that produces something you can actually open in Blender, a game engine, or a browser-based viewer ends at this node. Everything upstream - segmenting a face, building flat mesh layers with bpy (Blender's Python API running headless inside ComfyUI), rigging shape keys, wiring them into the Shape Flow runtime - is scene-building. ExportGLTF is the one that calls Blender's own export_scene.gltf operator and writes a real file to your ComfyUI output folder. It's marked as an output node, meaning it terminates a branch of the graph rather than passing anything further along.

    The inputs that matter

    • bpy_objects (BPY_OBJS, required) - the object or objects to export. This has to be a group type, not a single object; if you only have one mesh, you'll need something upstream (like Group Ops) to wrap it into a BPY_OBJS list first.
    • filename (STRING, default "out") - no extension, the node appends one for you based on model_type.
    • model_type (enum: GLB / GLTF_EMBEDDED) - GLB is the compact single binary file, the one you want for most downstream use (game engines, most viewers). GLTF_EMBEDDED is a single .gltf JSON file with the binary data base64-encoded inline - still one file, just text-based and larger; useful if you need to inspect or hand-edit the JSON.
    • write_mode (enum: Overwrite / Increment) - this one actually matters for your workflow: Overwrite replaces filename.ext on every run, Increment appends a counter (filename_0.ext, filename_1.ext, …) so repeated runs pile up instead of clobbering each other. If you're iterating on shape keys and want to compare exports side by side, switch to Increment - Overwrite will quietly erase your last attempt.
    • blendshapes (optional, type blendshapes) - wire in ExportBlendshapes' output here if you need the exported morph targets to line up with names your Shape Flow graph references at runtime. Skip it and you just get the raw geometry.

    There's no meaningful output socket to wire elsewhere - this is where the graph ends. The file lands in ComfyUI's standard output directory under the name you gave it.

    How to install it

    Via ComfyUI Manager: search "Avatar Graph," install, restart. Manually:

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

    The hard requirement: bpy==3.6.0 in requirements.txt only builds on Python 3.10.x. Nothing else works. Windows users get Avatech's own bundled Python 3.10 ComfyUI zip in the README; Mac/Linux users should build a dedicated conda env (conda create --name comfyui python=3.10) rather than trying to shoehorn it into an existing 3.11/3.12 install. The requirements file also pulls segment-anything, mediapipe, and opencv-contrib-python - a heavier, slower install than most custom node packs.

    Common issues & troubleshooting

    "Operator bpy.ops.export_scene.gltf poll() failed" or similar. Under the hood this is Blender doing the export, and Blender's own export operator needs a valid, selected mesh object - if bpy_objects is empty or contains something that isn't actually mesh geometry (a leftover empty, a broken object from an earlier step), the export will fail with a Blender-flavored error rather than a ComfyUI one.

    Can't find the exported file. It's written under ComfyUI's output/ directory, named <filename>.<ext> (or <filename>_N.<ext> under Increment mode) - not wherever your workflow's other outputs land if you've customized paths elsewhere.

    Nothing happens visually. ExportGLTF writes a file; it doesn't render a live preview by itself. The live avatar preview in Avatech's own web viewer (editor.avatech.ai) is a separate integration that needs ComfyUI started with --enable-cors-header - without that flag you still get a working glTF/GLB file, you just don't get the in-browser live view.

    Categorymesh

    Inputs (5)

    NameTypeDefaultDescription
    bpy_objectsBPY_OBJS
    filenameSTRINGout
    model_typeCOMBO2 options: GLB, GLTF_EMBEDDED
    write_modeCOMBO2 options: Overwrite, Increment
    blendshapesoptblendshapes

    Outputs (0)

    No outputs