Image List to Batch
Flatten a list of images back into one batch
- image_list
- image_batch
Somewhere between "one image" and "a batch" there's "a list of images," and not every node speaks it. Image List to Batch is the conversion that gets a Python-style image list back into a single IMAGE batch tensor - the shape every sampler and processor actually wants.
It's the mirror image of the pack's Image Batch to List: that node takes a batch and splits it into individual images you can process one at a time; this one takes those individual images and stacks them back together. If your workflow processes images in a loop or a per-item chain and then needs to hand the whole set to a batch consumer, this is the closing bracket.
How it works
It accepts the list, normalizes sizes by padding each image to the tallest and widest in the set (zero-padded, bottom-right), and concatenates them along the batch axis. The padding matters: unlike a multi-image batch node that unifies sizes with a fit strategy, this one assumes it should make things uniform by padding - there's no crop or stretch option, because the point is to preserve every pixel. If you feed it a single image, it passes it through untouched (still wrapped as a batch).
The input and output
- image_list - the list of IMAGE tensors to merge.
- Output: image_batch - a single IMAGE tensor.
One thing worth knowing: the zero-padding is silent. If your images have very different aspect ratios, the results carry invisible black bars, which then show up as black regions in anything that composites or displays them without accounting for the padding. For lists of same-sized images (the common case), this never matters.
When you'd reach for it
Batch-to-list is a natural fit for loops: extract a batch from a video, split it, run a per-frame pass that only works on single images, then reassemble. This node is the reassemble step. It's also the cleanup step for any custom node that returns IMAGE in list form, which happens more than you'd think. Pair it with Image Batch Range or Image Batch Index if you want to reorder or thin the frames before they go back into a batch consumer.
Installing it
ComfyUI Manager, search "ComfyUI 1hewNodes", install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/1hew/ComfyUI-1hewNodes
Pack-wide note: the repo's requirements.txt is heavy (opencv, rembg, ultralytics, transformers...) thanks to the detection nodes sharing the repo; this conversion node itself is pure tensor work.
Gotchas
The silent zero-pad is the main gotcha - mismatched sizes mean black bars, and nothing tells you. If your downstream node hates that, unify sizes upstream (a resize or a fit-based batch node) before you stack. Also, the padding targets the max height and width of the list, so the result can be larger than any individual source image. And as with most of the pack's conversion nodes, empty or malformed input degrades to a zero-size batch rather than an error - fine in production, mildly confusing when you're debugging a blank output.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image_list | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image_batch | IMAGE | — |