Image List to Image Batch
The boring adapter that unsticks half your node-pair errors
- images
- IMAGE
If you've ever hit a "types don't match" error that made no sense - a node clearly outputting images, and the next node refusing to connect - you've run into ComfyUI's list-versus-batch split. Some nodes output an image list (a Python list of IMAGE tensors, each with its own batch dimension), and most nodes expect a single batched IMAGE. Image List to Image Batch is the adapter between the two, and it's the sort of node you don't appreciate until you're staring at your sixth hour of fighting a workflow.
It's the inverse of the pack's SwwanImageBatchToImageList, and the pair exists because the two styles are both everywhere. Video pipelines and per-frame processors hand you lists; samplers, upscalers, and VideoCombine want one batch. This node squashes a list of image tensors into a single batch tensor so the wire fits.
How it works
Under the hood it's a concat with guard rails. It takes a list of IMAGE tensors and does three quiet corrections on the way:
- Missing batch dimensions get added (a single 3D tensor becomes a 1-frame batch).
- Size mismatches get upscaled to match the first image, using Lanczos. This is the surprising one - if your frames are different dimensions, they get silently resized to fit, not cropped.
- Channel mismatches get truncated to the smaller channel count.
Then everything is concatenated along the batch axis into one IMAGE tensor.
Inputs and outputs
images(IMAGE) - a list of image tensors. This is what makes the node unusual: it's flagged as accepting a list, so you connect the list output of whatever node produced your frames (anImageBatchToImageList, or per-frame processors that emit lists).device(auto/cpu/gpu, defaultauto) - where to put the result.autoleaves it where it is;gpufalls back to CPU with a warning if CUDA isn't available.
Output: one IMAGE batch, ready for the next node.
A list with a single image just gets its batch dimension normalized. An empty list returns nothing, which quietly means downstream nodes won't run.
Install
It ships in ComfyUI_Swwan. ComfyUI Manager → search "ComfyUI_Swwan", or:
cd ComfyUI/custom_nodes
git clone https://github.com/aining2022/ComfyUI_Swwan
cd ComfyUI_Swwan
pip install -r requirements.txt
Restart, and you'll find Image List to Image Batch under Swwan/image.
The gotchas
The silent resize is the trap. If your list contains frames at different resolutions, this node quietly Lanczos-upscales them all to the first frame's size. In most video work that's a sign something upstream is already inconsistent, so don't let the node paper over it - check why your frames differ before you bake the fix in.
Second, remember this takes a list, so it connects to a node's list output, not its batch output. Wrong connection, and the input refuses to link - which, if you're here, is probably exactly the error you were trying to fix.
Third, device=gpu on a machine without CUDA prints a warning and silently uses CPU. If you're explicitly forcing GPU for speed and nothing seems faster, check that warning. auto is the sane default and lets the tensors stay where they already are, which usually means fewer copies.
And the honest framing: this node exists because the pack's own crop/restore V3 pipeline, and a fair chunk of the ecosystem, produce lists. If you're building a batch from scratch, you often don't need it at all - but the moment a workflow hands you a list, it's the ten-second fix.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| device | COMBO | 3 options: auto, cpu, gpu |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |