ComfyUI Node

Image List to Slots

Sixteen sockets for a stack of images, because encoders want slots, not lists

By henjicc·Created 23 days ago·Updated 21 days ago· 1
Image List to Slots
  • images
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_6
  • image_7
  • image_8
  • image_9
  • image_10
  • image_11
  • image_12
  • image_13
  • image_14
  • image_15
  • image_16

This is the smallest node in the pack and it solves the most annoying structural problem in ComfyUI: the difference between a list of images and a batch of images, and the fact that model encoders don't accept either the way you'd hope.

Multi-reference editors like the Qwen-Image-Edit line don't take "three reference images" as one input. They take image1, image2, image3 as separate conditioning inputs, because the model's context concatenates them in a fixed order and something has to decide which picture is which. Meanwhile the pack's reference processor hands you an IMAGE list - one image per node execution, order preserved. HenjiccImageListToSlots (Image List to Slots, Henjicc/Image) is the adapter between those two worlds. One input, sixteen outputs, image_1 through image_16.

How it works

The node declares is_input_list=True, so ComfyUI passes it the whole incoming list in a single call rather than re-executing it per image. It then walks that list and flattens it: each incoming tensor must be 4D with a batch axis, RGB or RGBA, floating point. A batch of four frames inside one entry becomes four slots. Everything lands in image_1, image_2, … in order, and unused slots come back as None.

Which is exactly what you want, because an unconnected slot on the downstream encoder is optional and reads as nothing - the plumbing convention the whole ComfyUI ecosystem leans on. Wire three images and leave thirteen sockets bare; the encoder sees three references and doesn't complain.

The one hard limit is sixteen. The seventeenth image raises "This slot allocator supports at most 16 images" rather than silently dropping the rest. Worth knowing that the pack's own constraint is tighter downstream: its Qwen reference path accepts ten, and H3's reference path nine images.

When you need it, and when you don't

You need it when the encoder has discrete picture inputs and you have a variable-length stack. You don't need it for single-image workflows - a plain LoadImage wired straight in is fewer nodes and fewer things to misconfigure.

The reason it matters more than it looks: list and batch have different execution semantics. A list runs the downstream node once per image; a batch runs it once with all the images inside. Accidentally batch a set of references through a node that expects them separate and you get N separate generations from N separate references instead of one generation from N references - the classic "why did I get ten outputs" moment. This node is how you avoid that when the source is a list.

Also useful: because the outputs are individual IMAGE sockets, you can splice other sources in. Slot 1 from your reference stack, slot 2 from a LoadImage, slot 3 from an upscaler. Nothing in the node cares about provenance.

Install

Comes with the rest of the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/henjicc/ComfyUI-Henjicc.git ComfyUI-Henjicc
python -m pip install aiohttp av numpy Pillow

Restart and hard-refresh the page, or search comfyui-henjicc in Manager. This particular node does no model loading and no disk I/O, so it works the moment the pack imports - which also makes it a decent canary: if Image List to Slots shows up in the node browser, your install is healthy and any later failure is about models rather than the pack.

Common issues

"Image list contains an invalid image." Something upstream handed it a MASK, a 3-channel tensor shaped wrong, or a numpy array. Usually a mis-wired socket, occasionally a node that returns [image] where it should return an image.

Everything after the first image is None. The input got a single image, not a list. If your source node's output shows as a plain IMAGE socket rather than a list, the allocator only ever had one thing to distribute.

Ten references, only ten slots used, the eleventh missing. That's the downstream model's limit, not this node's - Qwen's convention is ten references per call. Check the encoder before blaming the allocator.

CategoryHenjicc/Image

Inputs (1)

NameTypeDefaultDescription
imagesIMAGE—

Outputs (16)

NameTypeDescription
image_1IMAGE—
image_2IMAGE—
image_3IMAGE—
image_4IMAGE—
image_5IMAGE—
image_6IMAGE—
image_7IMAGE—
image_8IMAGE—
image_9IMAGE—
image_10IMAGE—
image_11IMAGE—
image_12IMAGE—
image_13IMAGE—
image_14IMAGE—
image_15IMAGE—
image_16IMAGE—