Nodes/🐰 MaraScott Nodes/🐰 Multiline to List - v1 /t
ComfyUI Node

🐰 Multiline to List - v1 /t

One multiline box in, a list of prompts out β€” the batch-feeder utility

By MaraScottΒ·Created 3 years agoΒ·Updated 10 months agoΒ· 179
🐰 Multiline to List - v1 /t
    • list
    • text (original)
    • lines count
    β—„textβ€”β–Ί

    Running the same image through five different prompts is the most basic batch workflow in ComfyUI, and the clean way to do it is a list of strings feeding your KSampler's positive prompt. That's the entire job of Multiline to List: you paste five prompts into one multiline box, one per line, and it hands you a proper STRING list you can drive a batch with.

    If you've ever hand-wired five separate prompt nodes to a five-position batch, this kills that pain. It's a small, boring node, and that's the compliment.

    How it works

    It splits your text on newlines, strips each line, and drops empty lines. No fancy parsing, no CSV handling - just "one line = one entry." Three outputs:

    • list - a STRING list (OUTPUT_IS_LIST is true), each element a cleaned line. This is the one you wire into anything that takes a list of prompts and processes per batch index.
    • text (original) - the raw input, passed through untouched.
    • lines count - an INT, the number of non-empty lines you fed it. Handy if you want to assert "I have exactly N prompts here" or drive a loop count.

    The node sits in the 🐰 MaraScott/Prompt category, right next to the pack's Text Concatenation node, and it's the natural partner to the For Loop set: loop over the list, run one prompt per iteration, collect results.

    Using it

    The honest workflow: write your prompts one per line, wire list into a batch-processing setup or a For Loop Open's carried value, and let each iteration pull list[i]. Or just use it to eyeball how many prompts you've got via lines count. There's a mildly annoying ComfyUI quirk to remember: because the output is a list type, some downstream nodes that expect a single STRING will refuse it - check the target node accepts list input, or consume it via a batch node.

    Installing it

    Ships in the MaraScott pack: ComfyUI Manager β†’ search "MaraScott" β†’ Install β†’ restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MaraScott/ComfyUI_MaraScott_Nodes
    

    Then restart. Yes, it's a text-splitting node living in a pack that pins transformers==4.37.2 and installs opencv-python, numba and blend_modes. If you're grabbing the pack for AnyBus or the loops anyway, this is a freebie; if this is the only node you wanted, the install is more than the node deserves.

    Common issues

    Almost nothing to break. The one gotcha is blank lines: they're stripped, so "a, blank, b" gives you a list of two, and lines count reflects the stripped count - if your line count seems short, blank lines are why. Also mind that trailing spaces are stripped per line, which is usually what you want but will change anything where you intentionally preserved whitespace. And because it's a list output, some prompt widgets won't accept it directly - that's a ComfyUI type-system thing, not a bug in the node.

    Category🐰 MaraScott/Prompt

    Inputs (1)

    NameTypeDefaultDescription
    textSTRINGβ€”

    Outputs (3)

    NameTypeDescription
    listSTRINGβ€”
    text (original)STRINGβ€”
    lines countINTβ€”