KSampler
The one node that's in every workflow you've ever downloaded
- model
- positive
- negative
- latent_image
- LATENT
This is the node that actually does the drawing. Everything before it - loaders, CLIP encode, empty latents - is just getting ingredients ready, and everything after it (VAE Decode, upscalers) is cleanup. KSampler takes a noisy latent and walks it down to a clean one, guided by your prompt, one step at a time. If you've downloaded one ComfyUI workflow in your life, it had one of these in it.
It ships with ComfyUI core (nodes.py), so there's nothing to install - it's in every default install, and it's usually the first sampler people learn because it's the whole sampling pipeline in a single node.
How it works
Under the hood, each step is two predictions. The model runs once conditioned on your positive prompt and once on the negative, and the difference between them gets amplified by cfg - that's classifier-free guidance, and it's why CFG roughly doubles the compute. Then a sampler decides how to remove noise each step, and a scheduler decides how much to remove.
Two things the community learned the hard way, so you don't have to:
- Sampler and scheduler are a pair, not two independent tastes. SD 1.5 and SDXL still love
dpmpp_2m+karrasat 20–30 steps. But anything flow-matching - Flux, Z-Image, Klein, Anima - wants an Euler-family sampler on a conservative schedule likenormalorbeta. Karras on a flow-matching model doesn't just underperform, it fails outright: the straight trajectory has nothing for an aggressive schedule to correct. cfgis not "higher is more obedient." The sweet spot is architecture-specific. 5–9 on SD 1.5/SDXL, 4–6 on Pony/Illustrious, and roughly 1 on any distilled model. Turbo and Lightning checkpoints run at CFG 1 by design - guidance is baked into the weights - so cranking the dial doubles your render time and burns the image.
The inputs that matter
- positive / negative - your prompt and what you want to steer away from. Note the negative does nothing at CFG 1 on most samplers; the pass behind it isn't even computed.
- seed - sets the initial noise. Same seed + same settings = same image. For A/B testing one variable, lock the seed; the troubleshooting KB says it plainly: change one thing at a time or you can't diagnose anything.
- steps - more steps isn't always better. Converging samplers (Euler, DPM++ 2M) settle; beyond a point extra steps just cost time.
- denoise - the img2img dial. At 1.0 it starts from pure noise; lower it and it preserves the structure of your input latent. 0.4–0.6 is the classic "keep the composition, change the style" range.
- sampler_name / scheduler - see above. When a model card recommends a pair, trust it before any habit.
The output is a single LATENT, which you feed into a VAE Decode to get pixels.
Where people get burned
The two classics: images that come out "deep fried" (CFG too high - lower it before touching anything else), and black or garbled output (usually a VAE/latent channel mismatch upstream, not the sampler's fault). The newer one is dragging SDXL-era defaults onto a 2026 model and wondering why it looks awful. Check what architecture your checkpoint is built on, not when it shipped - a 2026 Illustrious merge is still DDPM-style, and an 8-step distilled model still wants CFG 1.
If you need to cut a sampling run into stages - hires fix, partial denoise, run some steps on a clean prompt then swap - that's what KSampler (Advanced) is for. If you want to swap pieces in and out of the pipeline individually, the custom sampler graph is the modern way.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | The model used for denoising the input latent. | |
| seed | INT | 00–18446744073709550000 | The random seed used for creating the noise. |
| steps | INT | 201–10000 | The number of steps used in the denoising process. |
| cfg | FLOAT | 8.00–100 | The Classifier-Free Guidance scale balances creativity and adherence to the prompt. Higher values result in images more closely matching the prompt however too high values will negatively impact quality. |
| sampler_name | COMBO | The algorithm used when sampling, this can affect the quality, speed, and style of the generated output. | |
| scheduler | COMBO | The scheduler controls how noise is gradually removed to form the image. | |
| positive | CONDITIONING | The conditioning describing the attributes you want to include in the image. | |
| negative | CONDITIONING | The conditioning describing the attributes you want to exclude from the image. | |
| latent_image | LATENT | The latent image to denoise. | |
| denoise | FLOAT | 1.000–1 | The amount of denoising applied, lower values will maintain the structure of the initial image allowing for image to image sampling. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | The denoised latent. |