Nodes/ComfyUI/KSampler (Advanced)
ComfyUI Node Runs on cloud

KSampler (Advanced)

The same sampler with the training wheels off

By Comfy-Org·Created 4 years ago·Updated 4 minutes ago· 129,952
KSampler (Advanced)
  • model
  • positive
  • negative
  • latent_image
  • LATENT
add_noise
noise_seed0
steps20
cfg8.0
sampler_name
scheduler
start_at_step0
end_at_step10000
return_with_leftover_noise

KSampler Advanced is the version of KSampler for people who want to decide which steps get sampled and what happens between them. The plain KSampler hides all of that behind a denoise slider. This one hands you three switches - add_noise, start_at_step, end_at_step, and return_with_leftover_noise - and then gets out of the way. Same core node, same class family, but it's what you reach for the moment one sampler isn't enough.

It ships with ComfyUI core (nodes.py). No install, no Manager.

How it works

Diffusion runs in steps, and a KSampler run is really "add noise, then denoise for N steps." KSampler Advanced lets you slice that run:

  • start_at_step / end_at_step - run only a window of the full schedule. The default start_at_step=0 and end_at_step=10000 means "do the whole thing." Set start_at_step=10 on a 20-step run and you're doing the last half of the denoise on whatever latent came in - the classic setup for a second-pass "hires fix" or for feeding a partially-denoised latent onward.
  • add_noise - whether fresh noise gets injected before this run. In a two-sampler chain you want noise only on the first sampler; leave it on in the second and you'll fight the first pass.
  • return_with_leftover_noise - whether the output keeps residual noise. Enable it when you're handing the latent to another sampler that's going to keep denoising; disable it when you want a fully clean latent to decode. The sampler forces full denoise when this is off.

This is a real workflow pattern, not just theory. When Ideogram 4's safety filter turned out to trigger on the early high-noise steps, the community's fix was a pair of KSampler Advanced nodes: run the first two steps on a clean prompt, then hand off to a second sampler running the real prompt for the rest (r/comfyui thread 1txurpt). Slicing runs is exactly what this node was built for.

The inputs you set

Everything from KSampler is here - model, noise_seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image - with the same rules. CFG values are architecture-specific (roughly 1 on anything distilled, 5–9 on SD 1.5/SDXL), and sampler/scheduler should match the checkpoint's family. The advanced fields are the ones that make it "Advanced."

Where people get burned

  • Forgetting to set end_at_step. The default of 10000 means "run to the end," so a single KSampler Advanced with defaults behaves like a plain KSampler. People load a two-sampler workflow, drag one of them, and are confused why the graph still runs to completion - check your end bounds first.
  • Double noise. Chain two samplers with add_noise enabled on both and the second pass starts from a re-noised latent instead of your carefully-parked intermediate. First sampler: noise on. Second: noise off.
  • Mixing step counts. start_at_step is measured against this node's steps, not the previous sampler's. If the first pass ran 20 steps and you set the second to 10 with start_at_step=10, you're not continuing where the first stopped - you're redefining the schedule. This is the #1 source of "why is my second pass doing nothing."

If all you need is a single clean run, save yourself the four extra widgets and use plain KSampler. Reach for Advanced when you have two samplers talking to each other - that's the only time its powers are actually useful.

Categorymodel/sampling

Inputs (13)

NameTypeDefaultDescription
modelMODEL
add_noiseCOMBO2 options: enable, disable
noise_seedINT00–18446744073709550000
stepsINT201–10000
cfgFLOAT8.00–100
sampler_nameCOMBO44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
schedulerCOMBO9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
positiveCONDITIONING
negativeCONDITIONING
latent_imageLATENT
start_at_stepINT00–10000
end_at_stepINT100000–10000
return_with_leftover_noiseCOMBO2 options: disable, enable

Outputs (1)

NameTypeDescription
LATENTLATENT