Nodes/ComfyUI-JakeUpgrade/Prompt Combine JK๐Ÿ‰
ComfyUI Node

Prompt Combine JK๐Ÿ‰

Merge two prompts without the comma-and-spacing mess

By jakechaiยทCreated 2 years agoยทUpdated 3 months agoยท 146
Prompt Combine JK๐Ÿ‰
    • Prompt
    โ—„prompt_1โ–บ
    โ—„prompt_2โ–บ
    โ—„preserve_formattrueโ–บ
    โ—„remove_prompt_emphasistrueโ–บ

    Prompt Combine_JK takes two strings - prompt_1 and prompt_2 - and merges them into one clean Prompt output. That sounds trivial until you've built a prompt from parts: a base subject, an environment, a style fragment, and you realize naive concatenation gives you "portrait of a woman, , cinematic lighting" or "portrait of a womancinematic lighting". This node handles the joining and, optionally, strips the prompt-markup cruft that accumulates when prompts are assembled programmatically.

    The two switches that do the real work

    • preserve_format (default on) - keeps line breaks and the original formatting, joining with newlines instead of folding everything onto one line. Off, and it cleans each prompt and joins them with smart punctuation: a . if the first prompt doesn't end in punctuation, a space if it does. That's the "no double comma / no missing space" fix in one toggle.
    • remove_prompt_emphasis (default on) - strips emphasis markup from the inputs: (word:1.5) becomes word, and [A:B:0.5] becomes A-B. When your second prompt comes from a randomizer or a tag generator, those weight markers can leak into the final string and do nothing useful - this sweeps them out.

    The mechanism is straightforward under the hood: each input is cleaned (collapse whitespace, trim), optionally de-emphasized, then joined per the preserve_format choice. Both inputs are multiline strings, so you can paste whole prompt blocks in.

    When you'd reach for it

    JakeUpgrade's own prompt pipeline is built around it - Random Prompter outputs fragments, they land in a combine, and the result feeds a CLIP Text Encode. The same pattern works for your own graphs: build a subject prompt and a "wildcard" style prompt separately, then merge. If you're doing prompt-to-prompt variations, keeping the base and the modifier in separate strings and combining at the end means you can swap either half without touching the other.

    Installing it

    Part of ComfyUI-JakeUpgrade:

    cd ComfyUI/custom_nodes
    git clone https://github.com/jakechai/ComfyUI-JakeUpgrade
    cd ComfyUI-JakeUpgrade
    # Windows standalone: install.bat
    # or: python_embeded\python.exe -s -m pip install -r requirements.txt
    pip install -r requirements.txt   # non-Windows
    

    Or ComfyUI Manager, search "JakeUpgrade", install, restart. No model files involved.

    Gotchas

    • remove_prompt_emphasis is destructive. If you want the (word:1.5) weights in your final prompt, turn it off - it strips them without asking. Only leave it on when the inputs are known to be clean or machine-generated.
    • preserve_format on keeps line breaks, which some text encoders handle fine and others treat as part of the prompt. If your merged prompt looks odd in the output, try toggling it off.
    • Manager's JakeUpgrade / IPAdapter_plus conflict warning is a false positive from the pack's replacement/ folder.
    • ComfyUI-MultiGPU causes CUDA errors with recent ComfyUI - disable it per the README.
    Category๐Ÿ‰ JK/๐Ÿ Prompt

    Inputs (4)

    NameTypeDefaultDescription
    prompt_1STRINGโ€”
    prompt_2STRINGโ€”
    preserve_formatBOOLEANtruePreserve original format of prompts (including line breaks)
    remove_prompt_emphasisBOOLEANtrueRemove emphasis symbols and weight markers from custom_subject (e.g., (word:1.5) -> word, [A:B:0.5] -> A-B)

    Outputs (1)

    NameTypeDescription
    PromptSTRINGโ€”