Nodes/Image Filter/Batch from Image List
ComfyUI Node

Batch from Image List

Glue a Pile of Single Images Back Into One Batch

By chrisgoringe·Created 2 years ago·Updated 2 months ago· 132
Batch from Image List
  • images
  • image

ComfyUI has two ways of holding several images, and they are not interchangeable. A batch is a single tensor with the images stacked - one wire, fast, what most sampler and VAE nodes want. A list is multiple separate image tensors - what a lot of iteration and selection nodes produce. Batch from Image List is the adapter that pushes a list back into a batch, with one images input, one image output, and zero ceremony.

Its real reason to exist in this pack is the human-in-the-loop loop. If you generate images from a list of prompts, many setups hand you back a list of individual images. The pack's own Image Filter wants a batch to display and select from - so you feed it Batch from Image List to bundle everything back up, pick your winners in the popup, and carry on with one clean batched tensor. It's the "merge" half of the pack's list/batch pairing; the Image List From Batch node is the "split" half.

How it works

One input, one output. Feed it a list of images and it stacks them along the batch dimension (torch.cat over the list) into a single batched tensor. A list of five 1024×1024 images becomes one tensor with shape [5, 1024, 1024, 3]. Hand that to a Save Image or straight to the Image Filter node and everything downstream sees one batch, which is exactly what those nodes expect.

A single-image list is handled gracefully - it passes through as a batch of one rather than erroring. There's nothing else to configure, which is the whole charm.

Installing it

Part of chrisgoringe/cg-image-filter. ComfyUI Manager, search "cg-image-filter" or "Image Filter":

cd ComfyUI/custom_nodes
git clone https://github.com/chrisgoringe/cg-image-filter

Restart ComfyUI. No pip dependencies, no models.

Gotchas

The one thing to keep straight is the direction. Images that come off a batch are already batched - they don't need this node, they need Image List From Batch to become a list. Use this one when your images arrive as separate list entries and you need them stacked for a batch-hungry node like Image Filter or a video frame concat. Mixing the two up is the classic mistake, and it produces confusing type errors rather than obvious ones.

Categoryimage_filter/helpers

Inputs (1)

NameTypeDefaultDescription
imagesIMAGE

Outputs (1)

NameTypeDescription
imageIMAGE