Nodes/RES4LYF-tester-loop/Single Int Range Loop
ComfyUI Node

Single Int Range Loop

The int range node for the boring, reliable sweep

By KY-2000·Created about a year ago·Updated about a year ago· 9
Single Int Range Loop
    • value
    • current_index
    • total_combinations
    • current_combination
    mode
    start0
    end5
    step1
    seed0
    resetfalse

    SingleIntLoop is the least glamorous node in the RES4LYF-tester-loop pack and, honestly, one of the most useful. The sampler and scheduler loops get the attention because they're RES4LYF-specific; this one just steps an integer through a range, one value per queue run, and hands it to whatever you connect it to. That turns out to be exactly what you want when you're dialing in steps, CFG, or any other integer knob without re-typing it between runs.

    If you've been around ComfyUI a while, you know the pattern it replaces: the "seed farming" workflow where you cheaply explore a prompt, then rerun the keeper seed across a range of settings. This node is the plumbing for that second half. Set start: 20, end: 35, step: 5, wire value into your sampler's steps, queue four times, done. No renaming, no manual edits.

    How it works

    On each execution the node advances a counter and picks the next value from an inclusive range - start to end, counting by step, and it handles descending ranges fine (start: 35, end: 20 walks down). Selection follows mode: sequential walks in order, random draws a seeded random value, ping_pong bounces through the list. seed makes random reproducible; reset (true) restarts the counter.

    Outputs: value (the INT you wire onward), plus current_index, total_combinations, and a current_combination string for labeling or filenames.

    The inputs that matter

    • start / end / step - the range. Step must be ≥ 1.
    • mode - sequential / random / ping_pong.
    • seed - only affects random mode.
    • reset - back to the first value.

    Install

    It's part of KY-2000/RES4LYF-tester-loop, which you install in custom_nodes/:

    cd ComfyUI/custom_nodes/
    git clone https://github.com/KY-2000/RES4LYF-tester-loop.git
    

    Restart ComfyUI. No dependencies, no models. (The pack is built for RES4LYF but this node doesn't need RES4LYF installed to function - it's a plain range loop.)

    Where people get burned

    The counter is shared at the class level, so two SingleIntLoop nodes in one workflow advance in lockstep - if you need two independent sweeps, use different nodes or accept the coupling. And a quiet trap: because each run picks the next value, re-queuing the same batch continues where you left off. That's usually the point, but if you keep getting the same value, it means you're re-running without a fresh execution - hit reset to start over.

    CategoryRES4LYF/Loop

    Inputs (6)

    NameTypeDefaultDescription
    modeCOMBO3 options: sequential, random, ping_pong
    startINT0-9223372036854776000–18446744073709550000
    endINT5-9223372036854776000–18446744073709550000
    stepINT11–2147483647
    seedINT00–18446744073709550000
    resetBOOLEANfalse

    Outputs (4)

    NameTypeDescription
    valueINT
    current_indexINT
    total_combinationsINT
    current_combinationSTRING