41fe9f5122cf43d877f3266f140fdfc031b8c0dc
ComfyUI-Complex-Prompt
ComfyUI node for working with complex prompts with support for variables, randomness, and basic logic.
Nodes
Complex Prompt
Takes a multiline text prompt and expands dynamic prompt variants using dynamicprompts.
It can also accept optional ComplexPromptVars input and replace $variable_name
tokens after dynamic prompt expansion.
Example:
a {red|green|blue} car
Outputs one randomly selected variant, such as:
a green car
With variables:
$person in a {red|green|blue} car
If person exists in vars, $person is replaced with its value.
Variable tokens are preserved while dynamicprompts is parsing the prompt.
The seed input is randomized after generation and is passed to dynamicprompts.
Complex Prompt Set Variable
Creates or extends an ComplexPromptVars object.
varsis optional. If it is not connected, the node creates a new object.variable_nameis the key.valueis multiline text expanded throughdynamicprompts, then$variable_nametokens are replaced from the inputvarsbefore it is stored.seedis randomized after generation and is passed todynamicprompts.
Configuration
The configuration file is stored at:
ComfyUI/user/default/ComfyUI-Complex-Prompt/config.json
Languages
Python
91.2%
JavaScript
8.8%