Unbatch Images (RMBG) 🖼️
Split a batch into separate image sockets
- images
- image_1
- image_2
- image_3
- image_4
- image_5
- image_6
- image_7
- image_8
You've got a batch of images moving through your graph as one lump, and you want to send image 1 down one branch and image 2 down another - or just save each separately, or grab one specific frame out of the stack. Unbatch Images pulls the batch apart into up to eight individual outputs, each on its own socket. It's the inverse of batching, and ComfyUI oddly doesn't ship a clean way to do it, so a utility node like this fills a real gap.
Where this comes up in a background-removal pack: RMBG does batch cutouts and batch-out-for-video, so you routinely finish a stage holding a batch of processed images. A batch is great while you're doing the same thing to every image, but the moment you want to treat them differently - different save names, different downstream nodes, route one to an upscaler and another to a compositor - you need them as separate signals. That's this node.
How it works
In ComfyUI a batch is a single tensor with all the images stacked along a batch dimension; it travels as one connection. Unbatch Images takes that tensor, peels off the individual images, and exposes them on eight fixed output sockets - image_1, image_2, and so on. You wire up as many of those sockets as you have images and ignore the rest. No model, no real compute - it's just reshaping what's already in memory.
The inputs and outputs that matter
images(IMAGE, required) - the batch you want to split. One connection in, carrying however many images your batch holds.
The outputs are image_1 through image_8 - eight separate IMAGE sockets, each a single image. Connect the ones that match your batch: a batch of three fills image_1, image_2, image_3, and you leave the rest alone. Each output goes wherever you want independently - its own Save Image, its own preview, its own processing branch. That independence is the entire point; it's what a batch won't give you.
How to install it
The node ships inside ComfyUI-RMBG; install the pack.
- ComfyUI Manager: search
Comfyui-RMBG, install, restart. - Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/1038lab/ComfyUI-RMBG, then./ComfyUI/python_embeded/python -m pip install -r requirements.txt(embedded Python is the safe bet on desktop installs), and restart.
Unbatch Images itself is weightless - no models, no GPU - but the pack around it is not. RMBG bundles the whole background-removal and segmentation zoo plus a chunky dependency list, so if this splitter is genuinely all you want, know that you're installing a lot to get it. If you're already running RMBG for cutouts, it costs you nothing extra. Standard Windows caveat: crash right after the requirements install, set PYTHONUTF8=1 and try again.
Common issues
The hard limit is eight. If your batch holds more than eight images, the extras have nowhere to land - this node simply doesn't have a ninth socket, so for large batches or long video-frame sequences you'll want an index-based picker or a loop instead. The other thing to watch is that unbatching only makes sense when your images actually share dimensions, which they will if they came from one generation or one batch load; a "batch" assembled from mismatched sizes was never a real batch to begin with. Otherwise this is about as low-risk as a node gets - it moves data around, it doesn't invent any.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| image_1 | IMAGE | — |
| image_2 | IMAGE | — |
| image_3 | IMAGE | — |
| image_4 | IMAGE | — |
| image_5 | IMAGE | — |
| image_6 | IMAGE | — |
| image_7 | IMAGE | — |
| image_8 | IMAGE | — |