Nodes/Multiline Text Choice Node for ComfyUI/ThepExcel_AiAngel_Multiline Text Choice
ComfyUI Node

ThepExcel_AiAngel_Multiline Text Choice

The Tiny A/B Tester Hiding in Your Graph

By ThepExcel·Created 2 years ago·Updated 2 years ago· 3
ThepExcel_AiAngel_Multiline Text Choice
    • choice_index
    • selected_text
    multiline_text
    selected_line_number1

    The name is honest and that's a relief: it's a text box with a line number attached. You paste several prompts - or several of anything, negative prompts, style suffixes, LoRA trigger phrases - into one multiline field, one per line, and the node hands back whichever line you ask for, plus its number. That's the whole node. No API, no model download, no hidden settings. The entire thing is two inputs and two outputs.

    Why you'd reach for it: A/B testing. ComfyUI is great at one graph, one prompt, and awkward at "I want to try four negative-prompt phrasings without rebuilding the graph." The obvious alternative is duplicating CLIP Text Encode nodes and threading a switch between them, which makes a clean workflow look like a plate of spaghetti. This node keeps every variant in a single box, and flipping between them is changing one integer. Bonus: all your prompt variants live in one visible place, which keeps the workflow JSON you share with the "workflow included" crowd actually readable.

    How it works

    Line-based, not content-based. The node splits on newlines and counts from 1 - so line 1 is the first line, not line 0, and blank lines count as lines. A box with a stray leading blank line means "line 1" returns an empty string. That's the single most common way to get a blank prompt out of this thing, and it's never fun to debug at 2am.

    The inputs and outputs that matter

    There are only two inputs, and both matter:

    • multiline_text (STRING, multiline): your pile of candidate lines, one per line. Empty by default.
    • selected_line_number (INT, 1 to 9,999,999): which line to pull. Default 1, minimum 1.

    Outputs:

    • selected_text (STRING): the line you picked. Wire this straight into a CLIP Text Encode prompt input.
    • choice_index (INT): echoes back the chosen line number. Useful when the selection comes from somewhere else and downstream nodes - a filename prefix, a LoRA stack, a text encoder - want to know which variant won.

    The second output is where the node stops being a toy. Feed selected_line_number from a slider, a random generator, or the index of an image in a batch, and the node becomes a programmatic prompt switcher. It's a poor man's Impact random-prompt node, except deterministic and dead simple: same number in, same prompt out, every run.

    Installing it

    The usual, and it's a light one - no requirements.txt, no model files, nothing heavy to babysit. Via ComfyUI Manager, search for Multiline Text Choice (the pack title is "Multiline Text Choice Node for ComfyUI"). Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ThepExcel/aiangelgallery-comfyui
    

    Then restart ComfyUI. To pull updates later: git pull https://github.com/ThepExcel/aiangelgallery-comfyui from inside the folder.

    Gotchas

    • 1-based, blanks count. Re-read your box top to bottom before assuming line 3 is what you think it is.
    • Out-of-range behavior isn't documented. Ask for line 8 of a 3-line box and you're in undefined territory - keep the number within your line count, or clamp it before it reaches the node.
    • It's a small, single-node pack (this page gets a handful of impressions a week), so don't expect active feature work. If Manager can't find it, the manual clone above always works.

    For a tool this simple, it punches above its weight if you're the kind of person who A/B tests prompts for real. If you just want a random prompt every run, grab Impact Pack instead. If you want your prompts, selected deliberately, this is the one.

    CategoryUtility

    Inputs (2)

    NameTypeDefaultDescription
    multiline_textSTRING
    selected_line_numberINT11–9999999

    Outputs (2)

    NameTypeDescription
    choice_indexINT
    selected_textSTRING