Qwen-Video-Edit: Wan 2.1 Video Editing with ComfyUI Nodes

ComfyUI Wiki

Qwen-Video-Edit edits Wan 2.1 video-VAE latents with Qwen-Image-Edit's DiT from plain text instructions, shipped as a ComfyUI custom-node pack.

Q

Qwen-Video-Edit

Video EditingInstruction-BasedWan 2.1ComfyUICustom Nodes

Instruction-based video editing that repurposes Qwen-Image-Edit's DiT to edit Wan 2.1 video-VAE latents. Source frames are encoded by a frozen Wan 2.1 VAE, mapped into the editor's token space by two warm-started projections, and edited from a text instruction, with an optional Wan 2.2 denoising-enhancement stage.

DeveloperYunpeng Bai, Yossi Gandelsman, Michaël Gharbi, Qixing Huang
Release Date2026-08-14 (code, paper, 360P), 2026-08-20 (ComfyUI support, 480P and 720P)
ArchitectureQwen-Image-Edit DiT editing Wan 2.1 video-VAE latents, with trainable in/out projections and grid positional encoding
Base ModelQwen-Image-Edit with a frozen Wan 2.1 video VAE
Text EncoderQwen2.5-VL branch encoding the instruction with a source-frame preview grid
OutputEdited video chunks of 45 or 81 frames, from 360P to 720P
LicenseMIT

How it works

The pipeline keeps a frozen Wan 2.1 video VAE at both ends. Source frames are encoded to 16-channel video latents, two small trainable projections map those latents into the Qwen-Image-Edit DiT's token space, and the edited latents are decoded back to video. The in-projection is a Conv3d(16 -> D, k=(1,2,2)) initialized from the DiT's own img_in, and the out-projection is initialized from proj_out, which makes the bridge mathematically exact at step 0: a static video is embedded identically to an image the editor already handles. Because the model can edit video tokens from the first step, training only has to learn the distribution shift, either as a LoRA or as a full fine-tune.

Frame identity is preserved by grid positional encoding. The latent frames are laid out as tiles of one virtual large image, each keeping its own spatial offset, so the editor's existing prior and its image positional encoding apply unchanged. This is implemented as a runtime patch of DiffSynth's QwenEmbedRope rather than vendored model code. The instruction side is handled by a Qwen2.5-VL branch that encodes the prompt together with a preview grid of the source frames.

An optional denoising-enhancement stage re-noises the edited latents for a few steps and denoises them with Wan 2.2, taken from the Ditto codebase. The ComfyUI pack exposes it as a mandatory node so that the default workflow already produces the cleaned-up result.

Checkpoints

Fine-tuned checkpoints are named after the Ditto-1M training subset and the chunk length they support. There are global, local and sim2real variants at 480P, a 720P model trained on the global plus local subsets, and 81-frame models for longer chunks, with the 360P global plus local checkpoint as the recommended starting point. --num_frames and --video_max_pixels must match the checkpoint's training configuration, and every checkpoint uses latent_mode wan_compressed with pe_mode grid, so the loader settings in ComfyUI have to match the file that is loaded. All checkpoints are published on Hugging Face, and the recommended ones are mirrored on ModelScope.

ComfyUI

The repository doubles as a ComfyUI custom-node pack with single-chunk semantics: one sampler call edits one num_frames window, and long videos are edited chunk by chunk. Three nodes are registered under the QwenVideoEdit category:

  • Qwen-Video-Edit Loader loads the DiT, text encoder, VAE and the fine-tuned checkpoint, and exposes the latent_mode and pe_mode settings that must match the checkpoint
  • Qwen-Video-Edit Sampler (one chunk) edits one chunk and takes the prompt, num_frames, max_pixels, steps, cfg_scale and seed
  • Wan2.2 Enhance (Ditto) runs the denoising enhancement and takes wan22_ckpt_dir, enhance_steps and offload

Video loading and combining come from ComfyUI-VideoHelperSuite. The base Qwen-Image-Edit and Wan 2.1 weights are downloaded automatically on the first run, roughly 55 GB in total, and the enhancement stage needs Wan 2.2 T2V-A14B on top of that.

Resources

Guides and workflows related to this model series.

No articles found.

Comments

Sign in with GitHub to join the discussion.

Loading comments…