Nodes/KJNodes for ComfyUI/Image Tensor List
ComfyUI Node Runs on cloud

Image Tensor List

Batch images that aren't the same size

By kijai·Created 3 years ago·Updated about 16 hours ago· 2,930
Image Tensor List
  • image1
  • image2
  • IMAGE

If you've ever gotten the "images must be the same size to batch" error, this tiny node is the workaround. ComfyUI has two ways to carry multiple images: a batch (one tensor with all the images stacked, which forces them to share dimensions) and a list (separate items that can each be whatever size they want). Image Tensor List makes the second kind. It bundles images into a list so you can pass differently-sized pictures downstream without the batch dimensions having to match.

It's part of KJNodes, kijai's utility pack - pure plumbing, the kind of node you only learn exists the day you hit the error it solves.

How it works

A batched tensor is efficient but rigid: everything in it has to be the same height and width. A list drops that constraint by keeping the images as distinct entries. This node takes image inputs and returns them as a list, so the next node - as long as it's written to accept a list - can iterate over images of mixed sizes instead of choking on the mismatch.

The inputs and output that matter

It takes image1 and image2 and returns a single IMAGE output that is actually a list of the two. Need more than two? Chain the node - feed the output into the image1 of another Image Tensor List and add a third, and so on - to build up a longer list. The important detail is on the receiving end: the downstream node has to be a list-aware node (one that processes inputs item by item). Wire this into something expecting a plain batched image and it won't behave the way you want.

Installing it

ComfyUI Manager → search KJNodes for ComfyUI → install → restart. Or cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-KJNodes, then pip install -r ComfyUI-KJNodes/requirements.txt, and restart. No models, no heavy dependencies - it's a data-shape node.

Where people get burned

  • Batch vs list confusion. This is the whole point of the node and also the thing that trips people up. A list is not a batch; some nodes want one, some want the other. If the "same size" error is your problem, a list is the fix; if a node then complains it got a list, that node wanted a batch and you've over-applied this.
  • Downstream has to be list-aware. The list only helps if what comes next iterates over items. Many nodes do, but not all - check that the consumer actually handles a list before blaming the node.
  • Order matters. Chaining these builds the list in the order you wire them; if sequence matters downstream, mind which image goes into image1 vs image2.
CategoryKJNodes/image

Inputs (2)

NameTypeDefaultDescription
image1IMAGE
image2IMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE