Nodes/ComfyUI_Swwan/Image Batch to Image List
ComfyUI Node

Image Batch to Image List

One tensor in, many separate images out

By aining2022·Created 9 months ago·Updated 10 days ago· 33
Image Batch to Image List
  • image
  • IMAGE

ComfyUI has two ways of carrying multiple images around: a batch (one tensor with a batch dimension, which most core nodes speak) and a list (a Python list of tensors, which many custom nodes speak). They don't mix. A node that expects a list will quietly do the wrong thing, or nothing, when handed a batch - and the reverse is just as true. Image Batch to Image List is the converter that bridges from the batch world into the list world.

It's part of the ComfyUI_Swwan pack's batch utilities, and it's the exact inverse of the pack's Image List to Image Batch node. You feed it one batched image, and it splits it into a list where each item is its own single-image tensor, keeping the batch dimension so each element is still a valid IMAGE (shape 1, H, W, C). No resizing, no copying of data that matters - it's a view-level split, so it's effectively free.

Why you'd want it

The classic scenario is feeding a batch into a per-image node that demands a list. Impact Pack's per-item detailers, some mask and seg tools, and a lot of "process this one image at a time" custom nodes take lists. If you've got a batch of 8 frames from a VAE decode or a folder loader and the next node errors with "expected list," this is the bridge.

There's a second, sneakier use: lists make order explicit. Once you have a list, nodes like the pack's list_Slice or list_Merge can slice, reorder and re-merge it - operations that are awkward or impossible directly on a batch. Convert to list, do your surgery, and convert back with Image List to Image Batch when you're done.

Inputs and outputs

One input, image (IMAGE). One output, also typed IMAGE - but marked as a list, so any compatible socket downstream will accept it as a Python list of images. The is-list flag on the output is the whole point; that's what tells ComfyUI to treat it as a list rather than a batch.

Installing it

It ships in ComfyUI_Swwan:

cd ComfyUI/custom_nodes
git clone https://github.com/aining2022/ComfyUI_Swwan
pip install -r ComfyUI_Swwan/requirements.txt

Or install via ComfyUI Manager, search "ComfyUI_Swwan".

Where people get burned

The subtle failure is the reverse direction - feeding a list into this node's batch input. It expects a batched tensor, so if you've already got a list, you've got the wrong shape and should use the list-to-batch sibling instead. And remember the output items keep their singleton batch dimension: if your downstream list consumer wants H, W, C (no batch dim), you'll need to squeeze somewhere in the chain. Most list-aware nodes handle it, but a few don't, and that's a "why is my shape wrong" mystery that this node won't fix for you.

CategorySwwan/image

Inputs (1)

NameTypeDefaultDescription
imageIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE