Nodes/comfyui-ksampler-tester-loop/Sampler Scheduler Loop (Sampler Custom Advanced)
ComfyUI Node

Sampler Scheduler Loop (Sampler Custom Advanced)

When your sampler node wants a SAMPLER object, not a name

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

    Stock ComfyUI's KSampler takes a sampler name - a string like "dpmpp_2m". But a whole ecosystem of custom sampler nodes - SamplerCustom, Kijai's SamplerCustomAdvanced, ClownsharkSampler, and friends - expect a SAMPLER object, an actual callable function, not text. Wire a string into one of those and you get a type error and a sad graph.

    That's the entire reason Sampler Scheduler Loop (Sampler Custom Advanced) exists. It's the pairing loop from this pack - sampler × scheduler - but instead of returning sampler names, it resolves each one to a real sampler object on the way out. You get the same looping machinery, plus an output that plugs into the fancy sampler nodes that power advanced sampling workflows.

    How the object magic works

    When the node picks a sampler name, it calls ComfyUI's internal comfy.samplers.sampler_object(name) to build the actual function. There's a fallback chain if that fails - it tries the samplers dict, and only as a last resort returns the plain string with a warning. That fallback means you can still hit a type error if ComfyUI's internals change, but the common case works cleanly. The scheduler output stays a plain string, because schedulers are just names even in the custom nodes.

    The looping itself is the same counter-based machine as the standard nodes in this pack: one selection per workflow run, advancing on each new queue. Modes are sequential, random, and ping_pong. reset zeroes the counter.

    Inputs that matter

    • mode - sequential, random, or ping_pong. Sequential is the sensible default for a methodical test.
    • seed - only consulted in random mode; it's combined with the step count so random draws are reproducible but don't repeat.
    • reset - BOOLEAN, flip it to start the cycle over.
    • skip_samplers / skip_schedulers - the two comma-separated skip lists. euler, lcm and karras, exponential respectively. Exact names only; the node logs a warning for anything it doesn't recognize, and if you skip everything it falls back to the full list rather than erroring.

    Outputs: sampler as a genuine SAMPLER type (wire it into your custom sampler's sampler input), scheduler as one of ComfyUI's nine scheduler names, plus current_index, total_combinations, and current_combination (a "Sampler: x, Scheduler: y" string, handy for labeling outputs).

    Installing it

    Same story as the rest of this pack - no pip deps, no models, pure Python over ComfyUI's own sampler machinery:

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

    then restart ComfyUI. Or go through ComfyUI Manager and search comfyui-ksampler-tester-loop / "Sampler Scheduler Loop".

    The catch that gets everyone

    Same one as the whole family: it doesn't generate a grid in one run. Each queue execution hands you the next sampler×scheduler combination. To actually test all 44 samplers against 9 schedulers, queue the workflow 396 times (or however many you want) and collect the outputs. Beginners routinely expect one run to iterate internally - that's the node's one genuine footgun, and it's not your fault the name says "Loop."

    Use the skip lists aggressively, by the way. 396 combinations of Wan- or SDXL-scale steps is a lot of GPU-hours for very little signal. Trim to the handful you actually believe in, then let the loop fill in the blanks.

    CategorySamplers/Loop/Advanced

    Inputs (5)

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

    Outputs (5)

    NameTypeDescription
    samplerSAMPLER
    schedulersimple,sgm_uniform,karras,exponential,ddim_uniform,beta,normal,linear_quadratic,kl_optimal
    current_indexINT
    total_combinationsINT
    current_combinationSTRING