Nodes/blender-in-comfyui/Blender Scene Composer
ComfyUI Node

Blender Scene Composer

The node where your MODELS list finally becomes a real .blend file

By JayLyu·Created about a year ago·Updated about a year ago· 5
Blender Scene Composer
  • models
  • blend_path
  • log
use_full_pathtrue
output_folderblender
output_filenamescene
blend_path

This is the node that earns the pack its name. Everything upstream - BL_Model_Param, BL_Camera_Creator, BL_Model_Merger - just builds dictionaries on the MODELS wire. Scene Composer is where those descriptions become an actual Blender scene: it launches a headless Blender, imports your GLB/FBX/OBJ files, creates the cameras, arranges everything with your transforms, and saves a .blend file you can render, edit, or re-open later.

How it works

The composer is a subprocess orchestration. It writes your models list to a JSON params file, writes a Blender Python script next to it, then runs Blender in --background --factory-startup mode with that script. Inside Blender, each model file is imported with its own import operator (glTF, FBX, or OBJ depending on extension), and every imported model is parented under a fresh Empty container named <model>_container. Your position/rotation/scale get applied to that container - which is the clean way to transform a multi-part imported asset without mangling its internal hierarchy. Cameras become real bpy camera objects with your focal length set as the lens, and everything lands in the collection you named.

Two details worth knowing. First, it saves the scene with the Cycles engine configured and GPU enabled if Blender can find a CUDA/OptiX/OpenCL device - the render node defaults to Eevee, so your previews will look different from a Cycles render, and that's expected. Second, the optional blend_path input: give it an existing .blend and the composer copies it first, then appends your models to it, instead of starting from an empty scene. That's how you build on an existing Blender project.

The inputs that matter

  • models - the MODELS list from a merger (or a single model/camera). Required.
  • output_folder / output_filename - default to blender / scene, so you get ComfyUI/output/blender/scene.blend. Change these to avoid clobbering previous runs.
  • use_full_path - true returns the absolute path from the blend_path output, false returns the ComfyUI-relative blender/scene.blend. If you're wiring straight into BL_Render or BL_Export_Model, either works since they resolve both.
  • blend_path - optional; the source .blend to copy and append to, as above.

Outputs

blend_path (STRING) is the file you just created - wire it into BL_Render to turn it into an image. log (STRING) is where the good stuff lives: every import, every error, the final path. Do yourself a favor and hook it to a ShowText|pysssss node (the pack's example workflow does), because errors don't pop up as red nodes here.

Installing it

Part of the blender-in-comfyui pack:

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

ComfyUI Manager works, but the pack uses subprocess, which ComfyUI blocks unless you launch with --allow-subprocess - without it this node fails immediately. You need Blender 4.4+, which auto-downloads into the pack's blender/ folder on Windows/Linux (macOS: place it manually - there's no auto-download on Apple Silicon, the code only downloads for Windows and Linux). No pip requirements beyond ComfyUI's own.

Common issues

First run is slow - Blender downloads (~300MB+) and every compose spawns a fresh headless Blender, so expect several seconds per run. Not real-time, plan around it. "Blender call failed" usually means the subprocess is blocked (forgot --allow-subprocess) or Blender isn't in the pack's blender/ folder. "Model file not found" means an upstream BL_Model_Param points at a path that doesn't resolve - check that node's folder_type. And if a camera never appears in the render, it usually means the camera was never merged into this node's models input. Read the log output; it tells you all of this explicitly.

CategoryBlender

Inputs (5)

NameTypeDefaultDescription
modelsMODELS
use_full_pathBOOLEANtrue
output_folderSTRINGblender
output_filenameSTRINGscene
blend_pathoptSTRING

Outputs (2)

NameTypeDescription
blend_pathSTRING
logSTRING