Nodes/ComfyUI-PromptLoop/πŸ”„ Prompt Loop (Text)
ComfyUI Node

πŸ”„ Prompt Loop (Text)

Batch prompts straight from a multiline box

By max-dingsdaΒ·Created 10 months agoΒ·Updated 6 months agoΒ· 0
πŸ”„ Prompt Loop (Text)
    • prompt
    β—„textprompt 1 prompt 2 prompt 3β–Ί
    β—„start_index0β–Ί
    β—„max_prompts0β–Ί

    Sometimes you don't want to manage a file. You want to type three prompts, hit Queue, and get three images - without creating prompts.txt, without editing anything on disk, without restarting to refresh a dropdown. PromptLoopFromText is the sibling node in the max-dingsda/ComfyUI-PromptLoop pack that does the same batch trick as the file version, except the source is a plain multiline text widget on the node itself.

    It's the faster-iteration member of the family. The file node is for production - a prompt list you'll re-render all week. This one is for "let me just try these variations right now" and then edit the box and run again. Because the prompts live in the node, there's no encoding headache, no stale file list, no restart required. Edit, Queue, done.

    How it works

    Exactly like its file sibling, with a different source. The node splits the multiline text on line breaks, strips each line, drops the empty ones, and returns the rest as a list. ComfyUI sees a list-typed output and expands: everything downstream - CLIP encode, sampler, VAE decode - runs once per line, all from one queue entry.

    One detail the README and most users miss: the node's default text is prompt 1\nprompt 2\nprompt 3. That's a live example, not a placeholder. If you forget to replace it, one queue click renders three images with those literal "prompt 1" strings. Cute first time, confusing the second.

    Inputs and output

    • text (required, multiline) - one prompt per line. Blank lines are skipped, so don't pad with empty rows.
    • start_index - skip the first N prompts. Default 0.
    • max_prompts - 0 = all; otherwise cap how many lines get used.

    The output is prompt, a list of strings, wired into a CLIP Text Encode positive input. Pair it with the pack's save node and each output PNG carries the exact line that made it, so you can tell at a glance which variation won.

    Installation

    Same as the rest of the pack - there's nothing heavy here. The requirements.txt is empty and there are no model files, so install is either ComfyUI Manager β†’ search "ComfyUI-PromptLoop", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/max-dingsda/ComfyUI-PromptLoop
    

    Then restart ComfyUI. Nodes appear under the promptloop category.

    Where people get burned

    • Default-prompts trap. See above: the box ships filled with three example lines, so a fresh node silently generates three images per queue job. Replace the text before your first run.
    • It's per-line, not per-batch. This is a "one prompt per line" node, not a wildcard engine. If you want __scenes__-style randomized variation or hundreds of combinatorial prompts, this isn't the tool - that's Dynamic Prompts territory. This node renders exactly the lines you typed, in order.
    • The whole graph repeats per line. The expansion runs everything downstream once per prompt. If there's a slow upscaler or refiner after the sampler, it runs once per image too. "Three prompts" can mean "three full hires passes." That's by design, but it surprises people the first time the batch takes six times longer than the single image did.
    • The prompts ride along. Since they live in the workflow, they're embedded in every saved PNG. Don't type something you'd regret having in a shared file - metadata is disclosure by default (and that's covered more in the pack's save node).

    Honestly? For quick A/B/C variation testing, this node is the one I'd reach for out of the pack - no file juggling, instant edits. Once the list gets long enough to manage in a text editor, switch to the file version.

    Categorypromptloop

    Inputs (3)

    NameTypeDefaultDescription
    textSTRINGprompt 1 prompt 2 prompt 3β€”
    start_indexoptINT00–10000β€”
    max_promptsoptINT00–10000β€”

    Outputs (1)

    NameTypeDescription
    promptSTRINGβ€”