Nodes/ComfyUI-LogicUtils/Pyobjects/List Extend
ComfyUI Node

Pyobjects/List Extend

Merge two lists into one

By aria1th·Created 3 years ago·Updated 7 months ago· 116
Pyobjects/List Extend
  • list_a
  • list_b
  • LIST

Where List Append adds one item, List Extend merges two whole lists together - Python's list.extend(), as a node. Feed it list_a and list_b, get back a single flat list containing everything from both.

What it does

Both required inputs, list_a and list_b, are typed LIST. The node concatenates them - every element of list_a followed by every element of list_b - and returns the combined result as a single LIST output. Order matters: list_a's contents come first, list_b's second.

This is the node you want when you've built two separate lists on two different branches of a graph (say, one collecting values from a batch of images, another from a batch of text prompts) and you need one combined list to hand to a downstream node, or to Dump to JSON as a single array. It's also useful for stitching together a "base" list of defaults with a list of overrides, though be aware it just concatenates - it doesn't dedupe or merge by key the way you might want for that specific use case; if your two lists share values, both copies end up in the result.

The inputs and outputs that matter

  • list_a (required, LIST) - the first list; its items come first in the result.
  • list_b (required, LIST) - the second list; its items come after.
  • Output: LIST - the concatenation of both.

Installing it

Same as the rest of the pack: ComfyUI Manager, search ComfyUI-LogicUtils, install, restart - or manually, cd ComfyUI/custom_nodes && git clone https://github.com/aria1th/ComfyUI-LogicUtils, restart ComfyUI. Nothing to download beyond the repo itself; the pack has no real dependency footprint, which is exactly why it turned up as a recommendation in a Reddit thread specifically about avoiding heavy custom-node installs for simple logic operations. There's an opt-in install hook (COMFYUI_LOGICUTILS_AUTO_INSTALL=1) with an explicit off switch (COMFYUI_LOGICUTILS_SKIP_INSTALL=1); with nothing substantial to install, you can generally ignore both.

Where people get burned

Both ports genuinely need to be LIST-typed. This trips people coming from List Append, where the second input (item) accepts anything - Extend is stricter on purpose, because merging a single non-list value into a list isn't well defined the way appending one is. If you want to add one loose item rather than merge two lists, that's List Append's job, not this one; wiring a bare string or number into list_b will fail the type check before the graph even runs.

The other mix-up is the reverse: someone wants to add a single item and reaches for Extend, wrapping the item in a one-element list just to satisfy the type system. That works, but it's more wiring than necessary - Append does the same thing with one less node in the chain. As with the rest of this pack, the README's own admission that documentation is still catching up ("there are too many nodes") means the fastest way to confirm exact behavior when something looks off is reading the node's source directly on GitHub.

CategoryData

Inputs (2)

NameTypeDefaultDescription
list_aLIST
list_bLIST

Outputs (1)

NameTypeDescription
LISTLIST