Basic Sampling
KSampler
The main node for generating images through the sampling process. Category:sampling
The diffusion model used for denoising the latent
Random seed for noise generation. Range: 0 to 18446744073709551615
Number of denoising steps. More steps = higher quality but slower. Range: 1 to 10000
Classifier-Free Guidance scale. Higher values follow the prompt more closely. Range: 0.0 to 100.0
The sampling algorithm to use (e.g.,
euler, euler_a, dpmpp_2m, dpmpp_2m_sde, heun, dpm2, etc.)Controls the noise schedule (e.g.,
normal, karras, exponential, sgm_uniform, simple, ddim_uniform)The positive prompt conditioning (what you want to generate)
The negative prompt conditioning (what you want to avoid)
The latent to denoise (from EmptyLatentImage for txt2img, or VAEEncode for img2img)
Amount of denoising. 1.0 = full denoising, lower values preserve more of the input. Range: 0.0 to 1.0
LATENT: The denoised latent image
euler: Fast, good quality, deterministiceuler_a: Ancestral euler, more creative but non-deterministicdpmpp_2m: DPM++ 2M, high quality with fewer stepsdpmpp_2m_sde: DPM++ 2M SDE, higher quality but slowerdpmpp_3m_sde: DPM++ 3M SDE, very high qualityheun: High quality but slow (2x function evaluations)dpm_fast: Fast samplingddim: Classic DDIM sampleruni_pc: UniPC samplerlcm: Latent Consistency Model sampler (requires LCM LoRA)
normal: Standard linear schedulekarras: Karras schedule, often better qualityexponential: Exponential decay schedulesgm_uniform: Stable diffusion 3 schedulesimple: Simple scheduleddim_uniform: Uniform schedule for DDIM
1.0-3.0: Very loose adherence, highly creative4.0-7.0: Balanced creativity and prompt following7.0-12.0: Strong prompt adherence12.0+: Very strict, may reduce quality
Advanced Sampling
KSamplerAdvanced
Advanced sampler with fine control over the sampling process. Category:sampling
The diffusion model
Whether to add noise at the start. Options:
enable, disableRandom seed for noise. Range: 0 to 18446744073709551615
Total number of sampling steps. Range: 1 to 10000
Classifier-Free Guidance scale. Range: 0.0 to 100.0
The sampling algorithm
The noise scheduler
Positive conditioning
Negative conditioning
Input latent
Which step to start sampling at. Range: 0 to 10000
Which step to end sampling at. Range: 0 to 10000
Whether to return without final denoising. Options:
disable, enableLATENT: The denoised latent
- Multi-stage sampling (different prompts at different steps)
- Noise control for advanced workflows
- Partial sampling for refinement
- First KSamplerAdvanced:
start_at_step=0,end_at_step=15,return_with_leftover_noise=enable - Second KSamplerAdvanced:
start_at_step=15,end_at_step=20, different prompt
- Use
add_noise=disableto refine an existing latent without adding noise
Sampling Parameters Guide
Steps
More steps generally produce better quality but take longer:15-20: Fast, good for testing20-30: Standard quality30-50: High quality50+: Diminishing returns
dpmpp_2m) produce good results with fewer steps.
CFG (Classifier-Free Guidance)
Controls how closely the output matches the prompt:- Too low (< 3): Image may not match prompt
- Optimal (7-10): Good balance
- Too high (> 15): May introduce artifacts
Denoise Strength
Controls how much the input is changed:1.0: Complete regeneration (txt2img)0.7-0.9: Strong changes while preserving composition0.4-0.6: Moderate changes, refinement0.1-0.3: Subtle changes, details only0.0: No change
Seed
Controls randomness:- Same seed with same settings = same image
- Different seeds = variations
control_after_generatesetting:fixed: Keep same seedincrement: Add 1 to seed each generationdecrement: Subtract 1 each generationrandomize: Use random seed each time
Workflow Examples
Text to Image (txt2img)
EmptyLatentImage→ creates blank latentCLIPTextEncode(positive) → encodes promptCLIPTextEncode(negative) → encodes negative promptKSampler→ generates imageVAEDecode→ converts to pixels
Image to Image (img2img)
LoadImage→ loads input imageVAEEncode→ converts to latentKSamplerwithdenoise < 1.0→ modifies imageVAEDecode→ converts back to pixels
Inpainting
LoadImage→ loads imageLoadImageMask→ loads maskVAEEncodeForInpaint→ prepares latent with maskKSampler→ generates in masked areaVAEDecode→ final image
Upscaling (Latent Upscale)
- Generate base image at low resolution
LatentUpscale→ upscale latentKSamplerwithdenoise=0.4-0.6→ refine detailsVAEDecode→ high-res image