Nodes/RF Nodes/Options (STRING)
ComfyUI Node

Options (STRING)

The poor man's batch-prompts node

By foxtrot-roger·Created 3 years ago·Updated 2 years ago· 2
Options (STRING)
    • lines
    text

    The display name is "Options (STRING)", and that's the whole design intent in two words. Type a list of alternatives - one per line - and the node hands you back a list you can feed into anything that iterates. It's the simplest way in this pack to turn "I have a few ideas" into "I have a batch."

    This is a genuinely useful pattern in ComfyUI, where one of the highest-leverage things you can do is generate variations without babysitting the graph. The KB's community threads on prompt variation lean on exactly this mechanic: put a set of alternatives in, run the batch, keep the good ones. This node is the two-minute version of that.

    How it works

    One input, text (a multiline STRING, default empty), and one output, lines - a STRING list. The mechanism is Python's splitlines(), which is smart about line endings: it splits on \n, and handles Windows \r\n too. So copy-pasting from a text editor or a spreadsheet just works.

    Two behaviors worth knowing:

    • Empty input produces an empty list, not a list with one empty string. If nothing's typed, nothing comes out.
    • Blank lines survive. "a\n\nb" splits into ["a", "", "b"]. Trailing blank lines turn into empty strings in your list, and downstream nodes may or may not be okay with that - worth trimming before you rely on it.

    What to wire it into

    The lines output is a standard STRING list, so it plugs into anything that accepts a list of strings: a batch-prompts style flow, a node that picks one option by index, or a logging chain. The classic move is to pair it with a random picker - your "options" box becomes the one place you edit to swap in a new set of prompts, instead of rewriting nodes mid-graph.

    Installing it

    Part of RF Nodes (foxtrot-roger/comfyui-rf-nodes). ComfyUI Manager, search "RF Nodes", install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/foxtrot-roger/comfyui-rf-nodes
    

    No dependencies, no model downloads - it's a stdlib splitlines() call in a tuxedo.

    Gotchas

    • Naming confusion: you add the node as "RF_SplitLines", but it displays as "Options (STRING)". Don't search for "split lines" and assume it's missing - it's right there in the RF menu.
    • Trailing blank lines become empty strings in your list. Paste carefully, or expect a stray empty option.
    • If you're feeding it into a node that expects a single STRING rather than a list, this won't wire - it outputs a list by design.

    For a node this small, "it just splits text" is the whole story - and that's exactly why it's worth having in your back pocket for batch workflows.

    CategoryRF

    Inputs (1)

    NameTypeDefaultDescription
    textSTRING

    Outputs (1)

    NameTypeDescription
    linesSTRING