Nodes/ComfyUI-TinyBee/Images From Batch
ComfyUI Node

Images From Batch

Unpack a Batch Into Individual Image Wires

By TinyBeeman·Created about a year ago·Updated about a month ago· 1
Images From Batch
  • 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
img_count4

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_count and 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:

  1. 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.

Category🐝TinyBee/Images

Inputs (2)

NameTypeDefaultDescription
imagesIMAGE
img_countINT40–32

Outputs (32)

NameTypeDescription
img0IMAGE
img1IMAGE
img2IMAGE
img3IMAGE
img4IMAGE
img5IMAGE
img6IMAGE
img7IMAGE
img8IMAGE
img9IMAGE
img10IMAGE
img11IMAGE
img12IMAGE
img13IMAGE
img14IMAGE
img15IMAGE
img16IMAGE
img17IMAGE
img18IMAGE
img19IMAGE
img20IMAGE
img21IMAGE
img22IMAGE
img23IMAGE
img24IMAGE
img25IMAGE
img26IMAGE
img27IMAGE
img28IMAGE
img29IMAGE
img30IMAGE
img31IMAGE