Nodes/IAMCCS-nodes/Multiline Prompt Splitter (8 outputs)
ComfyUI Node

Multiline Prompt Splitter (8 outputs)

One multiline prompt, eight clean outputs, zero copy-paste

By IAMCCS·Created 11 months ago·Updated 7 days ago· 113
Multiline Prompt Splitter (8 outputs)
    • prompt_1
    • prompt_2
    • prompt_3
    • prompt_4
    • prompt_5
    • prompt_6
    • prompt_7
    • prompt_8
    • count
    text
    separator\n
    strip_emptytrue
    fill_modeempty

    If you've ever batch-generated variants, you know the drill: keep a text file with a prompt per line, and every time you change one line you carefully re-paste it into the right node. IAMCCS_MultilinePromptSplitter8 ends that. Drop a multiline block of prompts into one box, and it hands you prompt_1 through prompt_8 plus a count - each line routed to its own output, ready to feed separate text encoders or generation branches.

    It's a tiny utility from IAMCCS-nodes, and the pack's own README frames it as part of the dataset-creation ecosystem: when one dataset slot needs to drive several prompt variants, this is the node that turns a pasted block into explicit per-line routing without duplicating sampling chains by hand.

    How it works

    The node splits text on a separator (default \n), with strip_empty (true) quietly dropping blank lines so a stray double-return doesn't produce an empty prompt. Then the outputs are filled in order. The interesting part is fill_mode, which decides what happens when you have fewer lines than outputs (or you're looping over them):

    • empty - unused outputs are empty strings. The simplest and often the most predictable for downstream nodes.
    • repeat_last - the last line is repeated into the remaining outputs. Handy when one prompt is "the default" for a slot.
    • wrap - lines cycle: with two prompts and eight outputs, you get 1,2,1,2,1,2,1,2. This is the mode for alternating variants across a loop.

    Outputs 1–8 are fixed; count tells you how many lines actually landed, which is your loop counter when you're iterating over variants.

    Inputs and outputs

    • text (STRING) - the multiline block.
    • separator (STRING, \n), strip_empty (BOOLEAN, true), fill_mode (enum: empty/repeat_last/wrap).

    Outputs: prompt_1prompt_8 (STRING) + count (INT).

    How to install

    Part of IAMCCS-nodes. ComfyUI Manager search "IAMCCS", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/IAMCCS/IAMCCS-nodes.git
    

    Restart. No dependencies beyond the pack itself (ComfyUI ≥ 0.3.0, Python ≥ 3.12). No model downloads.

    Gotchas

    Two things to watch. First, the separator is literal - if you feed Windows line endings (\r\n) and only split on \n, you'll get stray \r characters in your prompts, and strip_empty won't catch them. Paste from a text editor set to LF, or it'll bite. Second, wrap is fun but surprising: if a downstream node assumes prompt_5 is "the fifth distinct prompt," it isn't - it's a cycled repeat. For strict variant handling, empty or repeat_last are the safe modes. And note this splits text only - it doesn't renumber, weigh, or parse anything else. If your multiline block is actually a prompt with newlines inside a single prompt, this node is the wrong tool; it's for one-prompt-per-line.

    CategoryIAMCCS/Prompt

    Inputs (4)

    NameTypeDefaultDescription
    textSTRING
    separatoroptSTRING\n
    strip_emptyoptBOOLEANtrue
    fill_modeoptCOMBOempty3 options: empty, repeat_last, wrap

    Outputs (9)

    NameTypeDescription
    prompt_1STRING
    prompt_2STRING
    prompt_3STRING
    prompt_4STRING
    prompt_5STRING
    prompt_6STRING
    prompt_7STRING
    prompt_8STRING
    countINT