ComfyUI Node

Float Range Loop

The tiny CFG × shift sweeper Wan tuning actually wants

By KY-2000·Created about a year ago·Updated about a year ago· 8
Float Range Loop
    • cfg
    • shift
    • current_index
    • total_combinations
    • current_combination
    cfg_start1.0
    cfg_end8.0
    cfg_step1.0
    shift_start1.0
    shift_end3.0
    shift_step0.5
    seed0
    resetfalse

    If the kitchen-sink All Parameters Loop is overkill, this is the node you actually want. Float Range Loop does exactly two things: it walks a range of CFG values and a range of shift values, and hands you the next combination on each workflow run. That's it. No samplers, no schedulers, no mode selector - it sits in the WanVideo/FloatRange category, and it's aimed squarely at the two floats that matter most when you're dialing in a WanVideo sampler.

    CFG and shift are a genuinely fiddly pair on Wan. The model's a flow-matching design, so CFG behavior differs from SDXL-era habits (CFG must be 1.0 with speed LoRAs like lightx2v/CausVid, and you want 3.5+ without them), and shift is the flow-shift parameter the WanVideo samplers expose - lightx2v workflows commonly sit around shift 8. Sweeping both against each other by hand is the sort of thing you do once, then never want to do again. This node is the "never again."

    How it works

    It builds the two value lists up front - CFG from cfg_start to cfg_end by cfg_step, shift from shift_start to shift_end by shift_step - then enumerates every CFG×shift pairing sequentially. Values are rounded to two decimals as they're generated, which quietly saves you from floating-point drift turning a clean 1.0–8.0 sweep into a mess.

    Like every node in this pack, it's counter-driven: each workflow run advances to the next combination, and it wraps around when it reaches the end of the list. There's no mode input - it's sequential only - but there is a reset boolean (default false) that zeroes the counter when you want to restart a sweep, and a seed that's part of the interface even though it only matters to the pack's random modes. Consider it free.

    The inputs, which are all there is

    • cfg_start / cfg_end / cfg_step - defaults 1 / 8 / 1. That's a 8-value sweep out of the box.
    • shift_start / shift_end / shift_step - defaults 1 / 3 / 0.5. A 5-value sweep.
    • seed, reset - as above.

    Outputs: cfg (FLOAT) and shift (FLOAT) - wire these into your WanVideo sampler's CFG and shift inputs - plus current_index, total_combinations, and current_combination, the last a "CFG 4.00, Shift 2.00" string that's perfect for a text preview or filename so each output labels itself.

    With the defaults that's 8 × 5 = 40 combinations. Queue the workflow 40 times and you have a complete, labeled CFG×shift grid. That's the entire workflow, and it's why the node is a staple in Wan tuning graphs.

    Install

    No dependencies, no model downloads - pure Python over ComfyUI's own machinery. ComfyUI Manager → search comfyui-ksampler-tester-loop → install → restart, or:

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

    then restart ComfyUI.

    One thing to remember

    Same family rule as the rest of the pack: "loop" means one combination per run, not an internal iteration that fills a grid in a single execution. Queue repeatedly and it rolls forward. If you're new to these nodes, that's the one mental model to fix first - the node won't do it for you, but it makes doing it yourself painless. Also note it prints a few lines to the console every run; that's just it narrating its picks, and it's useful for confirming what combination the current run is on.

    CategoryWanVideo/FloatRange

    Inputs (8)

    NameTypeDefaultDescription
    cfg_startFLOAT1.00–100
    cfg_endFLOAT8.00–100
    cfg_stepFLOAT1.00.1–10
    shift_startFLOAT1.00–100
    shift_endFLOAT3.00–100
    shift_stepFLOAT0.50.1–10
    seedINT00–18446744073709550000
    resetBOOLEANfalse

    Outputs (5)

    NameTypeDescription
    cfgFLOAT
    shiftFLOAT
    current_indexINT
    total_combinationsINT
    current_combinationSTRING