Nodes/ComfyUI Timesaver Nodes/TS Image List to Image Batch
ComfyUI Node

TS Image List to Image Batch

The glue node that turns a list of images back into a batch

By AlexYez·Created 2 years ago·Updated a day ago· 12
TS Image List to Image Batch
  • images
  • image

Some ComfyUI nodes hand you a list of images, and some want a single batched tensor, and occasionally the two meet in the same workflow and refuse to talk to each other. TS Image List to Image Batch is the adapter for that moment: take the list, stack it into one IMAGE batch.

It's the return half of a pair - the pack also ships TS Image Batch to Image List for splitting a batch apart for per-frame iteration. Together they let you bounce between "operate on every frame at once" and "loop over frames one at a time" without hand-rolling a resizing mess.

How it works

The input is declared as a list (is_input_list=True), so whatever node upstream produces per-frame outputs just plugs straight in. In execute the node normalizes everything - single frames get an extra dimension, None entries are dropped, mismatched devices and dtypes get moved - then stacks the survivors with torch.cat.

The detail that actually matters: frames are resized to match the first image in the list (lanczos, center-cropped). A list where every entry is the same size just gets concatenated; a list where someone upscaled one frame doesn't blow up the batch - the odd one out gets conformed. Channels are trimmed to the minimum present, which is how a list with one RGBA image and a bunch of RGB ones still produces a valid batch instead of a shape error.

Inputs and outputs

One required input:

  • images - the list of images to stack. Frames are resized to match the first.

One output:

  • image - the assembled single batch, ready for any node that expects one tensor of [B, H, W, 3].

That's the whole node. It's a two-function utility and it doesn't pretend to be more.

Installation

Part of the comfyui-timesaver pack, so you install the pack, not the node. In ComfyUI Manager search "Timesaver" and install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/AlexYez/comfyui-timesaver
cd comfyui-timesaver
python -m pip install -r requirements.txt

Restart ComfyUI. Search TS in the node menu and you'll find it under TS/Image/Batch.

Where you'll actually need it

The common real-world case is a batch of prompts or reference images that some node processes frame-by-frame - a face restorer, a crop-per-frame pipeline - and then you want to feed the results into a video saver or a batch-aware upscaler that wants one tensor. Stick this node on the end and the downstream graph never has to know the frames were ever apart.

The only thing that can bite you is the implicit resize: if the list is genuinely mixed-size and the resizing is a surprise, that's the node working as designed. Feed it same-size frames and it's a pure no-op passthrough that just re-batches.

CategoryTS/Image/Batch

Inputs (1)

NameTypeDefaultDescription
imagesIMAGEList of images to stack into one batch. Frames are resized to match the first image.

Outputs (1)

NameTypeDescription
imageIMAGESingle image batch assembled from the input list.