Introduction
Video inpainting—the process of erasing objects or filling missing regions in a video sequence—requires a delicate balance between high-quality spatial generation and rock-solid temporal consistency. While current state-of-the-art models like ProPainter utilize optical flow and Transformers to fill gaps, they often struggle with large "holes" or complex backgrounds. These models frequently produce blurry, low-detail textures known as "mosaic artifacts" because Transformers lack the deep generative capabilities of diffusion models.
However, standard Diffusion Models are not a simple drop-in solution; they are prone to "hallucinating" random objects and often fail to maintain consistency across long sequences. DiffuEraser addresses these challenges by combining the generative power of Stable Diffusion with structural guidance from traditional flow-based methods and an expanded temporal receptive field.
Methods
DiffuEraser employs a multi-stage architecture designed to prioritize both detail and stability:
- Dual-Branch Architecture: The framework is built on BrushNet, a dual-branch diffusion model. One branch handles the primary denoising process, while the other extracts features from masked images. To ensure temporal coherence, motion modules inspired by AnimateDiff are integrated into the pipeline.
- Injected Priors via DDIM Inversion: To prevent the model from hallucinating unwanted content, DiffuEraser uses a lightweight model (such as ProPainter) to generate a "rough draft." This draft undergoes DDIM Inversion to become the initial noise for the diffusion process. This "warm start" provides a structural hint that guides the final high-quality generation.
- Staggered Denoising: To eliminate seams between video clips, the model uses a staggered inference approach. Even-numbered timesteps are inferred from the start of a clip, while odd-numbered ones are sampled from the midpoint, leveraging the inherent smoothing properties of Video Diffusion Models (VDMs).
- Expanded Temporal Receptive Field: Unlike standard models that only see a few frames, DiffuEraser performs a sparse "pre-inference" pass across the entire video. This establishes a global context that guides frame-by-frame generation, preventing the "drift" where backgrounds change color or texture over time.
Datasets and Training
The model was trained on a massive scale using the Panda-70M dataset, filtered down to approximately 3.18 million high-quality short video clips with captions. Training followed a two-stage strategy: first, spatial inpainting (BrushNet) was trained on static images, followed by training the motion modules on 22-frame sequences to ensure temporal smoothness.
Key Insights
- Refinement over Generation: Diffusion models are more stable when acting as "super-resolution and detail-enhancement" engines rather than generating from scratch. Using a blurry prior significantly reduces hallucinations.
- Temporal Smoothing via Denoising: The denoising process itself can blend transitions between video segments when clips are overlapped and timesteps are staggered, removing the need for expensive post-processing.
- Global Vision: A sparse global pass is essential for long-term consistency, ensuring the beginning and end of a 10-second clip remain visually identical.
Key Results
DiffuEraser demonstrates significant improvements over existing Transformer-based methods in both texture and stability:
- Superior Texture: Qualitative results show that DiffuEraser recovers fine details, such as brick textures or clothing folds, that other models typically blur.
- Temporal Stability: In object removal tasks, the model exhibits significantly less flickering at the boundaries of erased areas compared to ProPainter.
- Efficiency: By utilizing Phased Consistency Models (PCM), DiffuEraser achieves high-quality results in just 2 denoising steps. Processing a 10-second, 540p video at 25 FPS takes approximately 200 seconds on an NVIDIA L20 GPU.
Limitations and Future Work
Despite its performance, DiffuEraser has higher computational overhead than pure GAN or Transformer approaches. Future work will focus on further optimizing speed and exploring the application of these "injected prior" techniques to other video tasks, such as stylization and object replacement.
Summary updated