Nodes/ComfyUI-PromptsO/💀Prompts Split
ComfyUI Node

💀Prompts Split

Chop one prompt into four without touching the keyboard again

By S4MUEL-404·Created 11 months ago·Updated 10 months ago· 3
💀Prompts Split
    • text1
    • text2
    • text3
    • text4
    text
    delimiterComma
    custom_delimiter|
    trim_partstrue

    💀Prompts Split takes one blob of text and cuts it into up to four separate strings, which is one of those things that sounds trivial until you need to feed the parts to different places. Think of a comma-separated booru-style prompt that's really several prompt ideas packed into one line: you want to route "1girl, detailed face, masterpiece" to one KSampler and "night street, neon, rain" to another. That's this node's whole job, and it does it with a dropdown instead of a regex you'll forget by next week.

    It's part of the ComfyUI-PromptsO pack's prompt-processing family (Combines, Replaces, and the rest share the 💀 PromptsO category in the node menu). The pack is a single-author affair from S4MUEL, installed via Manager under "PromptsO" or with a plain git clone - one install gets you all twelve nodes.

    How it works

    You give it text and pick a delimiter. The options are Comma, Semicolon, Space, Newline, Forward Slash, or Custom - and when you pick Custom, the custom_delimiter field (default |) is what it splits on. The node does a plain string split on that character, trims each part if trim_parts is on (it is, by default), drops the empty parts that trimming produces, and then pads the output back up to four slots with empty strings so you always get text1 through text4 wired up.

    That fixed four-output contract is the thing to internalize. You can't ask for five parts, and if your input only yields two, text3 and text4 come back as "". Don't panic when you see empty sockets - that's the design. Wire what you use and ignore the rest. And a heads-up if you've been bitten before: a recent update (v1.1.1) specifically fixed the Newline delimiter, which used to fail silently. If your line-based splitting didn't work on an older install, update the pack.

    The inputs that matter

    • text - the string to split (multiline, so paste away).
    • delimiter - the split rule. Comma is the default and covers most tag-prompt use.
    • custom_delimiter - only read when delimiter is Custom; ignored otherwise.
    • trim_parts - strips whitespace off each part and filters empties. Leave it on; you'll almost never want stray spaces at the start of a prompt fragment.

    Outputs: text1, text2, text3, text4, all STRING. Each wires into anything that takes a string - a CLIP Text Encode, another combine node, a sampler prompt. There's no rule that the parts must be prompts, either; it's just text splitting, so it works on CSV-style data, batch labels, whatever.

    Install

    cd ComfyUI/custom_nodes/
    git clone https://github.com/S4MUEL-404/ComfyUI-PromptsO.git
    cd ComfyUI-PromptsO
    pip install -r requirements.txt
    

    Then restart ComfyUI. ComfyUI Manager users: search "PromptsO" and let it handle dependencies. The requirements file pulls a fairly heavy set (torch, transformers, the Janus repo) because of the pack's local-vision node - you don't need most of that for Split, but pip installs it all anyway.

    Common issues

    • Outputs come back empty - usually means the delimiter you picked doesn't actually appear in the text, or trim turned everything into empty strings. Check the console log, which tells you how many parts it found.
    • Newline split does nothing - you're on an old version. Pull the pack update (v1.1.1 fixed it).
    • Only getting one non-empty part - that's the pad-to-four behavior, not a bug.

    Honestly, this node shines in multi-sampler workflows where you're testing prompt fragments side by side. If you only ever render one prompt at a time, it's a nice-to-have - but the day you need it, you'll be glad it's a dropdown and not a Python expression node.

    Category💀PromptsO

    Inputs (4)

    NameTypeDefaultDescription
    textSTRINGText to split into multiple parts
    delimiterCOMBOCommaDelimiter to use for splitting text
    custom_delimiteroptSTRING|Custom delimiter string (used when delimiter is 'Custom')
    trim_partsoptBOOLEANtrueRemove whitespace from each split part

    Outputs (4)

    NameTypeDescription
    text1STRING
    text2STRING
    text3STRING
    text4STRING