Nodes/comfyui-ksampler-tester-loop/Sampler Scheduler Loop
ComfyUI Node

Sampler Scheduler Loop

Sampler and scheduler, swept as a pair, for plain KSampler

By KY-2000·Created about a year ago·Updated about a year ago· 8
Sampler Scheduler Loop
    • sampler
    • scheduler
    • current_index
    • total_combinations
    • current_combination
    mode
    seed0
    resetfalse
    skip_samplers
    skip_schedulers

    Sampler Scheduler Loop is the node that made this pack briefly famous in a small corner of r/comfyui - or rather, the confusion around it did. Someone posted "howto use sampler scheduler loop?" after wiring it up, hitting run, and getting one image instead of the grid they expected. The answer, helpfully, was: that's how it works. It rolls forward through sampler×scheduler combinations one queue run at a time, and you re-run it to iterate.

    Once you've internalized that, it's a genuinely useful node. It walks every combination of ComfyUI's samplers and schedulers and feeds the pair straight into a stock KSampler's sampler and scheduler inputs. Want to know whether dpmpp_2m sings with karras or prefers exponential on your current model? This is the zero-effort way to find out.

    How it works

    One internal counter per mode, advancing only when the node detects a new execution (it dedupes with a timestamp-plus-thread ID). Each run picks a sampler_index and scheduler_index from the product, in the order sampler → scheduler, so the scheduler cycles fastest within each sampler. Three modes:

    • sequential - walks the product in order, wraps at the end.
    • random - picks an index using seed + step; reproducible but different each run.
    • ping_pong - bounces forward and back through the product.

    reset (BOOLEAN, default false) zeroes the counter. Both outputs are plain strings, which is exactly what a stock KSampler wants - the Advanced variant of this node exists for custom sampler nodes that need SAMPLER objects instead.

    Inputs and outputs

    • mode - sequential, random, ping_pong.
    • seed - only consulted in random mode.
    • reset - start the cycle over.
    • skip_samplers / skip_schedulers - the two comma-separated skip lists (euler, lcm / karras, exponential). Names must match exactly; the node logs a warning for unrecognized entries, and skipping everything silently falls back to the full list.

    Outputs: sampler (string) and scheduler (string) to wire into KSampler, plus current_index, total_combinations, and current_combination (a "Sampler: euler, Scheduler: karras" string) for labeling runs.

    A note on scale: 44 samplers × 9 schedulers = 396 combinations. That's a full sweep if you queue it all, but half of those pairings are pointless on any given model. Use the skip lists to trim to the few samplers you trust, then let the loop fill in the scheduler dimension.

    Install

    No dependencies, no model downloads - the whole pack is pure Python over ComfyUI's own sampler lists. 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. The repo has no requirements.txt to fight with - a small mercy.

    The lesson from the subreddit thread

    The failure mode is always the same: expecting one run to iterate. It won't. Queue the workflow repeatedly - or queue it N times at once - and each execution hands the KSampler the next combination. That mental model is the entire difference between "this node is broken" and "this node just saved me an hour of manual testing." The console logs each pick, so if you're ever unsure what a given run is using, the answer's right there.

    CategorySamplers/Loop

    Inputs (5)

    NameTypeDefaultDescription
    modeCOMBO3 options: sequential, random, ping_pong
    seedINT00–18446744073709550000
    resetBOOLEANfalse
    skip_samplersoptSTRING
    skip_schedulersoptSTRING

    Outputs (5)

    NameTypeDescription
    samplereuler,euler_cfg_pp,euler_ancestral,euler_ancestral_cfg_pp,heun,heunpp2,exp_heun_2_x0,exp_heun_2_x0_sde,dpm_2,dpm_2_ancestral,lms,dpm_fast,dpm_adaptive,dpmpp_2s_ancestral,dpmpp_2s_ancestral_cfg_pp,dpmpp_sde,dpmpp_sde_gpu,dpmpp_2m,dpmpp_2m_cfg_pp,dpmpp_2m_sde,dpmpp_2m_sde_gpu,dpmpp_2m_sde_heun,dpmpp_2m_sde_heun_gpu,dpmpp_3m_sde,dpmpp_3m_sde_gpu,ddpm,lcm,ipndm,ipndm_v,deis,res_multistep,res_multistep_cfg_pp,res_multistep_ancestral,res_multistep_ancestral_cfg_pp,gradient_estimation,gradient_estimation_cfg_pp,er_sde,seeds_2,seeds_3,sa_solver,sa_solver_pece,ddim,uni_pc,uni_pc_bh2
    schedulersimple,sgm_uniform,karras,exponential,ddim_uniform,beta,normal,linear_quadratic,kl_optimal
    current_indexINT
    total_combinationsINT
    current_combinationSTRING