Nodes/ComfyUI 1hewNodes/Image List Append
ComfyUI Node

Image List Append

Merge image lists from two branches without losing order

By 1hew·Created about a year ago·Updated 7 days ago· 33
Image List Append
  • image_1
  • image_2
  • image_list

Here's a small but persistent annoyance in ComfyUI: sometimes you don't have a batch tensor, you have a list of images - and lists don't concatenate like batches do. You can't just torch.cat a Python list of images in the graph. When you've got two branches producing image lists and you want one combined list in a defined order, Image List Append is the two-port merge that does it without complaining.

It's the "append" in the classic data-structure sense: each input can be a single image or a whole list, and the outputs are concatenated into one list in order - image_1's items first, then image_2's.

How it works

  • image_1, image_2 - each accepts either a single image or a list of images. None inputs are skipped.
  • image_list - the output: a Python-style list of images, ordered by input suffix.

The ordering rule is the whole game: inputs are sorted by numeric suffix before merging, so image_1 always precedes image_2, regardless of which one is connected first. Lists pass through without copying frames - cheap concatenation, not a re-encode.

Install

Part of ComfyUI-1hewNodes:

cd ComfyUI/custom_nodes
git clone https://github.com/1hew/ComfyUI-1hewNodes

Restart ComfyUI. No models, no downloads.

Where it fits

The common setup: Image Batch to List (or another extractor) splits a batch into per-image list items on two different branches - say, one branch crops, another doesn't - and you need to merge them back into a single ordered list before handing off. Downstream, the pack's Image List to Batch converts the combined list back into a batch tensor for normal batch processing. Together those three form the "split into lists, process independently, recombine" pattern.

Common issues

  • Output won't connect to a batch node - this outputs a list, not a batch. Batch ports reject it; run it through Image List to Batch first.
  • Order looks wrong - double-check the suffix numbering. It's image_1 then image_2, deterministic, no reordering beyond the suffix.
  • Item count is off - a single image input is wrapped into a one-item list, so a lone image plus a 30-image list gives you 31 items. That's the intended behavior, but it surprises people counting frames.

Honest take: it's a two-port utility node with one job, and it's the kind of thing you appreciate only when you've hit the "cannot concatenate list and tensor" wall a couple of times. Boring, correct, done.

Category1hewNodes/batch

Inputs (2)

NameTypeDefaultDescription
image_1optIMAGE
image_2optIMAGE

Outputs (1)

NameTypeDescription
image_listIMAGE