Nodes/ComfyUI-WanVideoWrapper/WanVideo Sampler v2
ComfyUI Node Runs on cloud

WanVideo Sampler v2

The engine of a WanVideoWrapper graph

By kijai·Created about a year ago·Updated 2 months ago· 6,651
WanVideo Sampler v2
  • model
  • image_embeds
  • scheduler
  • text_embeds
  • samples
  • extra_args
  • samples
  • denoised_samples
cfg6.00
seed0
force_offloadtrue
add_noise_to_samplesfalse

This is where the actual generating happens. Everything else in a WanVideoWrapper graph - the model loader, the text encode, the image embeds, the LoRAs, the accelerators - is setup that funnels into this node, and it turns your latent noise into denoised video latents. It's the v2 of the wrapper's sampler, restructured so a lot of the knobs that used to crowd the sampler now live in a separate scheduler node and an optional extra-args node feeding in.

If you're coming from ComfyUI's native KSampler, the shape is familiar but the wiring is different. Wan is a flow-matching video model, and its sampler wants Wan-specific embeds, not the CONDITIONING and MODEL types you'd use on an SDXL graph. Don't try to cross the streams.

How it works

You hand it a loaded Wan model, the image embeds that describe your frame geometry and any I2V conditioning, and a scheduler that carries the step count and sampler choice. It runs the denoising loop and returns the result as a latent, which you then send to a Wan VAE decode to get pixels. CFG and seed live directly on the node; steps and sampler live on the scheduler input.

The inputs and outputs that matter

  • model (WANVIDEOMODEL) - your loaded Wan model, ideally after any LoRA / attention / cache patches have been applied to it.
  • image_embeds (WANVIDIMAGE_EMBEDS) - required. From WanVideoEmptyEmbeds for text-to-video, or an image-conditioned embeds node (ClipVisionEncode, SVIProEmbeds, etc.) for I2V and friends. This carries width/height/frame count.
  • cfg (default 6) - guidance strength. Full-quality Wan wants CFG 3.5+ on the high-noise pass; if you're running a lightx2v/CausVid speed LoRA you must drop this to 1.0 or the output falls apart.
  • scheduler (WANVIDEOSCHEDULER) - where steps and sampler type come from. res_2s is the quality pick at double the time; euler/beta is the fast default. Speed LoRAs run at 3-4 steps per pass.
  • text_embeds (optional) - your prompt embeddings; leave unconnected for a purely image-driven run.
  • samples (LATENT, optional) - feed a latent to continue or refine from instead of pure noise, with add_noise_to_samples controlling whether fresh noise is added.
  • extra_args (optional) - the WanVideoSamplerExtraArgs bundle for RIFLEx, context windows, caching, and the various talking-head / pose add-ons.

Outputs are samples and denoised_samples (both LATENT). samples is the standard output to decode.

How to install it

ComfyUI Manager - search ComfyUI-WanVideoWrapper, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-WanVideoWrapper
pip install -r ComfyUI-WanVideoWrapper/requirements.txt

then restart. The sampler itself downloads nothing, but it's useless without a Wan model loaded upstream and a VAE downstream - grab the fp8 Wan weights and VAE from Kijai's WanVideo_comfy HuggingFace repo.

Common issues & troubleshooting

Everything is a smeary mess. Nine times out of ten this is a CFG mismatch. If a speed LoRA is in the graph, CFG has to be 1.0. Running CFG 6 with lightx2v attached produces garbage; running CFG 1 without a speed LoRA produces washed-out, guidance-starved output. Match the CFG to whether a distill LoRA is present.

Type errors wiring it up. The wrapper's WANVIDIMAGE_EMBEDS and WANVIDEOTEXTEMBEDS types don't interoperate with ComfyUI's native Wan nodes. If a link refuses to connect, you're probably mixing wrapper nodes with native ones - pick one lane and stay in it.

It's painfully slow. That's Wan, not the node. Stack the accelerators the community relies on: SageAttention, TorchCompile, and a cache node via extra_args. A 4090 without them can sit at 40 minutes for an 81-frame 720p clip.

CategoryWanVideoWrapper

Inputs (10)

NameTypeDefaultDescription
modelWANVIDEOMODEL
image_embedsWANVIDIMAGE_EMBEDS
cfgFLOAT6.000–30
seedINT00–18446744073709550000
force_offloadBOOLEANtrueMoves the model to the offload device after sampling
schedulerWANVIDEOSCHEDULER
text_embedsoptWANVIDEOTEXTEMBEDS
samplesoptLATENTinit Latents to use for video2video process
add_noise_to_samplesoptBOOLEANfalseAdd noise to the samples before sampling, needed for video2video sampling when starting from clean video
extra_argsoptWANVIDSAMPLEREXTRAARGS

Outputs (2)

NameTypeDescription
samplesLATENT
denoised_samplesLATENT