Combine Lists
Set math for your prompt lists
- combined
Most of the time you just want two lists merged, and any basic concat does the job. But every so often you need to compare lists - what's in both, what's only in one, what's new - and that's where Combine Lists earns its keep. It's the pack's Swiss Army knife for combining two string lists, with six operations that range from plain concatenation to full set algebra.
The way to think about it: you've got two lists, list_a and list_b, and a dropdown that decides how they relate. It's genuinely useful for caption management (merge two tag sets without duplicates), for file list work (which files exist in one folder but not the other), and for any workflow where you're merging and de-duping sources.
The operations
- OR (Union) - all distinct entries from both lists, in order. The default, and the one you'll use most.
- AND (In both A and B) - only entries that appear in both lists.
- XOR (A or B but not both) - entries in exactly one of the two.
- A minus B - entries in A that aren't in B.
- B minus A - entries in B that aren't in A.
- CONCAT (Union with duplicates) - everything from both, in order, duplicates included.
All the set-style operations preserve first-seen order and drop repeats. CONCAT is the odd one out deliberately: it keeps duplicates because sometimes duplicates carry meaning - say, a weighted prompt list where "cat" appearing twice is supposed to matter.
The inputs are list_a and list_b (both wired STRING lists) and operation (the dropdown). The output combined is a single list, ready for whatever consumes it.
Installing it
Combine Lists lives in ComfyUI-TinyBee, a small MIT-licensed utility pack with no models to fetch. Via Manager:
- ComfyUI Manager → Custom Nodes Manager.
- Search "ComfyUI-TinyBee" and install.
- Restart ComfyUI.
Or clone:
cd ComfyUI/custom_nodes
git clone https://github.com/TinyBeeman/ComfyUI-TinyBee
Restart and it's under 🐝TinyBee/Lists. Pure standard library under the hood - the pack's jsonata dependency only matters for its JSON Parser node.
Gotchas
Watch the ordering nuance: the set operations dedupe within a list too. If list_a already contains "portrait" twice, OR (Union) returns it once - so if you need raw multiplicity, reach for CONCAT instead of Union. And remember both inputs are lists, not comma-separated strings: if you're pasting text, run it through a String to List node first. One more: "AND", "XOR", and the minus ops are order-sensitive in the obvious way, so think about which list is A and which is B before you wire it.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| list_a | STRING | — | |
| list_b | STRING | — | |
| operation | COMBO | OR (Union) | 6 options: OR (Union), AND (In both A and B), XOR (A or B but not both), A minus B, B minus A, CONCAT (Union with duplicates) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| combined | STRING | — |