Nodes/ComfyUI-Meld/Meld Prompt Constructor
ComfyUI Node

Meld Prompt Constructor

A wildcard prompt loader that sorts the negatives for you

By HappyOnigiri·Created 7 months ago·Updated 5 months ago· 5
Meld Prompt Constructor
    • positive_prompt
    • negative_prompt
    directory./my_prompts
    file_pattern*.txt
    seed0
    selection_methodrandom
    use_breaktrue

    If you've ever run a batch of images and wanted "a random hairstyle from this list" or "one of these three outfits, weighted," you've wanted a wildcard loader. Meld Prompt Constructor is that - it scans a folder of text files, pulls a random (or sequential) line from each, expands dynamic syntax like {A|B|C}, and - the nice bit - automatically moves anything starting with - into a separate negative prompt output.

    It's one of ComfyUI-Meld's text utilities, no Image Manager required. Wire its outputs into a CLIP Text Encode and you're off.

    How it works

    Point directory at a folder (it searches recursively), set file_pattern (default *.txt, so character_*.txt works), and the node reads the files, ignoring any starting with _. From each file it picks one valid line - comments excluded - according to selection_method (random, or sequential based on seed). Then the real work starts:

    • Dynamic syntax: {A|B|C} picks one option; {0.1::rare|0.9::common} picks with weights (unweighted items count as 1.0).
    • Comments: //, #, and /* */ are stripped, so you can keep notes in your prompt files.
    • Auto negative split: any element starting with - is moved to the negative prompt - -low quality becomes a negative, and -(worst quality, bad anatomy) moves the whole group over.
    • BREAK: with use_break on (default), prompts from different files are joined with BREAK so CLIP treats them as separate blocks instead of one soup.

    The inputs that matter

    • directory - where your .txt prompt files live.
    • seed - controls both the random line picks and the {A|B} choices, so you can reproduce or vary.
    • selection_method - random for variety, sequential for a deterministic tour through your prompts.
    • use_break - on by default.

    Outputs are just two: positive_prompt and negative_prompt, both plain strings.

    Where people get burned

    The BREAK keyword is the one real trap. BREAK is meaningful against the old 77-token chunking of SD 1.5 and SDXL - it forces a hard break between prompt blocks. On modern guidance-distilled, LLM-encoded models like Flux, there's no 77-token boundary left, and BREAK is silently meaningless. So if you run this into a Flux workflow, flip use_break to false and let files join with commas, or the keyword just rides along doing nothing.

    Also remember the auto-negative split depends on the - prefix, so design your prompt files with that convention in mind - that's the feature that makes this loader nicer than a plain wildcard picker.

    Installing it

    Same pack, same install as the rest of Meld:

    • ComfyUI Manager → search "Meld" → install, or
    • comfy node install HappyOnigiri/ComfyUI-Meld, or
    • cd ComfyUI/custom_nodes && git clone https://github.com/HappyOnigiri/ComfyUI-Meld.git && cd ComfyUI-Meld && pip install -r requirements.txt then restart.

    No models to download. Set up a my_prompts folder, drop a few files in, and you've got a poor man's dynamic prompt engine with clean positive/negative separation built in.

    CategoryMeld/Text

    Inputs (5)

    NameTypeDefaultDescription
    directorySTRING./my_prompts
    file_patternSTRING*.txt
    seedINT00–18446744073709550000
    selection_methodCOMBOrandom2 options: random, sequential
    use_breakBOOLEANtrue

    Outputs (2)

    NameTypeDescription
    positive_promptSTRING
    negative_promptSTRING