π Merge GLB
Merge GLBs without losing the parts
- glb_1
- glb_2
- glb_3
- glb_4
- glb_5
- glb_6
- glb_7
- glb_8
- merged_glb
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-indexgives0_,1_β¦;filenamegives 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 inputiis shifted byi Γ 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.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| prefix_mode | COMBO | index | 2 options: index, filename |
| offset | FLOAT | 0.00β100 | X-axis spacing between sub-models. 0 = keep original positions. |
| glb_1opt | FILE_3D,FILE_3D_GLB | β | |
| glb_2opt | FILE_3D,FILE_3D_GLB | β | |
| glb_3opt | FILE_3D,FILE_3D_GLB | β | |
| glb_4opt | FILE_3D,FILE_3D_GLB | β | |
| glb_5opt | FILE_3D,FILE_3D_GLB | β | |
| glb_6opt | FILE_3D,FILE_3D_GLB | β | |
| glb_7opt | FILE_3D,FILE_3D_GLB | β | |
| glb_8opt | FILE_3D,FILE_3D_GLB | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| merged_glb | FILE_3D,FILE_3D_GLB | β |