ComfyUI Node Runs on cloud

textCycleLine

TextCycleLine

By TinyTerraΒ·Created 3 years agoΒ·Updated 3 months agoΒ· 604
textCycleLine
    • STRING
    β—„textβ–Ί
    β—„index0β–Ί
    β—„index_controlβ–Ύβ–Ί

    textCycleLine (ttN textCycleLine) is a small text node with a deceptively useful job: you paste a list of prompts into a multiline box - one per line - and it outputs a single line, chosen by an index. Keep a batch of prompts in one node, swap the index, and your sampler gets a different prompt each run. It's the manual way to cycle through prompt variations without building an elaborate batch system.

    Inputs and how it behaves

    • text - the multiline STRING box. Lines are split on newlines; blank lines count as lines, which is the thing that'll trip you up first.
    • index - an INT, default 0. The node returns lines[index]. If the index is beyond the last line, it clamps to the last line rather than erroring.
    • index_control - a dropdown offering increment, decrement, randomize, and fixed.

    Output: a single STRING - the selected line.

    The honest gotcha

    Here's the part you need to know before you build a workflow around it: in the current shipped code, index_control is present on the node but the execution function simply returns the line at index. Feed it an index from a seed node, a counter, or anything that changes per run and the node genuinely cycles through your list; leave the index alone and you'll get the same line every time. The dropdown reads like it should auto-advance the index for you - it currently doesn't, so drive the index from elsewhere if you want real cycling. Test your workflow once before you trust it in a batch run.

    That's the mechanism, and it's deliberately plain: split text on newlines, clamp, index. No wildcard parsing, no dynamic-prompt syntax - despite the dynamicPrompts: True hint on the field in the source, this node won't expand {a|b|c} for you. If you need that, Impact Pack's wildcard machinery or a dedicated dynamic-prompt node is the right tool.

    Install

    One-time pack install - ComfyUI Manager β†’ search ComfyUI_tinyterraNodes, or git clone https://github.com/TinyTerra/ComfyUI_tinyterraNodes.git into ComfyUI/custom_nodes, then restart. No dependencies, no downloads.

    Where it fits: handy for quick A/B over a few prompt variants, especially in a pipe workflow where you want a different prompt per generation but don't want a wall of text nodes. For serious batch work you'll graduate to a real XY-plot or a proper prompt-batch system, but for "cycle through these five prompts" this is the leanest option in the pack.

    Category🌏 tinyterra/text

    Inputs (3)

    NameTypeDefaultDescription
    textSTRINGβ€”
    indexINT00–18446744073709550000β€”
    index_controlCOMBO4 options: increment, decrement, randomize, fixed

    Outputs (1)

    NameTypeDescription
    STRINGSTRINGβ€”