Noden KSampler i ComfyUI
KSampler runs the denoising loop: it takes the model, prompts and a latent and produces the finished latent image, controlled by seed, steps, cfg, sampler, scheduler and denoise.
Nodpaket: ComfyUI core
Kategori: Sampling
Den här sidan har inte översatts ännu, så den visas på engelska.
Vad KSampler gör
KSampler is where the image is actually generated. Starting from the input latent (random noise from Empty Latent Image, or an encoded picture for img2img), it asks the model to remove noise for the chosen number of steps, pulling toward the positive prompt and away from the negative one by the cfg amount. The result is a LATENT that VAE Decode turns into an image.
sampler_name selects the numerical method (euler, euler_ancestral, dpmpp_2m, dpmpp_2m_sde, dpmpp_3m_sde, uni_pc, lcm, ...) and scheduler the noise curve (normal, karras, exponential, sgm_uniform, simple, beta). denoise controls how much of the input latent is replaced: 1.0 for text-to-image, 0.3-0.7 for img2img and hires passes. KSampler (Advanced) exposes start and end steps for multi-stage sampling.
Ingångar
Namn | Typ | Vad det är |
|---|---|---|
model | MODEL | The denoising model, after any LoRA or ControlNet patches. |
positive | CONDITIONING | What you want (from CLIP Text Encode, possibly through ControlNet Apply). |
negative | CONDITIONING | What you do not want. |
latent_image | LATENT | The starting latent: empty noise or an encoded image. |
seed | INT | Noise seed. Same seed and settings reproduce the same image. control_after_generate sets fixed, increment, decrement or randomize. |
steps | INT | Number of denoising steps. 20-30 for most SD models, 4-8 for Lightning, Turbo and LCM models. |
cfg | FLOAT | Classifier-free guidance scale. 5-8 for SD 1.5 and SDXL, 1.0 for Flux and distilled models. |
sampler_name | COMBO | The sampling algorithm. |
scheduler | COMBO | The noise schedule. |
denoise | FLOAT | Fraction of the noise to remove. 1.0 = start from scratch; lower keeps more of the input image. |
Utgångar
Namn | Typ | Vad det är |
|---|---|---|
LATENT | LATENT | The sampled latent for VAE Decode or a second sampler. |
AD

Hoppa över installationen: ComfyUI-arbetsflöden förinstallerade i molnet
BitVector kör färdiga ComfyUI-arbetsflöden på sina egna GPU:er. Ingen installation, inga saknade noder, inga röda rutor. Öppna det på telefonen eller datorn och generera inom en minut.
Så använder du KSampler
- Connect MODEL, both CONDITIONINGs and a LATENT.
- Set steps 25, cfg 7, dpmpp_2m with karras for SDXL; euler with simple, cfg 1 for Flux.
- Set denoise to 1.0 for a fresh image.
- Connect LATENT to VAE Decode and then Save Image.
- Queue, then fix the seed when you want to iterate on the prompt.
Inställningar och tips
- dpmpp_2m + karras is the all-round choice; euler_ancestral adds variety but never converges; dpmpp_2m_sde gives extra detail at the cost of determinism across GPUs.
- Lightning, Hyper and Turbo checkpoints need their own settings: 4-8 steps, cfg 1-2, sgm_uniform or simple.
- For a hires pass, feed the first latent through Upscale Latent By and a second KSampler with denoise 0.4-0.55.
- Hold Ctrl+Shift+V to paste a node with its connections; useful when duplicating samplers.
- A fixed seed with the same settings is reproducible on the same GPU; different cards can differ slightly.
Felsökning av KSampler
Noise, static or a blurry blob instead of an image
Varför det händer
The settings do not fit the model: cfg 7 on a distilled model, 4 steps on a normal model, a Flux model without Flux Guidance, or denoise far below 1 on an empty latent.
Så löser du det
Match the model page: normal SD = 20-30 steps, cfg 5-8; Lightning/Turbo = 4-8 steps, cfg 1-2; Flux = cfg 1, guidance 3.5, 20+ steps. Use denoise 1.0 when the latent is empty.
Deep-fried, oversaturated, high-contrast output
Varför det händer
cfg is too high for the model or the LoRA stack, or an ancestral sampler with many steps.
Så löser du det
Lower cfg to 4-6, reduce LoRA strengths, or switch from euler_ancestral to dpmpp_2m.
torch.OutOfMemoryError: CUDA out of memory during sampling
Varför det händer
The latent is too large for the card at this batch size, or another model (ControlNet, upscaler) sits in VRAM at the same time.
Så löser du det
Lower the resolution or batch_size, add --lowvram, use fp8 weights, or split the hires pass into a second queue so the first model is unloaded.
Error: mat1 and mat2 shapes cannot be multiplied
Varför det händer
The conditioning comes from a text encoder of a different family than the model (SD 1.5 CLIP into an SDXL model, or vice versa).
Så löser du det
Wire the CLIP from the same checkpoint that provides the MODEL.
Images change every run although the seed is fixed
Varför det händer
control_after_generate is set to randomize, or an SDE / ancestral sampler is in use with a non-deterministic backend.
Så löser du det
Set control_after_generate to fixed and prefer dpmpp_2m or euler for exact repeatability.
The same image repeats across prompts (seed stuck)
Varför det händer
control_after_generate is fixed and the noise dominates at low cfg or low steps.
Så löser du det
Set it to randomize or increment and raise cfg slightly.
AD

Kör detta arbetsflöde från telefonen
Varje arbetsflöde på den här sidan är förinstallerat på BitVector med sina modeller och anpassade noder. Välj, skriv en prompt, klart. Noll installation, inget att ladda ner.
Frågor om KSampler
What is the difference between KSampler and KSampler (Advanced)?
Advanced adds add_noise, start_at_step, end_at_step and return_with_leftover_noise, which lets you split sampling across two models, for example SDXL base then refiner.
Which sampler is fastest?
euler and dpmpp_2m take one model call per step; the _2s and _3m variants take more. LCM and Lightning models are fast because they need few steps, not because of the sampler.
What does denoise do with an empty latent?
Anything below 1.0 leaves part of the original noise in the output and produces fog. Keep 1.0 for text-to-image.
Relaterade noder
KSampler (Advanced)
ComfyUI core
KSampler (Advanced) is KSampler with step-range control: add_noise, start_at_step, end_at_step and return_with_leftover_noise, used for base + refiner chains and two-model sampling.
Empty Latent Image
ComfyUI core
Empty Latent Image creates the blank latent canvas (width, height, batch_size) that text-to-image sampling starts from; dimensions must be multiples of 8 and match the model family.
VAE Decode
ComfyUI core
VAE Decode converts the sampled LATENT into a pixel IMAGE with the VAE; VAE Decode (Tiled) does the same in tiles for very large images.
CLIP Text Encode (Prompt)
ComfyUI core
CLIP Text Encode turns a text prompt into CONDITIONING using the model text encoder. One node holds the positive prompt, a second one the negative prompt.
Upscale Latent and Upscale Latent By
ComfyUI core
Upscale Latent resizes a latent to a new size (or by a factor) so a second KSampler can add detail at higher resolution: the classic hires fix.
AD

Trött på att laga noder? Låt molnet göra det
BitVector håller hundratals ComfyUI-arbetsflöden installerade, uppdaterade och testade på snabba moln-GPU:er. Ingen Python, inga CUDA-fel, inga VRAM-gränser. Fungerar från vilken webbläsare som helst.
Fler ComfyUI-noder
ComfyUI Manager
ComfyUI-Manager
ComfyUI Manager is the extension that installs, updates and fixes custom node packs and models from inside the interface, resolves missing nodes in imported workflows and snapshots your setup.
Load Checkpoint
ComfyUI core
Load Checkpoint (CheckpointLoaderSimple) opens a .safetensors or .ckpt model file and hands out the three parts every workflow needs: the diffusion MODEL, the CLIP text encoder and the VAE.
Save Image
ComfyUI core
Save Image writes the IMAGE tensor to ComfyUI/output as a PNG, with the whole workflow embedded in the file metadata so the picture can be dragged back into ComfyUI to restore the graph.
Load Image
ComfyUI core
Load Image reads a picture from the ComfyUI input folder (or an upload) and outputs an IMAGE tensor plus a MASK taken from the alpha channel, the starting point for img2img, inpainting, ControlNet and IP-Adapter graphs.
Load LoRA
ComfyUI core
Load LoRA (LoraLoader) applies a LoRA file to the MODEL and CLIP with separate strengths, so a style, character or concept can be added to any checkpoint without merging.
Load Diffusion Model
ComfyUI core
Load Diffusion Model (UNETLoader) loads a bare denoising network such as Flux, SD3.5, Wan or HunyuanVideo from models/diffusion_models, with a weight_dtype option for fp8 to save VRAM.

Model
Trends
.ai
© ModelTrends.ai
|
Tillverkad i Japan
|
© 2026