Nodes/Comfyui-EzFlex-Presets/EzFlex-MergeList
ComfyUI Node

EzFlex-MergeList

Sixteen inputs, one list, and the loop's memory

By blackbossokok·Created 2 months ago·Updated 19 days ago· 5
EzFlex-MergeList
  • input_1
  • input_2
  • input_3
  • input_4
  • input_5
  • input_6
  • input_7
  • input_8
  • input_9
  • input_10
  • input_11
  • input_12
  • input_13
  • input_14
  • input_15
  • input_16
  • list

ComfyUI's relationship with lists is the thing people bounce off first. A list input makes a node run once per item; a list output broadcasts; whether a node iterates or receives the whole batch depends on a flag set inside the node class, not on anything you can see on the canvas. EzFlex-MergeList is one of the honest exceptions: sixteen * inputs, one * output named list, and a rule you can hold in your head.

Lists get spliced in, everything else is appended as one item. Wire a list into input_3 and its contents join the output in place. Wire a single latent into input_4 and that latent is one item. Unwired ports contribute nothing - the output is dense, no holes, in port order.

What you'd reach for it for

Two jobs, and they're the two the pack's loop nodes need.

Loading a loop's itinerary. Round 1 should use segment 1's prompt, round 2 segment 2's, and so on. Merge those prompts (or durations, or reference images) into one list here, then let EzFlex-SplitList hand item i out to the round whose index matches. That's the whole "data-driven loop" pattern, and it's much easier to read than six copies of the same body.

Accumulating across rounds. EzFlex-LoopEnd carries values forward but its outputs are only the last round's - that's how the loop contract works. So to keep everything, you carry a growing list: this round's product plus the list that came in from LoopStart.valueK, merged here, handed back out through LoopEnd.valueK. After the final round the merged list arrives whole. Every "generate 30 seconds in six chunks and stitch" workflow ends up rebuilding this one pattern; the author's own repo notes call it the carry variable, and it's the only way to collect a loop's output without external tools.

Practical notes

Order is port order, input_1 through input_16 - not the order you happened to wire things in. That's the number to check when your stitched video plays segments out of sequence.

The output is *, typed only by whatever you fed it, which is the convenience and the tax at once. ComfyUI's wildcard socket is what makes switches, buses and list wranglers possible, and it's the same mechanism behind the community's long-running grumble about plugins that hide types and make graphs undebuggable. Here you're at the tame end of it - you know what you put in - but when something breaks downstream, the traceback points at the consumer, not at this node, and you'll be reading your own wiring to find out which item was the wrong shape. Keep a merged list homogeneous where you can; mixing an image tensor and a string in one list is legal, and you will not enjoy finding out where.

Install

Part of the EzFlex pack, so the install is the pack's:

cd ComfyUI/custom_nodes
git clone https://github.com/blackbossokok/Comfyui-EzFlex-Presets
# restart ComfyUI - or in Manager, search "EzFlex" (Comfyui-EzFlex-Presets)

mutagen is the only extra dependency (pip install -r requirements.txt). Nothing else to download - no models, no compilation.

Troubleshooting

  • The list is shorter than expected. Unwired ports are skipped rather than added as None, so a gap in your wiring is a gap in the output. Count the connected ports.
  • A downstream node runs six times when you wanted once. You're feeding a list into a node that iterates over lists. That feature is in the consuming node, not here - batch the items upstream (an image batch, a concatenated audio track) if you want a single pass.
  • The loop's list keeps growing past what you wanted. You're re-feeding the merged list each round while also appending the current product; that's the intended accumulation, but if the round count doubles, so does the list. Cap it with EzFlex-SplitList and a fixed number of ports, or drive the round count from EzFlex-TimeLine's segments.
CategoryEzFlex

Inputs (16)

NameTypeDefaultDescription
input_1opt*—
input_2opt*—
input_3opt*—
input_4opt*—
input_5opt*—
input_6opt*—
input_7opt*—
input_8opt*—
input_9opt*—
input_10opt*—
input_11opt*—
input_12opt*—
input_13opt*—
input_14opt*—
input_15opt*—
input_16opt*—

Outputs (1)

NameTypeDescription
list*—