Nodes/ComfyUI-MultiModel3D/πŸ”€ Merge GLB
ComfyUI Node

πŸ”€ Merge GLB

Merge GLBs without losing the parts

By xuxiao305Β·Created 5 months agoΒ·Updated 5 months agoΒ· 0
πŸ”€ Merge GLB
  • glb_1
  • glb_2
  • glb_3
  • glb_4
  • glb_5
  • glb_6
  • glb_7
  • glb_8
  • merged_glb
β—„prefix_modeindexβ–Ί
β—„offset0.0β–Ί

Most of ComfyUI's 3D nodes hand you back exactly one GLB per run - one character, one prop, one piece of furniture. The moment you want a scene instead of a single object, you're stuck assembling it by hand. MergeGLB (πŸ”€ Merge GLB) is the fix: it takes up to eight GLB files, merges them into one, and - this is the part that matters - keeps every sub-model addressable by renaming each part with a prefix (0_, 1_…). That identity is exactly what the pack's MultiModelViewer uses later to toggle, focus, and explode individual parts.

So the typical graph looks like: Load3D (or an image-to-3D node's output) β†’ several GLBs β†’ MergeGLB β†’ MultiModelViewer. Without the prefixing you'd get a single fused blob with no way to grab one part of it.

How it works. It's a trimesh Scene.add_geometry() job. Each input is loaded with force="scene" and process=False - deliberately no processing, so PBR materials and the original node transforms survive the merge. Every geometry node in each sub-scene gets added to a fresh scene with the prefix glued onto its name, then the whole thing is exported as a new GLB. Two details worth knowing: the merged file is written to ComfyUI's output folder as merged_<8hex>.glb (those accumulate on disk - clear output now and then), and the node returns a File3D object, falling back to a plain path string on older setups.

The inputs that matter:

  • glb_1 … glb_8 - all optional FILE_3D slots. Wire in whatever you have, from Load3D or any node that outputs FILE_3D/FILE_3D_GLB; leave the rest empty.
  • prefix_mode - index gives 0_, 1_…; filename gives the source file's stem plus an underscore (body_, arm_). If you plan to control parts in MultiModelViewer afterwards, use index - the viewer's grouping logic keys off numeric prefixes, and filename mode collapses every part into one group.
  • offset - X-axis spacing between sub-models; each input i is shifted by i Γ— offset. Leave it at 0 and each model keeps its original position.

The single output, merged_glb, feeds the viewer or anything else that accepts a FILE_3D.

Install. Same as the rest of this pack - ComfyUI Manager (search "ComfyUI-MultiModel3D") or a manual clone:

cd ComfyUI/custom_nodes
git clone https://github.com/xuxiao305/ComfyUI-MultiModel3D
pip install -r requirements.txt

Dependencies are just trimesh and numpy, so this is one of the lighter installs you'll do. One note: the README's own clone command points at a stale URL (ComfyuiDevelopement.git) that isn't this repo. Clone the real one or use Manager, and make sure the folder ends up named ComfyUI-MultiModel3D.

Troubleshooting. The most common miss is feeding it nothing - it raises "At least one GLB input is required" if every slot is empty, so wire at least one. A file that doesn't exist at the resolved path gets skipped with a warning rather than failing the run, so double-check a merged result that seems short a model. This is a young, low-traffic pack (basically zero community chatter about it as of writing), so treat genuinely odd behavior as "report it on GitHub" territory rather than something with a known fix.

Category3d/MultiModel3D

Inputs (10)

NameTypeDefaultDescription
prefix_modeCOMBOindex2 options: index, filename
offsetFLOAT0.00–100X-axis spacing between sub-models. 0 = keep original positions.
glb_1optFILE_3D,FILE_3D_GLBβ€”
glb_2optFILE_3D,FILE_3D_GLBβ€”
glb_3optFILE_3D,FILE_3D_GLBβ€”
glb_4optFILE_3D,FILE_3D_GLBβ€”
glb_5optFILE_3D,FILE_3D_GLBβ€”
glb_6optFILE_3D,FILE_3D_GLBβ€”
glb_7optFILE_3D,FILE_3D_GLBβ€”
glb_8optFILE_3D,FILE_3D_GLBβ€”

Outputs (1)

NameTypeDescription
merged_glbFILE_3D,FILE_3D_GLBβ€”