Images From Batch
Unpack a Batch Into Individual Image Wires
- images
- img0
- img1
- img2
- img3
- img4
- img5
- img6
- img7
- img8
- img9
- img10
- img11
- img12
- img13
- img14
- img15
- img16
- img17
- img18
- img19
- img20
- img21
- img22
- img23
- img24
- img25
- img26
- img27
- img28
- img29
- img30
- img31
ComfyUI loves batches - a whole set of images travels as one IMAGE tensor. But sometimes you want this image and that image on separate wires, so each can go down a different path: image 0 gets the heavy upscale, image 3 gets cropped, image 7 gets saved with metadata. Images From Batch is the unpacking node for that: it takes an IMAGE batch and gives you up to 32 individual IMAGE outputs, img0 through img31.
How it works
Two inputs, a lot of outputs:
images- the batch tensor.img_count- how many of those 32 outputs you actually care about, default 4, capped at 32.
Outputs: img0 through img31, each a single-image IMAGE. The name is a little misleading - it doesn't matter how many images are in the incoming batch; what matters is img_count and which positions are populated.
The fill logic is worth understanding because it's where the surprises hide:
- For each index below both
img_countand the batch size, you get the real image at that position. - For every remaining index (including all 32 minus
img_count), the node returns a copy of the last image in the batch as a fallback.
So the outputs are never empty and never None - but img5 through img31 will silently be duplicates of your last image if you left img_count at 4. If you're iterating over every output wire and processing them all, you'll be processing the same fallback image repeatedly. This node assumes you're going to grab the outputs you set img_count for and leave the rest, which is the intended pattern but not a documented one.
Where you'd actually use it
- Per-image routing: unpack a 4-image batch from a grid or a comparison run and send each image down a different processing path.
- Face/object workflow prep: unpack detected-crop batches for individual attention passes.
- Display: get individual images to separate preview/save nodes.
Installing it
Part of ComfyUI-TinyBee under 🐝TinyBee/Images:
- ComfyUI Manager → Install Custom Nodes → search "ComfyUI-TinyBee" → Install, then restart ComfyUI.
cd ComfyUI/custom_nodes
git clone https://github.com/TinyBeeman/ComfyUI-TinyBee
Restart. No models; the only dependency is torch tensor slicing, which ComfyUI ships. (The pack's requirements.txt lists pillow and jsonata; neither is used here.)
Gotchas
The fallback-copy behavior is the entire game. If you set img_count lower than the number of outputs you later wire up, you'll silently process duplicate images - there's no warning. Set img_count to match exactly how many outputs you consume. Also, the node clamps img_count to at least 1, so you can't use 0 as "give me nothing." And since all 32 outputs always exist, a downstream node that iterates every wire without checking will touch 32 images whether your batch had 2 or 20. Pair with Grid Divider (same pack) when you're unpacking grid cells - that gives you the batch and the cell dimensions together.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| img_count | INT | 40–32 | — |
Outputs (32)
| Name | Type | Description |
|---|---|---|
| img0 | IMAGE | — |
| img1 | IMAGE | — |
| img2 | IMAGE | — |
| img3 | IMAGE | — |
| img4 | IMAGE | — |
| img5 | IMAGE | — |
| img6 | IMAGE | — |
| img7 | IMAGE | — |
| img8 | IMAGE | — |
| img9 | IMAGE | — |
| img10 | IMAGE | — |
| img11 | IMAGE | — |
| img12 | IMAGE | — |
| img13 | IMAGE | — |
| img14 | IMAGE | — |
| img15 | IMAGE | — |
| img16 | IMAGE | — |
| img17 | IMAGE | — |
| img18 | IMAGE | — |
| img19 | IMAGE | — |
| img20 | IMAGE | — |
| img21 | IMAGE | — |
| img22 | IMAGE | — |
| img23 | IMAGE | — |
| img24 | IMAGE | — |
| img25 | IMAGE | — |
| img26 | IMAGE | — |
| img27 | IMAGE | — |
| img28 | IMAGE | — |
| img29 | IMAGE | — |
| img30 | IMAGE | — |
| img31 | IMAGE | — |