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

Double Int Range Loop

Two int ranges at once — a grid sweep with one wire per axis

By KY-2000·Created about a year ago·Updated about a year ago· 9
Double Int Range Loop
    • value1
    • value2
    • current_index
    • total_combinations
    • current_combination
    value1_start0
    value1_end5
    value1_step1
    value2_start0
    value2_end3
    value2_step1
    seed0
    resetfalse

    When you want to sweep two integers at once - say steps against CFG - you have two options: nest two single loops and fight with their shared counters, or just use DoubleIntRangeLoop and let one node hand you both values per run. It's the Cartesian product of two ranges: value1 ticks through its range, and for every step of value1, value2 runs its whole range. Queued runs walk the grid in order.

    This is one of the generic range loops in KY-2000's RES4LYF-tester-loop pack, and like its float sibling it's not really RES4LYF-specific - it's a two-axis iteration helper that earns its keep any time you're grid-searching integer parameters and want each run labeled with what it used.

    How it works

    On each execution the node builds both ranges (inclusive, descending allowed) and maps a flat counter onto them: value1's index is the counter divided by value2's range length, value2's index is the remainder. So with value1 = 0..4 step 2 and value2 = 5..14 step 3 you get (0,5), (0,8), (0,11), (0,14), (2,5), (2,8), ... - the README's own example. total_combinations is the product of the two range sizes, printed up front so you know what you're signing up for. A reset toggle (true) restarts the sweep.

    Outputs: value1 and value2 (wire each to the input it belongs to), plus current_index, total_combinations, and a current_combination string like value1 2, value2 8 for labeling.

    The inputs that matter

    • value1_start / value1_end / value1_step and the same three for value2_ - the two ranges.
    • seed - accepted for interface consistency, but note this node is sequential-only; there's no random mode here.
    • reset - restart the grid.

    Install

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

    Restart ComfyUI. No dependencies, no models.

    Where people get burned

    Two real quirks, both from the shipped code. First: the reset toggle on this specific node references a class that doesn't exist (IntRangeLoop), so flipping it raises a NameError instead of restarting the sweep - the float and single nodes reset fine, this one's a bug worth knowing before you build a workflow around it. Second, the node is strictly sequential: the seed input is accepted but does nothing, and there's no random or ping_pong mode. If you wanted random grid sampling, grab the float version's seed-based randomness via the single loops instead - or just live with the ordered walk, which is usually what a grid sweep wants anyway.

    CategoryRES4LYF/Loop

    Inputs (8)

    NameTypeDefaultDescription
    value1_startINT0-9223372036854776000–18446744073709550000
    value1_endINT5-9223372036854776000–18446744073709550000
    value1_stepINT11–2147483647
    value2_startINT0-9223372036854776000–18446744073709550000
    value2_endINT3-9223372036854776000–18446744073709550000
    value2_stepINT11–2147483647
    seedINT00–18446744073709550000
    resetBOOLEANfalse

    Outputs (5)

    NameTypeDescription
    value1INT
    value2INT
    current_indexINT
    total_combinationsINT
    current_combinationSTRING