Nodes/comfyui-ksampler-tester-loop/Parameters Range Loop
ComfyUI Node

Parameters Range Loop

Steps + CFG + shift in one sweep, built for Wan

By KY-2000·Created about a year ago·Updated about a year ago· 8
Parameters Range Loop
    • steps
    • cfg
    • shift
    • current_index
    • total_combinations
    • current_combination
    steps_start20
    steps_end50
    steps_interval5
    cfg_start1.0
    cfg_end8.0
    cfg_interval1.0
    shift_start1.0
    shift_end3.0
    shift_interval0.5
    seed0
    resetfalse

    Parameters Range Loop is the middle child of this pack's WanVideo trio: it sweeps steps, CFG, and shift together, which is one more knob than the tiny Float Range Loop but a lot fewer than the all-in-one All Parameters Loop. It's what you want when you're not just hunting a CFG/shift sweet spot but also want to know how many steps you actually need at that spot.

    Step counts genuinely vary by setup with Wan - full-quality workflows land around 20–30 steps, speed-LoRA setups drop to 3–8 - and the "right" count depends on your CFG and shift. That's a three-variable interaction, which is exactly the sort of thing hand-editing does badly and a range node does without thinking.

    How it works

    Same family machinery as the rest of the pack: build three value lists (steps from steps_start to steps_end by steps_interval, CFG by its range, shift by its range), enumerate every combination sequentially, and hand the next one out on each workflow run. Floats get rounded to two decimals so ranges don't drift. There's no mode selector - sequential only - plus a seed that only matters to the pack's random modes and a reset boolean (default false) that restarts the counter when you want a clean sweep.

    Combination order is steps → CFG → shift, so shift changes fastest. Wrap-around at the end means the loop never dies; it just cycles. One run, one combination - the pack's universal rule. Queue the workflow repeatedly to walk the whole grid.

    Inputs

    • steps_start / steps_end / steps_interval - integers, defaults 20 / 50 / 5. A 7-value sweep out of the box.
    • cfg_start / cfg_end / cfg_interval - floats, defaults 1 / 8 / 1.
    • shift_start / shift_end / shift_interval - floats, defaults 1 / 3 / 0.5.
    • seed, reset - the usual.

    Outputs: steps (INT), cfg (FLOAT), shift (FLOAT) - wire all three into your WanVideo sampler - plus current_index, total_combinations, and current_combination (a "20 steps, CFG 4.00, Shift 2.00" string) for labeling your runs. Defaults multiply to 7 × 8 × 5 = 280 combinations, so keep your ranges honest or you'll be queueing for a while.

    One naming note, because it'll trip you up once: this node uses _interval for the step size, while the sibling Float Range Loop uses _step. Same idea, different words - that's the pack, not you being confused.

    Install

    No dependencies, no models - pure Python over ComfyUI's own machinery. Via ComfyUI Manager, search comfyui-ksampler-tester-loop (or "Sampler Scheduler Loop") and restart. Manual:

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

    then restart ComfyUI. That's the whole install; the repo ships with no requirements.txt, which is blessedly rare.

    The gotcha, for the last time

    "Loop" = one combination per queue run. It won't internally iterate and render a batch of outputs in a single execution - to walk the grid you re-queue the workflow (or queue it N times in one go), and each run uses the next combination. The console logs each pick, which is genuinely useful when you're 150 runs in and can't remember what the current one is testing.

    CategoryWanVideo/ParametersRange

    Inputs (11)

    NameTypeDefaultDescription
    steps_startINT201–1000
    steps_endINT501–1000
    steps_intervalINT51–100
    cfg_startFLOAT1.00–30
    cfg_endFLOAT8.00–30
    cfg_intervalFLOAT1.00.1–10
    shift_startFLOAT1.00–10
    shift_endFLOAT3.00–10
    shift_intervalFLOAT0.50.1–5
    seedINT00–18446744073709550000
    resetBOOLEANfalse

    Outputs (6)

    NameTypeDescription
    stepsINT
    cfgFLOAT
    shiftFLOAT
    current_indexINT
    total_combinationsINT
    current_combinationSTRING