ComfyUI Node

Merge List

Concatenate two ComfyUI lists into one

By lldacing·Created 3 years ago·Updated 8 months ago· 96
Merge List
  • list_a
  • list_b
  • LIST

Exactly what the name promises, no more: give it two lists, get one list back with the second appended to the first. [1,2] and [3,4] in, [1,2,3,4] out - that's the pack author's own example, and it's the whole node. If you've built anything in Python you already understand ListMerge; the only reason it needs to exist as a node at all is that ComfyUI's graph doesn't otherwise give you a way to combine two LIST-typed outputs into one.

It's part of comfyui-easyapi-nodes, lldacing's pack of small utility nodes built for people driving ComfyUI through its API rather than clicking through the UI by hand. A lot of that pack is exactly this flavor of node: unglamorous plumbing that Python gives you for free but a visual graph doesn't, until someone writes it as a node.

Where you'd actually reach for it

Say you're batching prompts or file paths from two different sources - one list built from an upstream API call, another assembled from a local StringToList or IntToList node - and you need them combined before they hit a loop or a batch processor downstream. Rather than rewiring your graph to merge inputs earlier, ListMerge just takes two LIST inputs and hands you the concatenation. It's also the natural companion to this pack's own ListWrapper/ListUnWrapper nodes, and to StringToList/IntToList when you've built partial lists from separate string or integer inputs and need one combined list to feed a loop.

The inputs and outputs that matter

  • list_a (LIST, required) - the first list. This is the only input ListMerge actually needs to run.
  • list_b (LIST, optional) - the second list, appended after list_a.
  • Output: LIST - the merged result, ready to wire into anything expecting a LIST - a ForEachOpen loop, another merge, a filter node.

Order matters and there's no dedup or sort - it's a straight concatenation, list_a then list_b, duplicates and all.

How to install it

Through ComfyUI Manager: search comfyui-easyapi-nodes and install. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/lldacing/comfyui-easyapi-nodes.git
cd comfyui-easyapi-nodes
pip install -r requirements.txt

Restart ComfyUI to pick it up. No models, no heavy dependencies for this particular node - the pack's requirements.txt covers its image-handling utilities elsewhere, not anything ListMerge needs.

Common issues & troubleshooting

"Merged" list is empty or shorter than expected. list_b is optional - if nothing's connected, ListMerge just passes list_a straight through. Double-check both inputs are actually wired if you expected a real merge.

Type errors downstream. ComfyUI's LIST type doesn't enforce that both lists hold the same element type - you can merge a list of strings with a list of numbers and ListMerge won't complain. The error, if there is one, shows up later, in whatever node consumes the merged list and expects a consistent type. Keep the element types matched on your end.

You actually wanted three or more lists merged. ListMerge only takes two. Chain a second ListMerge off the output of the first if you need to fold in a third list, and so on.

CategoryEasyApi/List

Inputs (2)

NameTypeDefaultDescription
list_aLIST
list_boptLIST

Outputs (1)

NameTypeDescription
LISTLIST