Nodes/ComfyUi-MpiNodes/Mpi Add Image to List
ComfyUI Node

Mpi Add Image to List

Grow an image list one frame at a time, inside the graph

By MadPonyInteractive·Created 11 months ago·Updated 6 days ago· 3
Mpi Add Image to List
  • image_list
  • image
  • updated_list

Some workflows need to build a collection of images inside the graph - accumulate frames from several passes, gather a reference set, or batch images that came from different sources. Mpi Add Image to List is the accumulator for exactly that. It takes an existing image_list and a single image, and outputs updated_list with the new image appended. Feed its own output back into its own image_list input and you've built a loop that grows a list one image at a time.

The mechanism is simple but worth a careful read, because the list semantics are doing real work. The node declares both INPUT_IS_LIST and OUTPUT_IS_LIST, and the append takes only the first image of the incoming batch - image[0] in the source. So if you feed it a tensor holding four frames, it appends just the first one, not all four. That's the expected contract for a builder loop: each call adds exactly one element. Want to add the whole batch? Run the image through per-item processing first, or append repeatedly.

Inputs: image_list (IMAGE) and image (IMAGE). Output: updated_list (IMAGE, marked as a list).

The pattern that makes this shine is the loop with feedback. You've got a node that produces one image per run - a region render, a style pass, a per-frame video step. Wire its output into image, wire the node's own updated_list back into image_list, and every run accumulates instead of overwriting. After N iterations you've got an N-image batch ready for a video encoder, a grid, a comparison node, or a batch-process pass. Combined with the pack's list-aware tooling - MpiListCount, MpiListRange, MpiBlockIfEmptyList - you can guard and slice the growing list the same way you would any other collection.

Where it sits in the wider workflow: this is plumbing in the purest sense - it doesn't touch pixels, it organizes them. The KB's node-plumbing doc calls this layer "the graph as a small program," and an in-graph accumulator is exactly that: state that persists across iterations because it's stored in the wires. It's also the natural complement to the pack's box tooling - crop a region, append it, repeat - which is a tidy way to assemble a reference gallery from one source image.

The honest caveat: it appends, it doesn't replace or insert. There's no "clear the list" widget, so if you want a fresh batch you either build it from an empty source or manage the list elsewhere. And because it's a plain IMAGE list, the updated_list output only plugs into nodes that accept image lists - which is most batch-capable nodes, but if yours doesn't, a packer (MpiPacker) can carry the bundle instead.

Install is pack-standard: ComfyUI Manager → search ComfyUi-MpiNodes → install, or clone it:

cd ComfyUI/custom_nodes
git clone https://github.com/MadPonyInteractive/ComfyUi-MpiNodes

Restart, and it's under MpiNodes/ImgOps. No requirements file, no model downloads - pure Python on top of ComfyUI, the same pack behind the Cubric Vision app.

CategoryMpiNodes/ImgOps

Inputs (2)

NameTypeDefaultDescription
image_listIMAGE
imageIMAGE

Outputs (1)

NameTypeDescription
updated_listIMAGE