Abstract
VideoPainter introduces a highly efficient, dual-branch Diffusion Transformer (DiT) framework for text-guided video inpainting and editing. By decoupling background preservation from foreground generation using a lightweight plug-and-play context encoder and introducing a novel ID resampling technique, it achieves state-of-the-art consistency for videos of any length. This work also presents VPData, the largest video inpainting dataset to date, containing over 390K annotated clips.
Introduction
Video inpainting—the task of restoring missing, corrupted, or masked parts of a video—is essential for film production, object removal, and virtual try-ons. Current methodologies generally follow two paradigms: non-generative methods, which rely on optical flow and fail to generate new content, and generative methods, which often struggle to balance background preservation with foreground generation. Forcing a single neural network branch to simultaneously maintain the unmasked background and generate a text-aligned foreground creates a competing objective, leading to background degradation and identity (ID) drift in long videos.
VideoPainter addresses these challenges by shifting to a dual-branch architecture that efficiently injects dense background context into a powerful, pre-trained video generative model without compromising its prior knowledge or temporal consistency.
Methodology
Dual-Branch Architecture and Token-Selective Integration
VideoPainter utilizes a frozen pre-trained DiT backbone and introduces a Lightweight Context Encoder. This encoder, representing only 6% of the backbone's parameters, processes the masked video, noise latent, and mask. To prevent signal confusion, a Token-Selective Integration mechanism ensures that only features representing the pure background are injected back into the frozen backbone.
ID-Resample Adapter for Long-Term Consistency
To handle videos of arbitrary length, VideoPainter employs a Target Region ID Resampling technique. During inference, tokens from the previously inpainted region are concatenated directly to the current clip's Key-Value (KV) vectors in the attention layers. This explicitly forces the model to maintain the visual identity of generated objects across temporal boundaries.
Plug-and-Play Capability
Because the primary DiT remains frozen, VideoPainter is a plug-and-play solution. It can be seamlessly attached to various base models or community-finetuned style LoRAs without requiring extensive retraining.
Data Construction: VPData and VPBench
A significant contribution of this work is the creation of VPData, an automated pipeline using foundation models (SAM2, CogVLM2, GPT-4o) to generate over 390K high-quality clips (>866 hours). Each clip includes precise segmentation masks and dense descriptions of both the scene and the masked regions. Evaluation is conducted on VPBench, a comprehensive benchmark for standard inpainting, long-video consistency, and video editing.
Experimental Results
Quantitative and Qualitative Performance
VideoPainter outperforms state-of-the-art (SOTA) baselines such as ProPainter and COCOCO across multiple metrics. On VPBench, it achieved the highest PSNR (23.32) and SSIM (0.89) for background preservation, alongside superior CLIP Similarity (21.49) for text alignment. Qualitatively, VideoPainter avoids the common pitfalls of its competitors, such as failing to generate fully masked objects or introducing significant artifacts at mask boundaries.
Video Editing and Long Video Consistency
By modifying text prompts, VideoPainter serves as a robust video editor. In human evaluations, it achieved an 81.7% user preference win rate for quality against dedicated editing models. Furthermore, the ID-Resample technique allows for coherent video generation exceeding one minute, maintaining identity where other models suffer from terrain shifts or object morphing.
Conclusion
VideoPainter provides a scalable and efficient solution for video inpainting by decoupling background and foreground tasks. While its performance is currently capped by the capabilities of the underlying DiT backbone, its plug-and-play nature ensures it will naturally improve as more powerful base models are developed. Future work will focus on enhancing physical and motion modeling within this dual-branch framework.
Summary updated