Nodes/blender-in-comfyui/Blender Export Model
ComfyUI Node

Blender Export Model

The reverse bridge that turns a .blend into a shareable GLB

By JayLyu·Created about a year ago·Updated about a year ago· 5
Blender Export Model
    • exported_path
    • log
    blend_file_path
    export_formatGLB
    use_full_pathfalse
    output_folderexported_models
    output_filenameexported_model
    export_selected_onlyfalse
    apply_transformstrue
    include_animationstrue
    include_texturestrue

    BL_Scene_Composer builds a .blend from scratch; this node goes the other way. Blender Export Model takes an existing .blend file - one you composed, or one you opened in Blender and edited - and exports it out as a GLB. That's the format game engines, web viewers, and pretty much every 3D pipeline actually want, so this is the node you reach for when a .blend needs to become a portable asset.

    How it works

    Same pattern as its siblings: the node writes a Blender Python script with your parameters baked in, then runs headless Blender with --background --factory-startup. Inside, it opens the .blend, collects the objects to export (mesh, empty, and armature objects - cameras and lights are excluded), selects them, and calls Blender's glTF exporter with a full stack of options: transforms applied, animations included (as NLA strips, sampled), textures and materials exported, tangents and morph targets on. The result is a single .glb written to your ComfyUI output folder.

    The only format choice is GLB - the export_format input has a single option, so don't go looking for an FBX toggle. It's a GLB exporter, full stop.

    The inputs that matter

    • blend_file_path - required. The node is forgiving here: it accepts an absolute path, or a path relative to ComfyUI/output/, or one relative to the current working directory, resolving in that order. So the blend_path string out of BL_Scene_Composer drops straight in.
    • output_folder / output_filename - default to exported_models / exported_model, giving ComfyUI/output/exported_models/exported_model.glb. Change the filename unless you like overwriting.
    • use_full_path - true returns the absolute path from exported_path, false returns the output_folder/filename.glb relative form. Either feeds back into the pack fine, since the other nodes resolve both.

    The optional toggles are worth a look because the defaults are sensible but opinionated: apply_transforms (default true) bakes object transforms into the export, which is what you want for game-ready assets; include_animations (default true) brings the animation data along, include_textures (default true) carries materials and textures, and export_selected_only (default false) exports everything vs. just what you'd selected. If you've been animating in Blender, leave the first three on; if the GLB comes out huge, that's the textures and morph targets doing their job.

    Two outputs: exported_path (STRING) and log (STRING) - the log includes the exported file size, so it's a quick sanity check that something real came out.

    Installing it

    Part of the blender-in-comfyui pack, installed like the rest:

    cd ComfyUI/custom_nodes
    git clone https://github.com/JayLyu/blender-in-comfyui.git
    

    ComfyUI Manager works too, but this node needs subprocess to drive Blender, which ComfyUI blocks unless you start it with --allow-subprocess. Have Blender 4.4+ in the pack's blender/ folder (auto-downloaded on Windows/Linux; place Blender.app yourself on macOS). No pip dependencies beyond ComfyUI's own.

    Common issues

    "Blend file not found" means the path didn't resolve against any of the three locations it checks - paste the absolute path if in doubt. "Blender call failed" points at the subprocess setup: the --allow-subprocess flag or a missing Blender install. And because the export script embeds your settings by string-replacing them into the script text, a weird path or filename with special characters can trip it up - keep names boring. The exported GLB comes back without lights or cameras (deliberately), so don't be surprised that a "scene" exports as just the meshes - that's standard glTF behavior, and it's what you'd want for an asset anyway.

    CategoryBlender

    Inputs (9)

    NameTypeDefaultDescription
    blend_file_pathSTRING
    export_formatCOMBOGLB1 options: GLB
    use_full_pathBOOLEANfalse
    output_folderSTRINGexported_models
    output_filenameSTRINGexported_model
    export_selected_onlyoptBOOLEANfalse
    apply_transformsoptBOOLEANtrue
    include_animationsoptBOOLEANtrue
    include_texturesoptBOOLEANtrue

    Outputs (2)

    NameTypeDescription
    exported_pathSTRING
    logSTRING