DreamSwapV: Mask-guided Subject Swapping for Any Customized Video Editing

Weitao Wang, Zichen Wang, Hongdeng Shen, Yulei Lu, Xirui Fan, Suhui Wu, Jun Zhang, Haoqian Wang, Hao Zhang

Abstract

DreamSwapV is a novel, end-to-end diffusion framework designed for seamless subject swapping in videos using a single reference image and a mask. By framing subject swapping as a video inpainting task, the model effectively blends new subjects into existing environments. The framework introduces an adaptive mask strategy to prevent shape leakage and a condition fusion module for efficient feature injection. Evaluated on the new DreamSwapV-Benchmark, the method outperforms existing state-of-the-art models in visual fidelity and temporal consistency.

Introduction

The ability to edit subjects within a video—such as changing a character's clothing or swapping a handheld object—while preserving motion and background is a highly sought-after capability in AI video generation. Current approaches typically fall into two categories: domain-specific tools which lack versatility, and general-purpose editors which often struggle with fine details or require intensive per-subject fine-tuning. DreamSwapV bridges this gap by providing a subject-agnostic, tuning-free framework for high-quality video editing.

DreamSwapV enables versatile subject swapping, including human garments and handheld objects, while maintaining high fidelity and temporal consistency.

Methodology

DreamSwapV is built upon the Wan2.1 Diffusion Transformer (DiT) and treats the swapping process as a video inpainting problem. By masking the original subject, the model is tasked with reconstructing the region using a target reference image. This approach ensures the model inherently learns to respect the boundaries and lighting of the original scene.

The DreamSwapV architecture integrates an adaptive mask strategy and a condition fusion module within a 3D VAE and DiT-based pipeline.

Key Technical Innovations

  • Condition Fusion Module: Rather than employing a separate, computationally heavy network like ReferenceNet, DreamSwapV concatenates reference latents directly in the temporal dimension. This approach minimizes overhead and prevents spatial-temporal misalignment.
  • Adaptive Mask Strategy: To avoid "shape leakage"—where the new subject is constrained by the old subject's silhouette—the model uses grid-based mask augmentation. The grid size is scaled inversely to the subject's size, ensuring fine control for large subjects and flexibility for small ones.
  • Shape Augmentation and Tunnel Inpainting: Random geometric shapes are added to mask edges during training to improve background reconstruction. For small objects, "tunnel inpainting" crops a tight region around the mask during inference to focus the model's attention, supported by a specialized loss function.

Experiments and Results

The authors introduced the DreamSwapV-Benchmark, featuring 100 videos and 167 subject instances across various complexities. In quantitative evaluations, DreamSwapV achieved a leading VBench Average of 80.44% and a Total Average of 71.41%. Qualitative user studies further confirmed its superiority in reference detail preservation, subject-environment interaction, and visual fidelity compared to models like Kling 1.6 and AnyV2V. Unlike some commercial models that may regenerate entire backgrounds, DreamSwapV consistently maintains the original video context while executing the swap.

Conclusion

DreamSwapV provides a robust, extensible foundation for video subject swapping. While challenges remain in handling extreme domain gaps between reference images and video contexts, the framework's reliance on a strong inpainting foundation makes it a versatile tool for various video editing tasks, including virtual try-on and object addition. Future work may focus on improving handling for disparate reference-to-video scales.

Summary updated

BibTeX
@inproceedings{wang2026dreamswapv,
  author = {Weitao Wang and Zichen Wang and Hongdeng Shen and Yulei Lu and Xirui Fan and Suhui Wu and Jun Zhang and Haoqian Wang and Hao Zhang},
  title = {{DreamSwapV: Mask-guided Subject Swapping for Any Customized Video Editing}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=xH0pSRWbFi},
}
Figure