Nodes/MD Nodes/MD: Universal Wildcard Orchestrator
ComfyUI Node

MD: Universal Wildcard Orchestrator

MD Universal Wildcard Orchestrator

By MDMAchine·Created about a year ago·Updated 3 months ago· 15
MD: Universal Wildcard Orchestrator
    • final_prompt
    seed0
    randomize_seedtrue
    preset_fileNone
    text_widget
    input_text_override
    delimiter|
    debug_mode0 - Silent
    enable_profilingfalse

    Wildcard syntax - {red|blue|green} meaning "pick one" - is old A1111 tech that's quietly become essential again: it's how people do seeded prompt randomization and build character-reference libraries without any LoRA training. This node is a pure, recursive wildcard rendering engine, and unlike the pack's other prompt nodes it's model-agnostic - no audio lean, no LLM required, just fast text in, expanded text out.

    How it works

    You hand it a template, it resolves every {A|B|C} (including nested braces inside braces) using a seeded random pick, and returns one final string. The seed input makes everything reproducible, and randomize_seed (default on) rolls a fresh seed every run so each generation explores new combinations. delimiter lets you change the split character from the default | - you almost never need to.

    The input priority order is the feature most people miss:

    1. input_text_override (the noodle) - highest priority; wire an LLM output or another text node here for fully automated pipelines.
    2. text_widget - manual template entry; overrides the preset file.
    3. preset_file - a dropdown of .txt files in the pack's presets/ folder; only used if both of the above are empty.

    That last one ships with real content - 50+ files with names like Abyssal_Bossa_Nova.txt, Chimney_Core.txt, Cyber_Shanty.txt, plus decade packs. If you don't want to run wildcards yourself, hit Random and let it pull a whole prompt out of a file.

    Inputs and outputs

    The essentials: seed, randomize_seed, text_widget, and preset_file. debug_mode and enable_profiling are console diagnostics - set debug_mode to 1 - Info if you're debugging gnarly nested wildcards and want to see which source the text came from.

    Output is a single final_prompt STRING. For image work that goes straight into a CLIPTextEncode; for audio it feeds the ACE-Step caption path. Clean and boring, in the best way.

    Installing it

    cd path/to/ComfyUI/custom_nodes
    git clone https://github.com/MDMAchine/ComfyUI_MD_Nodes.git
    cd ComfyUI_MD_Nodes
    pip install -r requirements.txt
    

    Or search MD_Nodes in ComfyUI Manager and restart.

    The honest take

    Two notes. First, the preset library is heavily music-flavored because the author is an ACE-Step audio person - so image users will mostly live in the text_widget and their own files. Second, you can drop your own .txt files into the pack's presets/ folder and they'll appear in the dropdown (lines starting with # or // are skipped as comments), which is the move if you want your own themed prompt libraries. The engine itself is fast, recursive, and seeded - the same job the bigger prompt-builder node does, minus the structured audio metadata. If that's all you need, this is the one to grab.

    CategoryMD_Nodes/Prompt Generation

    Inputs (8)

    NameTypeDefaultDescription
    seedINT00–9007199254740991SEED VALUE • Purpose: Controls random selection logic for wildcards. • Range: 0 to 9,007,199,254,740,991 (JS Safe Max). • Trade-offs: Consistent seeds ensure reproducible prompts. ⭐ Recommended: Connect a global seed node or enable Randomize Seed.
    randomize_seedBOOLEANtrueRANDOMIZE SEED • Purpose: Automatically change seed every generation run. • Options: True (New choices every run), False (Lock current choices). • Trade-offs: Disable this when you want to refine a specific prompt result. ⭐ Recommended: Keep True for prompt exploration.
    preset_fileCOMBONonePRESET FILE (Priority 3) • Purpose: Load template from the local /presets folder. • Range: All .txt files in the local presets directory. • Trade-offs: Only used if widget and noodle inputs are completely empty. ⭐ Recommended: Use this to cycle through massive, pre-written prompt libraries.
    text_widgetSTRINGTEXT WIDGET (Priority 2) • Purpose: Manual template entry with wildcard syntax (e.g. {A|B}). • Range: Any valid text string. • Trade-offs: Overrides Preset File; ignored if Input Noodle is connected. ⭐ Recommended: Perfect for one-off generation tests and prompt drafting.
    input_text_overrideoptSTRINGINPUT TEXT OVERRIDE (Priority 1) • Purpose: Receive templates from other nodes (LLMs, String logic). • Range: Any string or safely sanitized tensor input. • Trade-offs: Highest priority; overrides both the widget and local files. ⭐ Recommended: Connect LLM outputs here for fully automated pipelines.
    delimiteroptSTRING|DELIMITER • Purpose: Defines the split character for options within the braces. • Range: Single character (usually | or ,). • Trade-offs: Custom delimiters can break standard syntax compatibility. ⭐ Recommended: Leave as '|' unless using highly specialized formats.
    debug_modeoptCOMBO0 - SilentLOGGING VERBOSITY • Purpose: Controls console output and parser profiling. • Options: 0 (Silent), 1 (Analytics/Source ID), 2 (Full tracing). ⭐ Recommended: 0 for production, 1 when debugging complex nested wildcards.
    enable_profilingoptBOOLEANfalseENABLE PROFILING • Purpose: Measure timing of the recursive parsing algorithm. • Note: Automatically enabled if debug_mode >= 1. ⭐ Recommended: False.

    Outputs (1)

    NameTypeDescription
    final_promptSTRING