Nodes/ComfyUI Assistant Node/PVL Image List to Image Batch
ComfyUI Node

PVL Image List to Image Batch

Turn a pile of images into one batch (and back again)

By pvlprk·Created about a year ago·Updated 8 months ago· 1
PVL Image List to Image Batch
  • images
  • IMAGE

There are two ways an image can travel through a ComfyUI graph: as a single batched tensor (one IMAGE, with N frames stacked inside it) or as a list of separate IMAGE tensors. Most nodes you actually care about - samplers, VAEs, upscalers, detailers - want the batched tensor. But some nodes hand you a list instead. That mismatch is exactly the job of PVL Image List to Image Batch: it takes a list of images in and pushes one batched IMAGE out, so the rest of your pipeline stops complaining.

It's a one-input, one-output utility, and honestly that's most of its appeal. This pack ships the matching inverse too (PVL Image Batch to Image List), so once you learn one you've learned the pair.

How it works

The node sets INPUT_IS_LIST, which means ComfyUI passes it a Python list of tensors instead of a single tensor. Its job is then simple: concatenate them along the batch dimension with torch.cat. If you give it just one image it short-circuits and hands it straight through, no work done.

The one thing worth knowing under the hood: if your images have different dimensions, it doesn't error. It silently upscales every straggler to match the first image in the list, using lanczos. That's convenient - no "shape mismatch" crash mid-run - but it's also the trap. If you batch a 512x512 with a 768x512, that second one gets stretched to fit the first's size, and the distortion can look like a bad model. If your source images should all be the same size, normalize them upstream (see PVL Image Resize in the same pack) and this node becomes pure and boring.

Inputs and output

  • images - the list of IMAGE tensors. This is the only input. Wire it to any output that says it produces a list (a per-item masker, an "image per prompt" node, that kind of thing).
  • Output IMAGE - a single batched tensor you can feed into anything that expects one, including VAE Encode or a batch-based sampler.

Installing it

This is one node inside the pvlprk/comfyui-pvl-api-nodes pack ("ComfyUI Assistant Node"), a grab-bag that ships well over a hundred utilities and cloud-API nodes. Install the whole pack:

cd ComfyUI/custom_nodes
git clone https://github.com/pvlprk/comfyui-pvl-api-nodes

then restart ComfyUI. Or use ComfyUI Manager and search for "ComfyUI Assistant Node". No model downloads, no extra Python deps beyond what ComfyUI already has (torch, numpy). The pack's requirements.txt is fat - it also pulls OpenAI, Google, diffusers and fal client libraries for its API nodes - but this particular node needs none of them.

Common gotchas

  • Mixed sizes get silently squashed, as described above. If your batch comes out looking warped, check that all inputs share dimensions.
  • Feeding a single image is a no-op passthrough, which can mask the fact that you wired the wrong output. If nothing changes when you expect a batch, confirm your source node is actually outputting a list.
  • The README only documents the pack's original OpenAI Assistant node and is long out of date with what's actually in __init__.py - don't judge the pack by its README.
CategoryPVL/Utils/Image

Inputs (1)

NameTypeDefaultDescription
imagesIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE