Nodes/ComfyUI ARG Toolkit/String Append Looper
ComfyUI Node

String Append Looper

Repeat a string, with a built-in surprise

By AzelusLightvale·Created 12 months ago·Updated 5 days ago· 1
String Append Looper
    • looped_text
    textHello World!
    loops3

    Sometimes a puzzle needs the same string repeated - a padding pattern, a filler block, a "copy this line N times" instruction. That's the whole job of StringLooper: take a string, repeat it, hand back the concatenation. It's the simplest node in the pack and it's in the "Utilities/Padding" category, which tells you its intended use - padding messages to a fixed length before encryption or steganography, where a repeated filler string is the classic approach.

    And then there's the surprise in the implementation.

    How it works

    Two inputs:

    • text - the string to repeat.
    • loops - described in the tooltip as "the number of times to repeat the string given." Default 3, minimum 1.

    Output: looped_text - text repeated. And here's the thing: the code does text * (loops + 1), so loops=3 produces four copies, not three. The tooltip and the behavior disagree by one. It's a small off-by-one baked into the node, and it's the kind of quirk that only shows up when you compare your output to what you expected.

    The input that matters

    loops, obviously - and now you know to subtract one from whatever you actually want, or to treat the value as "copies minus one." If you want exactly three copies, set loops=2. The text field is just a string input; wire it from anywhere a string comes from.

    Where it fits

    Honestly, this node is about as deep as padding gets: generate a repeated filler string, concatenate it with your real message (the pack's string concatenation or a switch node can do the join), and feed the result to an encoder. For padding-before-encryption workflows it's genuinely handy - and if you ever need a string repeated exactly N times, remember the off-by-one.

    Installing it

    Part of ComfyUI ARG Toolkit - ComfyUI Manager (search "ComfyUI ARG Toolkit") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/AzelusLightvale/ComfyUI-ARG-Toolkit
    

    Restart ComfyUI. No model files, no heavy dependencies.

    Common issues

    • One more copy than you asked for - the off-by-one. Adjust loops accordingly; it's not a bug you can fix from the UI.
    • Very long outputs - loops has no upper bound, so a long text with a big loops value can produce a huge string that chokes downstream nodes. It's just string multiplication in Python, so it'll happily make a 10MB string if you let it.
    • If you find yourself using this node constantly, you might be overcomplicating your workflow - but for the occasional padding job, it's fine.
    CategoryARG Toolkit/Utilities/Padding

    Inputs (2)

    NameTypeDefaultDescription
    textSTRINGHello World!
    loopsINT3The number of times to repeat the string given

    Outputs (1)

    NameTypeDescription
    looped_textSTRING