CivArchive
    Dynamic Prompt Nodes for ComfyUI - v1.0
    Preview 1830127
    Preview 1830218
    Preview 1830217

    A port of the SD Dynamic Prompts Auto1111 extension to ComfyUI. Includes the most of the original functionality, including:

    1. Templating language for prompts

      • Variant syntax A {red|green|blue} ball

      • Weights - e.g. {0.5::summer|0.1::autumn|0.3::winter|0.1::spring}

      • Select multiple values My favourite ice-cream flavours are {2$$chocolate|vanilla|strawberry} will produce My favourite ice-cream flavours are chocolate,strawberry

      • Custom separators My favourite ice-cream flavours are {2$$ and $$chocolate|vanilla|strawberry} will produce My favourite ice-cream flavours are chocolate and strawberry

      • Ranges My favourite ice-cream flavours are {1-2$$chocolate|vanilla|strawberry}

    2. Wildcards

      1. Nested directory hierarchies e.g __color/warm__

      2. Globbing for matching multiple files, e.g . __color*__

      3. txt/yaml/json file formats

    3. Combinatorial mode - will produce all possible variations of your prompt.

    4. I'm Feeling Lucky (downloads prompts from lexica.art)

    5. Magic Prompt - spices up your prompt with modifiers

    6. Jinja2 templates for more advanced prompting requirements

    7. Variable assignment - ${season=!__season__} In ${season}, I wear ${season} shirts and ${season} trousers

    8. Parameterized templates for re-usable templates, similar to calling a function

    9. Extensive documentation

    10. Video tutorials in 9 languages

    Installation

    The recommended way to install this extension is by using the ComfyUI Manager.

    Get the latest version on Github: https://github.com/adieyal/comfyui-dynamicprompts/

    Description

    FAQ

    Comments (9)

    AnistasiataAug 2, 2023· 2 reactions
    CivitAI

    You absolute legend, thanks for this.

    goldmanAug 6, 2023
    CivitAI

    Just grabbed this and it's great, thank you...quick question, to get wildcards working do I need to create a new folder called 'wildcards' inside the 'comfyui-dynamicprompts' folder I now have in 'custom_nodes' ???

    soapsudtycoon
    Author
    Aug 6, 2023· 1 reaction

    you need to create a wildcards folder either in the comfui root directory, or inside the comfui-dynamicprompts folder. One user opened an issue saying that he had to put the directory in the same folder as sampler.py (https://github.com/adieyal/comfyui-dynamicprompts/issues/1) - If you have any trouble, try that as a workaround until there is a fix

    AnistasiataAug 6, 2023· 2 reactions
    CivitAI

    Edit: I've solved two problems, putting it here in case others encounter them:

    1. Failed to import at launch (can't find "dynamicprompts"): Check your ../users/<username>/appdata/local/programs/python/python<version>/lib folder. Look for a folder called dynamicprompts. Move that folder to ../ComfyUI/... wherever it is Python is installed on the drive you're using, and drop it into the lib folder. Basically, you want it to be in the Python folder ComfyUI is looking in, not in the one in your AppData folder. (Unless if course it's looking there, in which case you shouldn't experience this issue in the first place.)

    2. Failed to utilize wildcards ("no values found"): Go to../ComfyUI/custom_nodes/comfyui-dynamicprompts/nodes and open sampler.py in your text editor of choice, preferable one meant for coding to make it easier to see what's going on.

    Find def find_wildcards_folder(self): which should be on line 35 as of time of writing.

    Under this you'll see wildcards_folder = Path ("wildcards").

    Replace "wildcards" with "<file path to your wildcards folder>". For example, it might read...

    wildcards_folder = Path("D://My Folder/ComfyUI_windows_portable/ComfyUI/wildcards")

    Also make sure that your wildcard collections are in this folder, and not within subfolders inside said folder.

    soapsudtycoon
    Author
    Aug 6, 2023· 1 reaction

    python 3.1 - that's awful - even 3.4 is very old. I'm not sure that the dynamic prompts library will even work on such an old installation. In any case, https://github.com/adieyal/dynamicprompts is the library that sd-dynamic-prompts (the auto1111 extension) uses. This comfui extension also uses it, that way you should be able to use your old auto1111 prompts in comfy. If you can't use pip, you can probably just download a release, e.g. https://github.com/adieyal/dynamicprompts/releases/tag/v0.29.0 and then run setup.py in your virtual environment. If at all possible, you really should upgrade your python. Perhaps try pyenv?

    AnistasiataAug 6, 2023

    I actually do have a standalone pip on here for some reason... I think I got it while playing around with AI language models...? I wonder if I could somehow do it with that. Anyway, I'll try the setup.py method and maybe look into pyenv while I'm at it. Thanks!

    AnistasiataAug 6, 2023

    @soapsudtycoon Okay! Good news is, setup.py seems to have worked. Bad news is, Comfy's returning this:

    "ModuleNotFoundError: No module named 'dynamicprompts'"

    Is there a specific directory that Dynamic Prompts has to be in when I run the setup, perhaps...? My first and best guess is that whatever it had to install, it installed to the wrong place.

    soapsudtycoon
    Author
    Aug 12, 2023

    @Anistasiata It might be that the python you used to install dynamicprompts is not the same one that you are using to run comfy. Find the full path to that python interpreter and use it to run setup.py

    rephugeeJul 23, 2024
    CivitAI

    Very cool! Thank you. Minor issue: When using wildcard files, I've noticed the wildcard trigger/folder is saved in the prompt EXIF data instead of the actual lines that were randomly selected. Is there any way to save the actual randomly selected line in the EXIF Prompt field? It makes it very difficult to replicate a photo if you don't know what the prompt sent when it was passed through the models.

    All my output files have __wildcard__
    Other
    Other

    Details

    Downloads
    724
    Platform
    CivitAI
    Platform Status
    Available
    Created
    8/1/2023
    Updated
    5/15/2026
    Deleted
    -

    Files

    dynamicPromptNodesFor_v10.zip

    Mirrors

    dynamicPromptNodesFor_v10.zip

    Mirrors

    Available On (1 platform)

    Same model published on other platforms. May have additional downloads or version variants.