Double Int Range Loop
Two int ranges at once — a grid sweep with one wire per axis
- value1
- value2
- current_index
- total_combinations
- current_combination
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_stepand the same three forvalue2_- 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.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| value1_start | INT | 0-9223372036854776000–18446744073709550000 | — |
| value1_end | INT | 5-9223372036854776000–18446744073709550000 | — |
| value1_step | INT | 11–2147483647 | — |
| value2_start | INT | 0-9223372036854776000–18446744073709550000 | — |
| value2_end | INT | 3-9223372036854776000–18446744073709550000 | — |
| value2_step | INT | 11–2147483647 | — |
| seed | INT | 00–18446744073709550000 | — |
| reset | BOOLEAN | false | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| value1 | INT | — |
| value2 | INT | — |
| current_index | INT | — |
| total_combinations | INT | — |
| current_combination | STRING | — |