MultiPlaceholder Prompt List
Generate every prompt combination from a template
- LIST
This is the clearest example in the whole pack of the problem it was built to solve. People genuinely ask "how do I make a grid of the same prompt with one token changed" in the ComfyUI community, and the honest answer is always some version of "there's no built-in way - you'll be building it with loops." This node is DemonAlone's answer to exactly that question: instead of hand-typing every variant of a prompt, you write one template and let the node generate every combination for you.
What it does
You write a Template with placeholder tokens in it - the default is "a girl in a {color} dress with {hair} hair". Then, for each placeholder, you list its candidate values: placeholder1 set to {color}, values1 set to "blue, red, black"; placeholder2 set to {hair}, values2 set to "blonde, brown, black". A third, optional pair (placeholder3/values3) is there if you need a third axis. Leave it blank and it's simply not used.
The node then substitutes every possible combination of your value lists into the template and outputs the whole set as a LIST of finished prompt strings - with the defaults above, that's 3 colors × 3 hair values = 9 fully-formed prompts, generated automatically instead of typed out by hand. Fill in a third axis and the count multiplies again. values_separator (default a comma) controls how each values field gets split; switch it to \n if any of your actual values need a literal comma inside them, so the node doesn't split in the wrong place. And if you want a combination where a placeholder should resolve to nothing at all - the phrase just isn't inserted - use the special value _empty_ in that placeholder's value list.
Wire the resulting LIST into a loop, and you've got a working prompt-grid pipeline: one graph run per generated prompt, without ever duplicating the sampling nodes.
Installing it
ComfyUI Manager: search DemonAlone-nodes-ComfyUI, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/DemonAlone/SimpeStringGenerator_ComfyUI
No dependencies or downloads beyond core ComfyUI - this node is pure string logic, nothing heavier.
Where people get burned
The separator is the most common trip-up. If any value in your list genuinely needs a comma - a phrase like "red, slightly faded" as one single value - the default comma separator will chop it into two separate values instead of treating it as one. Switch values_separator to \n and put one value per line instead.
The other one: your placeholder text has to match the template exactly, braces included. {color} in the Template field but placeholder1 set to just color without the braces won't substitute anything - copy the format from the node's own defaults rather than guessing at it. And remember combinations multiply fast: three axes of even five values each is 125 prompts, which is 125 full generations downstream if you feed the whole list into your sampler loop - know your count before you queue it.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| Template | STRING | a girl in a {color} dress with {hair} hair | Main prompt template. Use placeholders like {name}. Additional placeholders can be added below; all are equivalent and optional. |
| values_separator | STRING | , | Separator used for listing values (supports \n). Use \n for multi-line lists. |
| placeholder1 | STRING | {color} | First placeholder to replace. Optional and equivalent to other placeholders. |
| values1 | STRING | blue, red, black | Comma-separated list of values for the first placeholder. Use '_empty_' as a value to insert an empty string. |
| placeholder2 | STRING | {hair} | Second placeholder to replace. Optional and equivalent to others. |
| values2 | STRING | blonde, brown, black | Comma-separated list of values for the second placeholder. Use '_empty_' as a value to insert an empty string. |
| placeholder3 | STRING | Third placeholder (optional). | |
| values3 | STRING | Values for the third placeholder. Use '_empty_' as a value to insert an empty string in the final prompt. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LIST | LIST | — |