Nodes/MD Nodes/MD: Wildcard Prompt Builder
ComfyUI Node

MD: Wildcard Prompt Builder

A ComfyUI node in MD_Nodes/Prompt Generation with 36 inputs and 14 outputs.

By MDMAchine·Created about a year ago·Updated 2 months ago· 14
MD: Wildcard Prompt Builder
    • 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
    generation_modewildcard
    output_targetAudio (ACE-Step)
    ace_step_modetrue
    descriptive_modefalse
    conceptDark neurofunk drum and bass with heavy reese bass and complex rolling breaks
    seed0
    randomize_seedtrue
    duration_template{120|180|240}
    ollama_enabledtrue
    ollama_api_urlhttp://localhost:11434
    ollama_modelllama3:8b-instruct-q8_0
    orchestrator_modeOff
    temperature0.7
    top_k40
    top_p0.90
    min_p0.05
    keep_alive300
    llm_timeout120
    load_genre_fileNone
    load_vocal_fileNone
    load_lyrics_fileNone
    yaml_input
    custom_genre_template
    custom_vocal_template
    custom_lyrics_template
    custom_bpm
    custom_time_sigAuto
    custom_key_scaleAuto
    expand_custom_templatestrue
    generate_genretrue
    generate_vocalstrue
    generate_lyricstrue
    force_instrumentalfalse
    lora_trigger
    debug_mode0 - Silent
    enable_profilingfalse
    CategoryMD_Nodes/Prompt Generation

    Inputs (36)

    NameTypeDefaultDescription
    generation_modeCOMBOwildcardGENERATION 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_targetCOMBOAudio (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_modeBOOLEANtrueACE-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_modeBOOLEANfalseDESCRIPTIVE 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.
    conceptSTRINGDark neurofunk drum and bass with heavy reese bass and complex rolling breaksCONCEPT 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.
    seedINT00–9007199254740991RANDOM 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_seedBOOLEANtrueRANDOMIZE 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_templateSTRING{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_enabledoptBOOLEANtrueOLLAMA 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_urloptSTRINGhttp://localhost:11434Ollama API base URL (e.g. http://localhost:11434).
    ollama_modeloptCOMBOllama3:8b-instruct-q8_0Ollama model to use. List auto-refreshes in background.
    orchestrator_modeoptCOMBOOffORCHESTRATOR 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.
    temperatureoptFLOAT0.70–2TEMPERATURE • LLM creativity (0.2=focused, 1.0=chaotic, 1.4=unhinged).
    top_koptINT401–200TOP K • Token vocabulary limit for predictability.
    top_poptFLOAT0.900–1TOP P • Nucleus sampling cumulative cutoff.
    min_poptFLOAT0.050–1MIN P • Filters low probability tokens relative to best choice.
    keep_aliveoptINT3000–3600KEEP ALIVE (Seconds) • Model VRAM retention. 0 = unload immediately after call.
    llm_timeoutoptINT12030–600LLM 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_fileoptCOMBONoneLoad external genre wildcard .txt file.
    load_vocal_fileoptCOMBONoneLoad external vocal wildcard .txt file.
    load_lyrics_fileoptCOMBONoneLoad external lyrics wildcard .txt file.
    yaml_inputoptSTRINGYAML INPUT OVERRIDE • Override any parameter via YAML key-value string.
    custom_genre_templateoptSTRINGCustom genre/caption text. Wildcards {a|b} supported. Overrides generation.
    custom_vocal_templateoptSTRINGCustom vocal style text. Overrides generation.
    custom_lyrics_templateoptSTRINGCustom lyrics text. Overrides generation.
    custom_bpmoptSTRINGOverride BPM (integer or wildcard {174|172}).
    custom_time_sigoptCOMBOAutoOverride time signature (4 = 4/4, 3 = 3/4, etc).
    custom_key_scaleoptCOMBOAutoOverride key/scale (C Major, F# Minor, etc).
    expand_custom_templatesoptBOOLEANtrueExpand {wildcard} patterns in custom template inputs.
    generate_genreoptBOOLEANtrueEnable/disable genre/caption generation.
    generate_vocalsoptBOOLEANtrueEnable/disable vocal style generation.
    generate_lyricsoptBOOLEANtrueEnable/disable lyrics generation.
    force_instrumentaloptBOOLEANfalseForce instrumental: clears vocals, sets lyrics to [Instrumental].
    lora_triggeroptSTRINGLORA 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_modeoptCOMBO0 - SilentLogging verbosity level.
    enable_profilingoptBOOLEANfalseEnable detailed performance profiling output.

    Outputs (14)

    NameTypeDescription
    GENRE_TAGSSTRING
    VOCAL_TAGSSTRING
    LYRICSSTRING
    DURATION_STRINGSTRING
    DURATION_FLOATFLOAT
    BPMINT
    TIME_SIG_STRSTRING
    TIME_SIG_COMBO4,3,5,6,7
    KEY_SCALE_STRSTRING
    KEY_SCALE_COMBOC 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
    SEEDINT
    TEXT_PREVIEWIMAGE
    YAML_CONFIGSTRING
    INTERPRETED_PROMPTSTRING