MD: Wildcard Prompt Builder
Structured prompts for audio, image and video
- GENRE_TAGS
- VOCAL_TAGS
- LYRICS
- DURATION_STRING
- DURATION_FLOAT
- BPM
- TIME_SIG_STR
- TIME_SIG_COMBO
- KEY_SCALE_STR
- KEY_SCALE_COMBO
- SEED
- TEXT_PREVIEW
- YAML_CONFIG
- INTERPRETED_PROMPT
The Universal Wildcard Orchestrator is a plain wildcard expander. This is its bigger sibling: it expands wildcards and produces a structured, machine-readable prompt bundle - genre tags, vocal chains, lyrics, duration, BPM, key/scale, time signature - plus a single INTERPRETED_PROMPT formatted for whatever model family you're targeting. You give it a concept, it hands your graph a complete creative brief.
Pick your target
output_target decides the vocabulary and format:
- Audio (ACE-Step) - genre, vocals, lyrics, BPM, key outputs for ACE-Step music generation.
- Image (SD/Flux) - an image prompt on
INTERPRETED_PROMPT. - Video (Wan/Mochi) - a video prompt on
INTERPRETED_PROMPT. - All Three - every output populated for unified media workflows.
For ACE-Step audio, ace_step_mode (on by default) upgrades output to the rich, Gemini-style prose captions ACE-Step 1.5 wants, and auto-strips BPM/key metadata out of the caption so the model doesn't try to read numbers as text. descriptive_mode swaps comma-tag output for full sentences when you want it.
How generation happens
generation_mode picks wildcard (instant, from internal libraries and your .txt files), llm (Ollama writes fresh content), or hybrid (the LLM picks smart combinations from curated lists). The concept field is your creative brief - be specific about genre, mood, and sonic elements and the outputs get markedly better.
The Ollama integration is worth understanding before you touch it: ollama_enabled is the master switch, and if it's False the node falls back to wildcard generation instantly and never probes the network. If you don't run Ollama, set it False - that's the author's own advice, and it's good. When it's on, you get the full sampling-knob set (temperature, top_k, top_p, min_p, keep_alive, llm_timeout). orchestrator_mode does a single-shot LLM pass for a fully coherent brief - ACE-Architect is the recommended mode for ACE-Step 1.5, and it's what outputs that big YAML_CONFIG string.
The outputs, and which ones to grab
The full list is intimidating: GENRE_TAGS, VOCAL_TAGS, LYRICS, DURATION_STRING, DURATION_FLOAT, BPM, TIME_SIG_STR, TIME_SIG_COMBO, KEY_SCALE_STR, KEY_SCALE_COMBO, SEED, TEXT_PREVIEW (a rendered dashboard image of the brief), YAML_CONFIG, and INTERPRETED_PROMPT.
But you'll use two or three. Audio users: GENRE_TAGS, VOCAL_TAGS, LYRICS into the ACE-Step text encoding, and YAML_CONFIG into the MD sampler's yaml_settings_str override - that's the whole point of the YAML_CONFIG output, a ready-made config string. Image/video users: switch output_target, grab INTERPRETED_PROMPT, run it into a CLIPTextEncode, done.
The honest take
The pin count is the worst thing about this node. Everything else is genuinely well designed - the ollama_enabled kill-switch, the ACE-Step-aware caption stripping, the YAML config output that closes the loop with the pack's samplers. If you're building ACE-Step audio workflows, this is arguably the pack's best node. If you're image-only and have zero interest in audio, the same functionality lives in simpler, more neutral packs, and the audio-centric defaults here will just be noise. But as a one-node "concept in, structured brief out" pipeline, it's the real deal.
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. Ollama is an optional extra - the node works without it as a pure wildcard engine.
Inputs (36)
| Name | Type | Default | Description |
|---|---|---|---|
| generation_mode | COMBO | wildcard | GENERATION MODE • Purpose: Core logic for creating prompt content. • Wildcard: Instant random selection from internal/file libraries. • LLM: Full creative generation via Ollama API. • Hybrid: LLM intelligently selects from curated option lists. Recommended: Hybrid for best themed variety. |
| output_target | COMBO | Audio (ACE-Step) | OUTPUT TARGET • Purpose: Sets vocabulary and prompt format for the target model. • Audio: ACE-Step optimised outputs (genre, vocals, lyrics, BPM, key). • Image: SD/Flux prompt in INTERPRETED_PROMPT output. • Video: Wan/Mochi video prompt in INTERPRETED_PROMPT output. • All Three: All outputs populated for unified media workflows. Existing GENRE_TAGS/VOCAL_TAGS/LYRICS outputs always populated. |
| ace_step_mode | BOOLEAN | true | ACE-STEP MODE • Purpose: Enables ACE-Step 1.5 caption quality enhancements. • True: Rich Gemini-style prose captions. BPM/key auto-stripped from caption. • False: Standard tag-list output (legacy behaviour). Recommended: True for ACE-Step 1.5 workflows. |
| descriptive_mode | BOOLEAN | false | DESCRIPTIVE MODE • Purpose: Prose sentences instead of comma-separated tags. • True: Sentence-style output. False: Tag list. • Note: ace_step_mode overrides this for genre output automatically. Recommended: False unless specifically needed. |
| concept | STRING | Dark neurofunk drum and bass with heavy reese bass and complex rolling breaks | CONCEPT PROMPT • Purpose: The core theme driving generation across all targets. • Usage: Used by LLM/Hybrid/Orchestrator as creative brief. • Tip: Be specific — genre, mood, energy, references. Recommended: Include genre, mood, and key sonic elements. |
| seed | INT | 00–9007199254740991 | RANDOM SEED • Purpose: Controls all wildcard randomization. • Range: 0 to 9,007,199,254,740,991 (JS Safe Max). Recommended: Connect global seed for workflow sync. |
| randomize_seed | BOOLEAN | true | RANDOMIZE SEED • Purpose: Auto-change seed every run for variety. • True: New choices every run. False: Lock current seed. Recommended: True for exploration, False for reproduction. |
| duration_template | STRING | {120|180|240} | DURATION TEMPLATE • Purpose: Track/clip length logic in seconds. • Format: Accepts wildcards e.g. {120|180|240}. • Note: Orchestrator mode may override this. |
| ollama_enabledopt | BOOLEAN | true | OLLAMA ENABLED • Purpose: Master switch for all LLM API calls. • False: Disables all Ollama calls — falls back to wildcard instantly. • Use False if Ollama is not installed to prevent any network probing. Recommended: False if Ollama not installed. |
| ollama_api_urlopt | STRING | http://localhost:11434 | Ollama API base URL (e.g. http://localhost:11434). |
| ollama_modelopt | COMBO | llama3:8b-instruct-q8_0 | Ollama model to use. List auto-refreshes in background. |
| orchestrator_modeopt | COMBO | Off | ORCHESTRATOR MODE • Purpose: Single-shot LLM pass for fully coherent output. • Standard: General purpose BPM/key/genre/lyrics in one call. • ACE-Architect: ACE-Step 1.5 optimised. Rich prose caption + metadata. Recommended: ACE-Architect for best ACE-Step 1.5 results. |
| temperatureopt | FLOAT | 0.70–2 | TEMPERATURE • LLM creativity (0.2=focused, 1.0=chaotic, 1.4=unhinged). |
| top_kopt | INT | 401–200 | TOP K • Token vocabulary limit for predictability. |
| top_popt | FLOAT | 0.900–1 | TOP P • Nucleus sampling cumulative cutoff. |
| min_popt | FLOAT | 0.050–1 | MIN P • Filters low probability tokens relative to best choice. |
| keep_aliveopt | INT | 3000–3600 | KEEP ALIVE (Seconds) • Model VRAM retention. 0 = unload immediately after call. |
| llm_timeoutopt | INT | 12030–600 | LLM TIMEOUT (Seconds) • Purpose: Max seconds to wait for a single Ollama API response. • Options: 30–600s. Default 120s. • Trade-offs: Lower = faster failure detection; higher = tolerates slow models. • ⭐ Recommendation: 30–60s for fast models (llama3, mistral). 120s+ for large reasoning models (Qwen3-32B, QwQ). |
| load_genre_fileopt | COMBO | None | Load external genre wildcard .txt file. |
| load_vocal_fileopt | COMBO | None | Load external vocal wildcard .txt file. |
| load_lyrics_fileopt | COMBO | None | Load external lyrics wildcard .txt file. |
| yaml_inputopt | STRING | YAML INPUT OVERRIDE • Override any parameter via YAML key-value string. | |
| custom_genre_templateopt | STRING | Custom genre/caption text. Wildcards {a|b} supported. Overrides generation. | |
| custom_vocal_templateopt | STRING | Custom vocal style text. Overrides generation. | |
| custom_lyrics_templateopt | STRING | Custom lyrics text. Overrides generation. | |
| custom_bpmopt | STRING | Override BPM (integer or wildcard {174|172}). | |
| custom_time_sigopt | COMBO | Auto | Override time signature (4 = 4/4, 3 = 3/4, etc). |
| custom_key_scaleopt | COMBO | Auto | Override key/scale (C Major, F# Minor, etc). |
| expand_custom_templatesopt | BOOLEAN | true | Expand {wildcard} patterns in custom template inputs. |
| generate_genreopt | BOOLEAN | true | Enable/disable genre/caption generation. |
| generate_vocalsopt | BOOLEAN | true | Enable/disable vocal style generation. |
| generate_lyricsopt | BOOLEAN | true | Enable/disable lyrics generation. |
| force_instrumentalopt | BOOLEAN | false | Force instrumental: clears vocals, sets lyrics to [Instrumental]. |
| lora_triggeropt | STRING | LORA TRIGGER TAG • Purpose: Prepend a LoRA trigger token to the genre/caption output. • Example: mdm4_dnb • Always placed first, before any generated text. Recommended: Use your LoRA's exact trigger string. | |
| debug_modeopt | COMBO | 0 - Silent | Logging verbosity level. |
| enable_profilingopt | BOOLEAN | false | Enable detailed performance profiling output. |
Outputs (14)
| Name | Type | Description |
|---|---|---|
| GENRE_TAGS | STRING | — |
| VOCAL_TAGS | STRING | — |
| LYRICS | STRING | — |
| DURATION_STRING | STRING | — |
| DURATION_FLOAT | FLOAT | — |
| BPM | INT | — |
| TIME_SIG_STR | STRING | — |
| TIME_SIG_COMBO | 4,3,5,6,7 | — |
| KEY_SCALE_STR | STRING | — |
| KEY_SCALE_COMBO | C major,C minor,C# major,C# minor,D major,D minor,D# major,D# minor,E major,E minor,F major,F minor,F# major,F# minor,G major,G minor,G# major,G# minor,A major,A minor,A# major,A# minor,B major,B minor | — |
| SEED | INT | — |
| TEXT_PREVIEW | IMAGE | — |
| YAML_CONFIG | STRING | — |
| INTERPRETED_PROMPT | STRING | — |