ComfyUI Node

String Iterator

Paste a list of prompts, get one generation per line

By wakaura-asaho·Created 6 months ago·Updated 6 days ago· 1
String Iterator
    • STRING
    items

    The classic ComfyUI chore: you want to compare how five different prompts render the same scene, so you change the text, queue, change it, queue again - a small ritual you repeat until you lose the thread of which run used which prompt. StringIterator ends that. Type one prompt per line, and ComfyUI fans the list out, generating once per line, automatically. It's the text version of the pack's Int/Float iterators, and for prompt comparison it's arguably the most immediately useful of the three.

    The README's example is exactly this: connect the StringIterator to your prompt fields and compare the effect of different prompts on the result. Wire the STRING output into a CLIP Text Encode's text input, list your variants, hit queue, walk away. Each downstream run gets its own prompt, and you can tell them apart because you know the order you typed them in.

    How it works

    One input, one output:

    • items - a multiline text field; the tooltip says it all: "One string item per line."
    • STRING - the output, a list of those lines.

    At execution the node splits the text on line breaks, drops any blank lines, and emits the rest as a list. Because it's a list output, ComfyUI unpacks it and runs everything downstream once per line - same fan-out mechanism as the Int and Float iterators in this pack, just with strings. There's no delimiter parsing or cleverness here, which is the right call: lines are unambiguous, and it keeps the node trivial to reason about.

    The inputs that matter

    • items - the whole node. Type your variants, one per line, done.

    Installing it

    No models, no heavy dependencies - this pack only needs a recent ComfyUI frontend. ComfyUI Manager → "Install via Git URL" → paste https://github.com/wakaura-asaho/comfyui-dynamic-selector → restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/wakaura-asaho/comfyui-dynamic-selector
    # restart ComfyUI
    

    Gotchas

    Watch out for stray blank lines - extra newlines between prompts are dropped, which is friendly, but a prompt that's all whitespace will silently vanish, so don't rely on blank lines as separators for two-line prompts. And a genuinely empty items field is rejected with a "must not be empty" error rather than quietly doing nothing, which is the good kind of strictness. If you open the pack's example workflow and it complains about a missing node, that's the newer native Text Format node (ComfyUI 0.24.1+) it depends on, not this pack - update ComfyUI. This whole pack is young, experimental, and built for the new V3 node API (frontend >= 1.37.11), so keep ComfyUI current and test before you trust it in a workflow you'll run a hundred times.

    CategoryWakaura

    Inputs (1)

    NameTypeDefaultDescription
    itemsSTRINGOne string item per line.

    Outputs (1)

    NameTypeDescription
    STRINGSTRING