Nodes/ComfyUI-WanVideoKsampler/Wan Video Ksampler
ComfyUI Node

Wan Video Ksampler

A memory-managed KSampler for Wan video

By ShmuelRonen·Created about a year ago·Updated about a year ago· 38
Wan Video Ksampler
  • model
  • positive
  • negative
  • video_latents
  • LATENT
seed0
steps20
cfg6.00
sampler_name
scheduler
denoise1.00

If you've been running Wan video locally and your renders keep dying with CUDA out of memory two-thirds of the way through, this is the node that's supposed to fix that. WanVideoKsampler is a drop-in replacement for ComfyUI's stock KSampler, tuned for Wan latents, with a memory-management layer bolted on so you can push resolution and frame count a bit further before your card falls over. That's the whole pitch, and it's a reasonable one - VRAM is the entire game in local video (the KB calls it "the central constraint"), so a sampler that babysits your memory has a real audience.

Let's be honest about what it actually is, though. Under the hood this is ComfyUI's ordinary KSampler. You can tell from the inputs: the sampler_name dropdown carries all 34 stock samplers (euler, dpmpp_2m, res_multistep, the lot) and scheduler has the usual nine (normal, karras, beta, simple…). Same math, same schedulers. What ShmuelRonen added on top is monitoring - the node watches GPU and CPU memory as it samples, runs garbage collection and clears the CUDA cache at strategic points, and tries to recover gracefully instead of hard-crashing when it hits an OOM wall. Useful plumbing. Not a new sampler.

What it works on, and what it doesn't

The one input that separates this from a normal KSampler is video_latents - a LATENT that holds your video frames in latent space, usually coming off a Wan-VAE encode or an empty-video-latent node. Everything else is textbook: model (your Wan diffusion model), positive and negative conditioning, seed, steps (default 20), cfg (default 6), plus the sampler/scheduler/denoise trio. It hands back a single LATENT, which you wire straight into a Wan-VAE Decode to get actual frames.

Here's the catch worth knowing up front: there's one model input and one sampling pass. Wan 2.2 is a two-expert MoE - a high-noise model for motion and composition, a low-noise model for detail - and the standard 2.2 workflow splits your steps across two chained samplers. WanVideoKsampler doesn't do that split; it's a single-model, single-pass sampler with a plain denoise knob and no start/end-step controls. So it slots most cleanly into Wan 2.1 or any single-model setup. The README's own example is the Wan 2.1 T2V-1.3B model on an RTX 4090. If you're on the 2.2 MoE path, this node isn't the natural fit - reach for the native KSampler (Advanced) chain or a dedicated Wan MoE sampler instead.

Settings a beginner actually touches

Three that matter:

  • cfg - the node defaults to 6, which is fine for plain Wan without acceleration. But if you're using speed LoRAs (lightx2v, CausVid), Wan needs cfg 1.0 or the output falls apart. Match your CFG to your setup, don't just trust the default.
  • steps - 20 is a sane starting point. On speed LoRAs you'll drop to 3–8.
  • sampler_name / scheduler - euler with beta is the community's reliable default for Wan; res-family samplers get more right but roughly double your time.

denoise stays at 1.0 for generating from scratch; lower it only if you're doing a video-to-video pass on existing latents.

Installing it

Two ways. In ComfyUI Manager, search ComfyUI-WanVideoKsampler and install. Or from the command line:

cd ComfyUI/custom_nodes/
git clone https://github.com/ShmuelRonen/ComfyUI-WanVideoKsampler.git
pip install psutil

Then restart ComfyUI. The only dependency is psutil (that's what powers the memory readouts) - if you skip it, the node won't load, so don't skip it. No model downloads ship with the pack; it assumes you already have Wan models and a Wan-VAE in place.

Where people get burned

Set expectations on the "advanced memory management." It's genuine, but modest. Someone in the community merged this node's memory logic into a KSampler (Advanced) variant and measured "a few percent" of time saved on a 5060 Ti - helpful, not transformative. Cache-clearing keeps you from crashing; it doesn't rewrite what fits in VRAM. If you're fundamentally short on memory, a GGUF quant or block-swapping will do far more for you than any amount of gc.collect(). Treat this node as insurance against OOM crashes on borderline renders, not as a way to run clips your card can't actually hold.

And know your lane: this is a niche pack. Native ComfyUI Wan support and Kijai's WanVideoWrapper are what most people run. Pick WanVideoKsampler when you're specifically fighting out-of-memory errors on a single-model Wan 2.1-style workflow - that's the spot where it earns its slot.

Categorysampling

Inputs (10)

NameTypeDefaultDescription
modelMODEL
positiveCONDITIONING
negativeCONDITIONING
video_latentsLATENT
seedINT00–18446744073709550000
stepsINT201–10000
cfgFLOAT6.000–100
sampler_nameCOMBO34 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +28
schedulerCOMBO9 options: normal, karras, exponential, sgm_uniform, simple, ddim_uniform, +3
denoiseFLOAT1.000–1

Outputs (1)

NameTypeDescription
LATENTLATENT