ComfyUI Node

GPM Prompt Combiner

Three strings in, one clean prompt out (and that's the whole trick)

By Mystic419·Created 6 months ago·Updated 25 days ago· 1
GPM Prompt Combiner
    • combined_prompt
    ◄person_prompt►
    ◄scene_prompt►
    ◄lora_tags►

    This is the least glamorous node in the pack and the one you'll wire up first. Three multiline string inputs, one string output, and the glue logic nobody wants to hand-maintain.

    What it does

    It joins person_prompt, scene_prompt and lora_tags in that order with ", ", skipping anything blank, collapsing runs of whitespace, normalizing comma spacing, and killing doubled commas. That's it. There is no model call, no style logic, no ban list handling, no sanitizer that strips (word:1.4) or role delimiters - the pack's own docs list "prompt-family style logic" and ban-list controls as not implemented here. Don't expect it to be smarter than join(", ") with tidier edges.

    Which is fine, because the value is structural, not clever. When a VLM writes your captions, you get text you didn't type: trailing periods, em-dashes, double spaces, sentence-style prose glued to tag fragments. Feeding that straight into a text encoder is how you end up with a prompt that reads sunlit meadow, , she is wearing a red dress. and wonder why the composition drifted. Rebuilding a clean comma-joined string before it hits CLIPTextEncode is the cheapest quality win in the whole workflow.

    Why split, why rejoin

    The person/scene split comes from the scanner's sidecar format, where every image carries a subject half and an environment half under one of three family prefixes. That's the same separation the prompt-engineering crowd keeps rediscovering: bind attributes to the right subject and keep the fixed part of the scene stable while you vary the rest. Keeping those two halves as separate fields is what lets you swap backgrounds without touching the subject description, or keep a scene and rotate poses through it.

    Rejoining them is the last step, and it should be the last step. If you're doing anything else with the halves - trimming them, filtering tags, weighting a word - do it upstream, then let the Combiner do the boring paste.

    One honest note about lora_tags: it's a text field. It does not load a LoRA. Whatever trigger words you want - the ones the LoRA was trained on, ideally lowercase and exactly as published - you type or wire in, and you still need a real LoraLoader in the graph. The Combiner just makes sure those tags land at the end of the prompt instead of in the middle of your subject description, which matters on tag-heavy models where earlier keywords get more attention.

    Inputs and outputs

    • person_prompt (multiline STRING) - wire from GPM Gallery Browser's person_prompt, or the browser's person_prompt_text if you're editing by hand.
    • scene_prompt (multiline STRING) - same, from scene_prompt.
    • lora_tags (multiline STRING) - LoRA trigger words, comma-separated, or blank.
    • Output: combined_prompt (STRING) - into a CLIPTextEncode's text, a prompt-preset node, or a text preview.

    Blank inputs are silently filtered, so leaving lora_tags empty costs you nothing and produces no stray comma. Order is fixed person → scene → lora; you can't reorder it without a different node.

    Install

    Same pack, same steps - ComfyUI Manager search Gallery Prompt Manager, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Mystic419/GPM-for-ComfyUI GPM
    cd GPM
    python -m pip install -r requirements.txt
    

    No models, no install.py needed for this node specifically (that script exists for the internal VLM scanner's llama-cpp-python handling), and the only requirement in requirements.txt is Pillow. Restart ComfyUI and look for it under category GPM.

    Where people get burned

    • Reading the output as if it were structured. Once combined, the person/scene boundary is a comma like any other. If you need to debug which half is wrong, look at the browser's two outputs, not the combined string.
    • Negative prompts. This joins positives. Feeding combined_prompt into a negative encode because it was the only spare STRING output nearby is a classic way to get a garbled-looking gens and a confused afternoon.
    • Expecting cleanup you didn't get. It normalizes whitespace and comma spacing. It does not strip sentences, weighted syntax, or chatty preamble. If your scanner preset is producing "Here is your enhanced prompt:", fix the preset - the Combiner will happily pass that through, first in line.
    CategoryGPM

    Inputs (3)

    NameTypeDefaultDescription
    person_promptSTRING—
    scene_promptSTRING—
    lora_tagsSTRING—

    Outputs (1)

    NameTypeDescription
    combined_promptSTRING—