π’ Prompt Combinator
Generate every prompt variation at once, the boring-way-but-reliable-way
- prompts
- combination_ids
- filenames
You know the {blonde|brunette|redhead} bracket trick for random prompt variations? Prompt Combinator is the exhaustive version of that. Instead of rolling the dice on one variant per run, it hands you every combination of the lists you give it, up front, in one shot. If you've ever wanted to render the same subject across four outfits, three poses, two lighting schemes and three moods and pick the winners afterwards, this is the node that turns that from a "generate until you forget what you changed" slog into one queue.
It's the flagship node of Luis Quesada's small ComfyUI-Prompt-Combinator pack, and it's been around since April 2024. The author's framing is a string combinator: feed it several multiline lists, get the cartesian product back. A r/comfyui regular puts it neatly: it's "universally useful since you are doing a mixture of all variances instead of just a random word."
How it works
Mechanically it's almost embarrassingly simple, which is why it's reliable. Each input list is split on newlines; each line is one option. Then the node takes the cartesian product (itertools.product, if you care) of all the lists, and joins each combination with a comma and a space. If a list is empty, it's ignored - so you can leave input lists 2 through 8 empty and just use one.
Two inputs make this genuinely useful beyond a plain text joiner:
- id_separator (default
@): each line can beshort-id@full prompt. The id is used for filenames, the prompt text for conditioning. Want your outputs namedcat-pointy ears-cuteinstead ofprompt_00001_? That's thecat@a cattrick from the README. One catch: ids can only contain letters, digits and spaces - the node asserts this, and it will hard-fail on a symbol. - comment_prefix (default
#): any line starting with this is skipped. Free to comment your lists without polluting the output.
Then there's join_prompt_using (comma and space / space / enter), which is the one people forget. "Enter" is a genuine hidden feature: it joins with newlines, which is what you want for tag-heavy models that read newline-separated tags, or when you're building prompts that get further processed downstream.
The other three inputs - input_list_1 through input_list_8 - are just your lists. That's the whole control surface, and it's the right size.
Outputs and where they go
- prompts (STRING list) - wire this into a CLIP Text Encode node's text input, and it runs the whole batch through your sampler.
- combination_ids (PROMPTCOMBINATORIDS list) - the id per combination, kept in the same order. This is the pack's private type; it exists so the Merger, Export Gallery and Random Prompt nodes can stay aligned with the prompts.
- filenames (STRING list) - dash-joined ids, meant to feed a Save Image node's
filename_prefixso you can tell which combination produced which file.
The README's example workflow shows the canonical graph: Prompt Combinator β CLIP Text Encode β KSampler β VAEDecode β Save Image. It's also in ComfyUI-Manager, so a downloaded workflow that references it installs itself.
Install and gotchas
Install via ComfyUI-Manager (search "ComfyUI-Prompt-Combinator") or:
cd ComfyUI/custom_nodes
git clone https://github.com/lquesada/ComfyUI-Prompt-Combinator.git
Then restart ComfyUI. No model downloads, no pip dependencies beyond what ComfyUI already ships - the whole pack is one Python file plus an HTML template.
Two things to know before you commit to it. First, it does not process {a|b} wildcards - those pass through literally into your prompt text, and there are real threads of people confused about that. It's a combinatorial generator, not a dynamic-prompt engine. Second, the license is CC BY-NC-SA 3.0 (non-commercial), so don't build a paid product around it. And watch your list sizes: 8 lists of 5 options is 390,625 prompts. The math is the feature, but it's also the trap.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| id_separator | STRING | @ | β |
| comment_prefix | STRING | # | β |
| join_prompt_using | COMBO | comma and space | 3 options: comma and space, space, enter |
| input_list_1 | STRING | β | |
| input_list_2opt | STRING | β | |
| input_list_3opt | STRING | β | |
| input_list_4opt | STRING | β | |
| input_list_5opt | STRING | β | |
| input_list_6opt | STRING | β | |
| input_list_7opt | STRING | β | |
| input_list_8opt | STRING | β |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| prompts | STRING | β |
| combination_ids | PROMPTCOMBINATORIDS | β |
| filenames | STRING | β |