← Workflows

Wan 2.2 Image-to-Video (context windows)

Image → Video

Image-to-video past the model's 81-frame limit, generated as ONE clip instead of a chain. ComfyUI samples the whole length in overlapping context windows and fuses them, so the action carries across the joins — use this instead of taking a clip's last frame and animating it again, which hands the model a still and restarts the motion from rest.

wan22_i2v_context12 GB VRAM36.8 GB of weightsLoRA support

Calling it

FlixML has no generate button: you tell your agent what you want and it calls the API on your install. The id is what names this workflow.

POST /api/video/generate
{
  "workflow": "wan22_i2v_context",
  "prompt": "...",
  "image": "..."
}

Parameters

promptstrrequired

Motion prompt. Name an action a viewer could describe afterwards - she stands up and walks toward the camera, he throws the bag over his shoulder. Add a camera instruction on top of it, never instead of it. Words like subtle, slowly or gently are instructions to do nothing. One sustained action works better here than a sequence: every window reads the same prompt, so asking for a beginning and an end gives you neither.

imagestrrequired

Input image filename. With cond_retain_index_list at "0" it anchors the subject and set in every window, not just the first.

negative_promptstrdefault bright colors, overexposed, static, blurred details
widthintdefault 480
heightintdefault 832
lengthintdefault 161

Total frame count, must be 4k+1. 161 frames at 16 fps is about 10 seconds. This is the whole point of the workflow: set it past 81 and the windows handle the rest.

context_lengthintdefault 21

Window size in LATENT frames, not real frames - Wan packs 4 real frames into 1 latent, so 21 latent is the model's native 81 real frames ((81-1)/4+1). This sets the per-step VRAM cost. Keep at 21.

context_overlapintdefault 12

Latent frames shared between neighbouring windows; 12 latent is 48 real frames. This overlap is what carries the motion across a join, so it is the knob to raise if the action stutters or the face shifts mid-clip. Measured 2026-09-17: at 7 latent (28 real) a 161-frame clip showed a visible artefact where the second window blends in, and 12 removed it. Raising it also adds windows, so it costs time.

cond_retain_index_liststrdefault 0

Pins the start image into EVERY window instead of only the first. Leave at "0". Measured 2026-09-17: with this empty, only the first window is anchored to the image, and a 161-frame clip ended on a different subject in a different location than it started - each later window invents its own. Set it empty only if you want the clip free to wander.

context_schedulestrdefault standard_static

standard_static cuts the clip into fixed sequential windows, each starting context_length - context_overlap frames after the last, and reuses that same set on every step - which is what a one-way action wants. standard_uniform instead re-picks strided windows per step from a shifting offset, and looped_uniform lets them wrap around to the start; both come from AnimateDiff's scheduler and suit looping or ambient motion. Read from comfy/context_windows.py, create_windows_static_standard vs create_windows_uniform_standard.

fuse_methodstrdefault pyramid

How overlapping windows are blended. pyramid weights the middle of each window highest.

fpsintdefault 16
seedint
steps_highintdefault 2

2+2=4, the Lightning LoRA authors' own reference config. Defaults here match that reference rather than the tuned numbers in wan22_i2v: over a clip this long the tuned high-noise CFG blows the exposure out within the first window.

steps_lowintdefault 2

See steps_high. 2+2=4.

total_stepsintdefault 4

steps_high + steps_low; passed to KSamplerAdvanced.steps

cfg_highfloatdefault 1

The authors' reference value. At 1.0 there is no unconditional branch, so negative_prompt is not evaluated.

cfg_lowfloatdefault 1
shiftfloatdefault 5
samplerstrdefault euler
schedulerstrdefault simple
vaestrdefault Wan2.1_VAE.safetensors
clipstrdefault umt5_xxl_fp8_e4m3fn_scaled.safetensors
high_modelstrdefault wan2.2_i2v_high_noise_14B_fp8_scaled.safetensors
low_modelstrdefault wan2.2_i2v_low_noise_14B_fp8_scaled.safetensors
high_lorastrdefault Wan2.2-Lightning_I2V-A14B-4steps-lora_HIGH_fp16.safetensors
low_lorastrdefault Wan2.2-Lightning_I2V-A14B-4steps-lora_LOW_fp16.safetensors
high_lora_strengthfloatdefault 1

The authors' reference value.

high_lora_2strdefault

Optional second LoRA stacked after the speed LoRA - this is where a motion or concept LoRA goes, e.g. a dance or action LoRA trained for Wan 2.2 i2v. Leave empty and the slot is removed from the graph entirely. Wan 2.2 LoRAs ship as a high/low pair: set both.

high_lora_2_strengthfloatdefault 1

Weight of the second high-noise LoRA. Ignored when high_lora_2 is empty.

low_lora_strengthfloatdefault 1
low_lora_2strdefault

Low-noise half of the pair in high_lora_2. Leave empty to disable.

low_lora_2_strengthfloatdefault 1

Weight of the second low-noise LoRA. Ignored when low_lora_2 is empty.

Your install is the source of truth: GET /api/workflows returns these parameters as they are on your machine.

What it costs to run

Sampling VRAM is set by context_length, not by length, so a 161-frame clip costs the same per step as an 81-frame one and just runs more windows; 161 frames measured at 368 s on a 12 GB RTX 4070 Ti against 184 s for 81 frames. The VAE decode at the end scales with the full length; ComfyUI falls back to tiled decoding automatically if it runs out of memory there (comfy/sd.py, VAE.decode). Uses the generic ContextWindowsManual node with dim=2 rather than WanContextWindowsManual: on ComfyUI 0.18.1 the Wan-specific node has no retain-first-frame control, and without it the later windows lose the subject entirely.

Same input, different job