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

Double Float Range Loop

Grid-search two float settings in one pass

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

    Every now and then you need to find a sweet spot in two continuous settings at once - CFG and denoise, or shift and strength - and testing them independently misses the interaction. DoubleFloatRangeLoop is the two-axis float version of the pack's range loops: it walks the Cartesian product of two float ranges, handing you a value1 and value2 per run so a batch of images covers the whole grid.

    It's part of KY-2000's RES4LYF-tester-loop pack. Like the other range nodes it doesn't need RES4LYF to be useful - it's a generic iteration helper - but it lives in the pack because the whole point of that repo is making sweeps painless, and a two-float grid is one of the more painful things to do by hand.

    How it works

    Each execution advances a flat counter and maps it onto two ranges: value1's index is counter ÷ length(value2 range), value2's index is the remainder, so the walk is ordered and complete - every value1 pairing runs through all of value2 before value1 steps. Ranges are inclusive, descending works, and both are rounded to six decimal places to avoid float accumulation drift (this is where a naive step loop silently lands on 0.30000000000000004 and this one doesn't). total_combinations is the product of the two range sizes, reported up front. reset (true) restarts the grid.

    Outputs: value1, value2, current_index, total_combinations, and a current_combination string like value1 0.5, value2 1.2 you can push into a label or filename node.

    The inputs that matter

    • value1_start / value1_end / value1_step and the matching value2_ trio - the two ranges; float steps down to 0.000001.
    • seed - accepted, but this node is sequential-only, so it's a no-op in practice.
    • reset - restart from the first combination.

    Install

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

    Restart ComfyUI. No dependencies, no model downloads - plain stdlib Python.

    Where people get burned

    Same caveat as its int sibling: this is a strictly sequential grid - the seed input does nothing and there's no random or ping_pong mode, so if you want randomized sampling you're in the wrong node. The good news: unlike DoubleIntRangeLoop, its reset actually works (that one has a NameError bug in the shipped code). Before you queue anything, glance at total_combinations - float ranges make it trivial to specify a grid of a few hundred runs without meaning to, and a quick step-size sanity check beats discovering it after the queue's already churning.

    CategoryRES4LYF/Loop

    Inputs (8)

    NameTypeDefaultDescription
    value1_startFLOAT0.00-1000000000–1000000000
    value1_endFLOAT5.00-1000000000–1000000000
    value1_stepFLOAT1.000.000001–1000000
    value2_startFLOAT0.00-1000000000–1000000000
    value2_endFLOAT3.00-1000000000–1000000000
    value2_stepFLOAT0.500.000001–1000000
    seedINT00–18446744073709550000
    resetBOOLEANfalse

    Outputs (5)

    NameTypeDescription
    value1FLOAT
    value2FLOAT
    current_indexINT
    total_combinationsINT
    current_combinationSTRING