Nodes/ComfyUI-Utility-Suite/Image List To Image Batch
ComfyUI Node

Image List To Image Batch

Glue Your Per-Image Results Back Into One Batch

By tom-m-2020·Created about a month ago·Updated 7 days ago· 1
Image List To Image Batch
  • images
  • image

The tail end of a per-image workflow always looks the same. You split a batch into a list, each image got its own treatment - its own seed, its own upscaler, its own prompt - and now you want to save them, preview them, or hand them to a node that only understands one image with N in dimension 0. That is this node. It turns a Comfy list of images back into a single ordinary batch.

How it works

It validates before it concatenates, which is why it is worth having rather than reaching for a generic merge. For every item it checks: rank-4 tensor, at least one image, and identical H, W, C, dtype and device across the whole list. If those hold it concatenates along dimension 0 into one [N, H, W, C] tensor. A single-item list is returned as-is, no copy needed.

The validation is not decoration. A list of images is the one place in ComfyUI where nothing enforces a common shape - the whole point of a list is that each item is its own value - so this is the boundary where a size or dtype mismatch has to be caught, and it is caught with a message naming the offending index and both shapes.

Inputs and outputs

images in, image out. That is the entire surface. The input is a list input, so the node receives the whole container in one execution and does not get mapped over it - which is exactly right, because the job is to merge them, not to merge each one with itself.

Volumes are the honest reason to rejoin. A per-image list going through a save node writes N files with a filename pattern that has to thread a counter for each; the same list rejoined writes one batch with a counter numbering the batch. Rejoining also lets you use nodes that simply were never written to be list-aware - a compare grid, an image-to-image stats node, most of the compositing nodes in the ecosystem.

Install

Part of ComfyUI-Utility-Suite. ComfyUI Manager → search ComfyUI-Utility-Suite → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/tom-m-2020/ComfyUI-Utility-Suite

Restart ComfyUI afterwards. There is nothing to download and no model files anywhere in the repo; the pack's only declared dependency is opencv-python-headless. Because it uses the newer V3 node API (comfy_api.latest), an outdated ComfyUI shows you no nodes at all rather than an error inside the graph.

Traps

It does not resize, and this is the number one cause of a crash here. The most natural workflow in the world - split a batch, upscale each image to its own size, rejoin - produces a list of tensors that cannot be concatenated. Run your resize/scale/pad step before this node, or keep them separate and save them separately. The error message will tell you which index disagrees with the first, which is usually enough to spot the branch that scaled differently.

dtype and device are checked too. Some mask and preview nodes return CPU tensors or a different float type than the ones your sampler produced; mixing those branches into one batch fails here even though the shapes match. If you get a dtype complaint, look for the node in one branch that moved the tensor.

Order is whatever the list order was. Concatenation preserves list order and nothing else - no sorting by filename, no sorting by seed. If your output batch comes out shuffled, check the split's ordering and the merge nodes upstream, because this node never reorders anything.

Going back and forth is not free of consequences. Batch → list → batch round-trips fine dimensionally, but the second batch is a fresh concatenation, so any per-item metadata a node attached to the individual tensors is gone. Do the round trip around the work you need it for, not around the whole graph.

CategoryUtility Suite/Image/Batch

Inputs (1)

NameTypeDefaultDescription
imagesIMAGE—

Outputs (1)

NameTypeDescription
imageIMAGE—