Nodes/VideoX-Fun/Wan 2.2 Sampler for Image to Video
ComfyUI Node

Wan 2.2 Sampler for Image to Video

Turning a still image into a Wan 2.2 clip inside VideoX-Fun

By aigc-apps·Created 2 years ago·Updated 21 days ago· 2,174
Wan 2.2 Sampler for Image to Video
  • funmodels
  • prompt
  • negative_prompt
  • start_img
  • riflex_k
  • images
video_length81
base_resolution640
seed43
steps50
cfg6.00
schedulerFlow
teacache_threshold0.100
enable_teacachetrue
num_skip_start_steps5
teacache_offloadtrue
cfg_skip_ratio0.00

This is the sampler node that actually does the image-to-video generation for stock Wan 2.2, loaded through LoadWan2_2Model. I2V is the mode most of the Wan community reaches for over T2V by default - anchoring the first frame to a real image solves a lot of the identity-drift and composition problems that plague pure text-to-video - and this node is where you set every knob that controls how that generation runs: length, resolution, sampling steps, and VideoX-Fun's own TeaCache-style caching for speed.

How it works

You give it a loaded funmodels bundle, a prompt pair, and (optionally) a starting image, and it runs the flow-matching diffusion process for the number of steps you set, denoising from noise toward a video that continues from that image. Output comes back as images - a batch of frames, not a video file, so you'll want a Video Combine or similar node downstream to encode it.

The inputs that matter

  • funmodels - from LoadWan2_2Model.
  • prompt / negative_prompt - both take the STRING_PROMPT type, not plain STRING. ComfyUI's default text box won't wire in directly; use this pack's FunTextBox node (or anything else that outputs STRING_PROMPT) to feed them.
  • start_img (optional, IMAGE) - the anchor frame. Leave it disconnected and you're effectively doing T2V through an I2V-shaped node, which works but isn't really the point of this sampler.
  • video_length - default 81 frames, range 5-161 in steps of 4. 81 frames is the standard Wan native window (5 seconds at 16fps); pushing well past that is where quality tends to degrade without extra tooling.
  • base_resolution - one of 512/640/768/896/960/1024, default 640.
  • steps - default 50, up to 200. Full-quality Wan generation in the wider community typically runs 20-30 steps; 50 is a safe, unhurried default, and you can push down for faster iteration once you know your prompt is working.
  • cfg - default 6, range 1-20. Wan is a flow-matching model, so CFG behaves differently than SDXL-era intuition suggests. Higher isn't automatically better past a point.
  • enable_teacache (default true), teacache_threshold (default 0.1), num_skip_start_steps (default 5), teacache_offload (default true) - VideoX-Fun's built-in step-caching, which skips recomputing near-identical intermediate steps. It speeds things up meaningfully, at a documented cost: the wider Wan community reports disabling this style of caching noticeably improves face consistency, at the cost of speed. If faces are drifting and you're not sure why, this is worth trying off first.
  • riflex_k (optional, RIFLEXT_ARGS) - plug in a FunRiflex node here if you're trying to push past the native frame ceiling.

Output: images - a frame batch.

Installing it

Part of the base VideoX-Fun pack. Search ComfyUI Manager for VideoX-Fun; if it's not indexed there, install directly:

cd ComfyUI/custom_nodes
git clone https://github.com/aigc-apps/VideoX-Fun
pip install -r VideoX-Fun/requirements.txt

Restart ComfyUI.

Common issues

Prompt/negative prompt won't connect. They're typed STRING_PROMPT, a custom type - a generic ComfyUI text node output won't plug in. Use FunTextBox.

Generation runs but comes out looking static or wrong. Check start_img is actually wired if you meant to do I2V - an unconnected optional input silently falls back to T2V-style behavior rather than erroring.

It's slow. 50 steps at 1024 resolution on a 14B-class model is genuinely heavy - this is the same weight class the broader Wan community runs 25-40 minute clips on without speed LoRAs. enable_teacache is already on by default to help; beyond that, lower steps or base_resolution for iteration passes.

Faces or fine detail wobble across the clip. Try enable_teacache: false first before touching anything else - it's the documented, known tradeoff for this exact symptom in the wider Wan ecosystem, and this pack's implementation carries the same behavior.

CategoryCogVideoXFUNWrapper

Inputs (16)

NameTypeDefaultDescription
funmodelsFunModels
promptSTRING_PROMPT
negative_promptSTRING_PROMPT
video_lengthINT815–161
base_resolutionCOMBO6406 options: 512, 640, 768, 896, 960, 1024
seedINT430–18446744073709550000
stepsINT501–200
cfgFLOAT6.001–20
schedulerCOMBOFlow1 options: Flow
teacache_thresholdFLOAT0.1000–1
enable_teacacheCOMBOtrue2 options: false, true
num_skip_start_stepsINT50–50
teacache_offloadCOMBOtrue2 options: false, true
cfg_skip_ratioFLOAT0.000–1
start_imgoptIMAGE
riflex_koptRIFLEXT_ARGS

Outputs (1)

NameTypeDescription
imagesIMAGE