Nodes/ComfyUI-TinyBee/Prompt Splitter
ComfyUI Node

Prompt Splitter

One prompt box in, five prompt/negative pairs out

By TinyBeeman·Created about a year ago·Updated about a month ago· 1
Prompt Splitter
    • prompt1
    • neg1
    • prompt2
    • neg2
    • prompt3
    • neg3
    • prompt4
    • neg4
    • prompt5
    • neg5
    prefix_all
    prompts
    postfix_all
    search_string
    replace_string

    Prompt Splitter takes one big multiline text box and turns it into up to five prompt/negative pairs - prompt1/neg1 through prompt5/neg5 - so you can run variations from a single block of text instead of stacking five separate prompt nodes.

    Why you'd reach for it

    If you batch prompts - testing five different styles, running a queue of variations, stepping through ideas - you know the pain of duplicating CLIP Text Encode nodes over and over. This node collapses that into one editor: type each prompt on its own line, mark negatives with a neg: prefix, and get clean separate outputs to wire into a KSampler or a switch that cycles through them. It's the "prompt farm" pattern in a single node.

    How it works

    It splits the input on newlines, strips whitespace, and skips blank lines. Non-neg: lines fill prompt1 through prompt5 in order. Lines starting with neg: (case-insensitive) attach a negative to the current prompt part - if you list multiple neg: lines after one prompt, they get comma-joined into a single negative. A neg: before any prompt exists just logs a warning and is skipped.

    Then three post-processing steps apply to all parts:

    • prefix_all is prepended to every prompt (with a space).
    • postfix_all is appended to every prompt.
    • search_string/replace_string do a text replacement across all prompts and negatives, useful for swapping a token across the whole batch.

    Empty slots come out as "", never None, so downstream nodes don't choke.

    The inputs that matter

    • prompts - the multiline editor. One prompt per line; neg: lines attach negatives.
    • prefix_all / postfix_all - text added to every prompt part. Leave empty to skip.
    • search_string / replace_string - batch find-and-replace over all outputs.

    Outputs: prompt1–prompt5 and neg1–neg5. That's the full set - this version caps at five pairs, hard.

    Installing it

    TinyBee pack: ComfyUI Manager → Install Custom Nodes → search "ComfyUI-TinyBee", install, restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/TinyBeeman/ComfyUI-TinyBee
    

    It's under 🐝TinyBee/Util. No dependencies beyond the stdlib.

    Common issues

    The five-pair cap is the thing people run into first - a sixth non-neg: line is silently dropped, so if a prompt "disappears" you've hit the limit (the Prompt Splitter (Dynamic) variant goes to 32). And note the neg: prefix is checked against the lowercased line, so NEG: works too, but negative: does not - the syntax is specific. Finally, remember prefix/postfix apply to every part, so if you want different prefixes per part you'll need a different approach.

    Category🐝TinyBee/Util

    Inputs (5)

    NameTypeDefaultDescription
    prefix_allSTRING
    promptsSTRING
    postfix_allSTRING
    search_stringSTRING
    replace_stringSTRING

    Outputs (10)

    NameTypeDescription
    prompt1STRING
    neg1STRING
    prompt2STRING
    neg2STRING
    prompt3STRING
    neg3STRING
    prompt4STRING
    neg4STRING
    prompt5STRING
    neg5STRING