DynamicPrompts Text Box
A multiline prompt box with {a|b|c} wildcards
- STRING
This is Derfuu's multiline text box with one extra trick: it understands dynamic-prompts choice syntax. Write a {red|blue|green} car and each run it randomly resolves to one of the options - red, blue, or green. It's the same idea as the classic dynamic prompts / wildcards feature people use to churn out variety without editing the prompt every time. If you just want a plain multiline field with no substitution, Derfuu's regular text nodes are simpler; reach for this one specifically when you want the {...} variation.
How it works
You type into a multiline field, and before the prompt goes downstream the node expands any {option1|option2|...} groups by picking one at random. The output is an ordinary STRING - the resolved prompt - which you feed into a CLIP Text Encode like any other text. Per Derfuu's own note, the dynamic-prompts support is the "standard" flavor and doesn't work inline (nested inside another construct), so keep your choice groups as straightforward top-level {a|b|c} blocks rather than trying to bury them.
The inputs and outputs that matter
- Text (STRING, multiline) - your prompt, with optional
{a|b|c}choice groups. - Output: STRING - the resolved prompt after the wildcards are picked, wired into your text encoder.
Where it fits
Batch variety is the use case. Set a seed to iterate and you'll get a different combination each run, which is great for exploring a space - different outfits, backgrounds, styles - from one prompt template. It slots in exactly where a normal prompt box would, so you can drop it into an existing graph in place of a plain text node and immediately get variation.
How to install it
ComfyUI Manager: search Derfuu_ComfyUI_ModdedNodes, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/Derfuu/Derfuu_ComfyUI_ModdedNodes
then restart. No dependencies, no models - plain Python.
Common issues & troubleshooting
The braces show up literally in the output. Then the syntax isn't being parsed - check you're using this node and not a plain text box, and that your groups are top-level {a|b} and not nested inline, which Derfuu explicitly notes doesn't work here.
It picks the same option every time. Randomization keys off your seed. If the seed is fixed, the choice is fixed - set the seed control to randomize/increment to vary the pick across runs.
You expected weighted or wildcard-file syntax. This is the "standard" dynamic-prompts style - inline {a|b|c} choices. If you need advanced features like external wildcard files or nesting, a dedicated dynamic-prompts pack will serve you better than this box.
Missing node in a downloaded workflow. Derfuu has deleted deprecated nodes on updates rather than keeping them labeled, so old graphs can point at gone names - reconnect a current copy. A ModuleNotFoundError about Derfuu_ComfyUI_ModdedNodes_legacy means a duplicated folder; keep one named Derfuu_ComfyUI_ModdedNodes.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| Text | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |