Text List Product
Make ComfyUI write every prompt combination for you
- list_a
- list_b
- list
You've got three expressions, four poses, and two camera setups you want to try, and you are not going to hand-type all 24 prompt combinations. That's the boring middle of prompt experimentation, and this node exists to skip it: TextListProduct takes two lists of strings and hands back every possible pairing between them.
It's the core of the ComfyUI_TextListProduct pack - everything else in the pack is basically a shorthand for it. Feed it list_a = ["smiling", "frowning"] and list_b = ["blonde_hair", "crown", "beach"] with the default separator ", " and you get nine strings: "smiling, blonde_hair", "smiling, crown", "smiling, beach", "frowning, blonde_hair", and so on. That's the full cartesian product under the hood - the node is a thin wrapper around Python's itertools.product. The last list varies fastest, so list_b cycles through all its values before list_a moves on. If you care about the order of the output (and you will, once you're feeding these to a batch), that's the rule.
What to set
There are exactly four inputs and only two of them need your attention:
- separator - what joins the two halves. Default
", ", which is right for comma-tag prompts. Set it to""if you want1girl1boy-style concatenation, or" | "if you're building sentence prompts. - max_results - a hard cap on how many combinations get emitted. This is your guard against a 3×5×8 explosion turning into 120 rows you didn't ask for.
0means unlimited, which trips people up constantly. list_a/list_b- the two lists of prompt fragments.
The output is a single LIST of the combined strings. That's it.
How you actually feed it
list_a and list_b are forced LIST inputs, so you can't type into them - you need a node that outputs a LIST. The pack's own MultilineStringToList or StringsToList do the job, and so do WAS Node Suite's text-list outputs or Comfyroll's CR Prompt List, which is exactly what the author recommends pairing this with. On the way out, wire the LIST into the pack's TextListToSequence node to feed each prompt into the batch dimension, or into WAS's Save Text File to write the whole set to disk.
Where people get burned
- The LIST inputs are
forceInput. This is the #1 beginner trap across the whole pack: connect a plain STRING socket and it just won't take. Convert to a list first, every time. max_results = 0is "unlimited", not "none". You set it and get everything; set it to 5 and you get the first five in product order - sliced from the start, not a random sample.- Empty strings are quietly dropped. If an element of a list is
"", it's removed from each combination, so("", "beach")becomes just"beach". That's a feature (it's literally how the "With Single" sibling nodes are implemented), but it means a stray empty line in your source list silently changes your output count.
Install
It's on ComfyUI Manager: Manager → Install Custom Nodes → search "Comfy UI Text List Product", or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/opvelll/ComfyUI_TextListProduct
Restart ComfyUI. No dependencies, no model downloads - the pack is pure stdlib Python, just itertools.product with a clean UI and an MIT license.
The workflow this unlocks
The pattern the README points at: build expression × pose × camera lists, combine them here, feed the LIST into TextListToSequence, and let ComfyUI batch-generate every combination. Instead of writing 24 prompts you write three lists. It's the deterministic cousin of the wildcard/bracket trick from the prompt-variation playbook - same idea, but every combination gets a run, not just a random pick per batch.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| separator | STRING | , | — |
| max_results | INT | 0 | — |
| list_a | LIST | — | |
| list_b | LIST | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| list | LIST | — |