Nodes/Custom Node Kit/图像列表分路输出 (Image List Split)
ComfyUI Node

图像列表分路输出 (Image List Split)

One wire in, up to sixteen out — and the empty lanes act like unplugged cables

By user2318·Created 6 months ago·Updated 9 days ago· 58
图像列表分路输出 (Image List Split)
  • 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
◄output_count2►
◄start_index0►

Why you'd want lanes instead of a batch

Most of ComfyUI treats images as a batch: [B, H, W, C], all frames identical in size, and you index into it numerically. Fine until you want this specific image down this specific path - first ref into the main-reference slot, the rest into a multi-ref encoder, one lane per ControlNet. Batch nodes can't do that cleanly, because they assume uniform sizes.

ImageListSplitOutputs takes an image list - elements of any shape, each its own tensor - and fans it into named lanes. The item at start_index goes to output #1, the next to #2, and so on. Each lane carries one single image, not a batch, and its downstream node runs exactly once.

How the lanes work (and why the empty ones matter)

The backend always declares sixteen output types. That's not cosmetic: ComfyUI validates a queued prompt against the declared outputs, so all sixteen must exist at type level. What you see is managed by the pack's front-end JavaScript, which adds and removes sockets live as you change output_count, disconnecting first so you don't leave dangling links.

Any lane with nothing to give returns None, and here's the good bit: None is fully equivalent to that lane being unplugged. If the downstream input is optional, Python's default kicks in and the node runs normally, treating the lane as absent - the pack's own ImageBatchConcat passes its other input through, BatchImageReplace and MaskCompositeRef just ignore it. Nothing else in that node fails. That's deliberate: the author's notes explicitly reject ExecutionBlocker(None) here, because that would mute the entire downstream node and silently take its other inputs down with it, with no on-canvas hint. Empty lane should mean "no cable", and it does.

Inputs and outputs

  • output_count - 1 to 16, default 2. Drives the on-canvas socket count. Values outside the range get clamped.
  • start_index - 0-based list position to start splitting from. Set it to 1 to skip a leading image.
  • images (optional) - the list to split. A plain same-size batch also works and is split into single frames automatically.
  • Outputs image_1 … image_16, each a single IMAGE. Only the lanes within output_count carry anything, and only as far as the list actually reaches.

Two consequences worth internalising. If your list runs out before the lanes do, the extra lanes are empty - no warning unless start_index is past the end entirely, in which case you get a console warning and sixteen empty lanes. And if the input is unconnected, the node doesn't error: it just outputs nothing anywhere.

Wiring it up without getting burned

The one failure that confuses people: an empty lane plugged into a required input. The downstream node fails at execution with a None-related error. Semantically that's identical to leaving the socket unwired - ComfyUI says "Required input is missing" at queue time in one case and throws a NoneType error at run time in the other. Different message, same meaning, and the error lands on the downstream node, so it looks unrelated to anything you did here.

Second: lanes are single images. Feeding one into a node that wants a whole batch is a different node's problem; ImageListToBatch in this pack folds a mixed-size list back into a padded, uniform batch.

Installing it

Manager → search ComfyUI-CustomNodeKit → install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/user2318/ComfyUI-CustomNodeKit.git
cd ComfyUI-CustomNodeKit
pip install -r requirements.txt

Then restart. This node needs nothing beyond torch and numpy, but the pack's install.py runs on startup and will pip-install groundingdino-py and transformers - dependencies for its pose/detection nodes - the first time you launch with it present. That can take a few minutes, and it isn't fatal if it fails; it drops a manual command in the console instead.

One more caveat: because the socket count is driven by front-end JavaScript, that's the part most likely to break when the ComfyUI UI moves under the pack. If your lane count stops tracking the output_count widget, or the node sits permanently sixteen sockets wide, hard-refresh (Ctrl+F5) and restart before assuming the node is dead - frontend rewrites have broken third-party node UI before, and this is the class of feature they hit.

Verdict

A genuinely useful plumbing node if you do multi-reference work - SCAIL-2, WanAnimate, anything with a fistful of angle refs exported at whatever resolution you had that day. It won't render a pixel, but it makes "the first image goes here, the rest go there, and stop resizing everything" a two-node problem instead of a scripting one.

Categoryimage

Inputs (3)

NameTypeDefaultDescription
output_countINT21–16输出路数(1~16)。节点界面上的输出口会随该值即时增减。从 start_index 到列表结尾不足该数量时,多出来的路不输出内容。Number of output channels (1-16). The node's output slots are added/removed live with this value. Channels beyond the remaining items are empty.
start_indexINT00–4294967295从列表第几个元素开始输出(0 = 第 1 个,1 = 第 2 个,以此类推)。List index to start outputting from (0 = first item).
imagesoptIMAGE图像列表输入(列表语义:元素尺寸可以互不相同;未连接时不报错也不输出)。普通 IMAGE 批次(同一尺寸的多张图)也可以接,会自动拆成单张元素。Image list input (list semantics: elements may have different sizes; if not connected, nothing is output and no error is raised). A plain IMAGE batch is also accepted and will be split into single-frame items.

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—