dynamic_prompt_nodes
Dynamic prompt nodes to fully support wildcards for ComfyUI
Package profile
- Status
- Verified
- Publisher
- @cesasol
- Source
- GitHub
- Stars
- 1
README
Dynamic Prompt Nodes
ComfyUI custom nodes for dynamic prompt generation with full wildcard and variable support. Implements the sd-dynamic-prompts syntax natively — no external generator dependency.
Features
- Random sampling — pick random variants from
{option1|option2|option3} - Combinatorial generation — enumerate every possible prompt combination
- Cyclical sampling — cycle through options in order across generations
- Wildcards — substitute values from
.txtor.yamlwildcard files using__wildcard_name__ - Variables — define and reuse values within a prompt via
${name=value} - PPP tags — full support for
<ppp:set>,<ppp:echo>,<ppp:if>,<ppp:stn>, and<ppp:ext>tags from sd-webui-prompt-postprocessor - Model family inference — auto-detects SD1, SDXL, SD3, or Flux from the model input
- Model variant override — manually specify Pony, Illustrious, Anima, or NoobAI variants for conditional tags
- Prompt cleanup — optional duplicate removal, extra space normalization, and empty construct cleanup
- Negative prompt collection —
<ppp:stn>content is automatically collected and merged into the negative prompt output
Installation
Via ComfyUI Manager
Search for Dynamic Prompt Nodes and install.
Manual
cd ComfyUI/custom_nodes
git clone https://github.com/cesasol/dynamic_prompt_nodes
cd dynamic_prompt_nodes
pip install -e .
Place wildcard files (.txt or .yaml) in ComfyUI/custom_nodes/dynamic_prompt_nodes/wildcards/.
Nodes
Dynamic Prompt (Random)
Processes a prompt template and returns a randomly sampled string each generation.
Inputs: template (STRING), seed (INT)
Output: prompt (STRING)
Dynamic Prompt (Combinatorial)
Enumerates all combinations from a template. Feed into a batch to generate every variant.
Inputs: template (STRING), index (INT)
Outputs: prompt (STRING), all_prompts (STRING), total_count (INT)
Dynamic Prompt (Cyclical)
Steps through options in order, advancing one position each generation. Useful for systematic variation without randomness.
Inputs: template (STRING)
Output: prompt (STRING)
Prompt with Wildcards
Advanced prompt processor with full PPP tag support, model family inference, and optional cleanup. Processes both positive and negative templates simultaneously.
Inputs:
model(MODEL) — model input for family inferencepositive_template(STRING, multiline) — positive prompt templatenegative_template(STRING, multiline) — negative prompt templateseed(INT) — random seed for reproducible generationignore_repeats(BOOLEAN) — remove duplicate keywordscleanup_extra_spaces(BOOLEAN) — normalize whitespacecleanup_empty_constructs(BOOLEAN) — remove empty keywords and attention tagsmodel_variant(STRING, optional) — override variant:pony,illustrious,anima,noobai
Outputs: positive (STRING), negative (STRING)
Model Family Auto-Detection:
- SD1 —
diffusion_model.input_blockslength of 8 - SDXL —
diffusion_model.input_blockslength of 9 - SD3 —
diffusion_model.in_channelsof 16 - Flux —
diffusion_model.img_inattribute present
System Variables (available in <ppp:if> conditions):
_is_sd1,_is_sdxl,_is_sd3,_is_flux— base architecture_is_pony,_is_illustrious,_is_anima,_is_noobai— variant flags_is_sd— true for SD1, SDXL, SD3, and their variants
Syntax
Variants
| Syntax | Description |
|---|---|
{cat|dog|bird} | Pick one randomly |
{2$$cat|dog|bird} | Pick exactly 2 |
{1-3$$cat|dog|bird} | Pick 1 to 3 |
{2$$ and $$cat|dog} | Pick 2 with custom separator |
{3::rare|1::common} | Weighted selection |
{@cat|dog|bird} | Cyclical (steps each call) |
Wildcards
| Syntax | Description |
|---|
Nodes in this pack
4 nodes
Nodes in this pack
4 nodes- DynamicPromptCombinatorial
- DynamicPromptCyclical
- DynamicPromptRandom
- PromptWithWildcards
Related resources
1 connection
Related resources
1 connectionSources
3 sources
Sources
3 sourcesVerified Oct 23
Verified Oct 23
Source excerpts
1 excerpt
Source excerpts
1 excerptSource context: Repo cesasol/dynamic_prompt_nodes
