Elevating Flow-Guided Video Inpainting with Reference Generation

Suhwan Cho, Seoung Wug Oh, Sangyoun Lee, Joon-Young Lee

TL;DR

RGVI (Reference-Guided Video Inpainting) is a new framework that decouples video inpainting into two distinct tasks: high-fidelity pixel propagation and powerful reference generation. By using a novel "one-shot pixel pulling" technique to prevent blurriness and leveraging Stable Diffusion to hallucinate missing content, it achieves state-of-the-art results on high-resolution (2K+) videos and enables text-guided object replacement.

What Problem Does This Paper Address?

Video Inpainting (VI) is the art of removing objects from a video and filling the resulting "holes" seamlessly. This requires two different skills:

  1. Propagation: Copying pixels from other frames where the background was visible (e.g., if a car moves, the road behind it is revealed in later frames).
  2. Generation: Hallucinating new content when the background is never visible anywhere in the video.

Existing methods often struggle to balance these. "End-to-end" models that try to do both at once often produce blurry results or fail to maintain temporal consistency. "Flow-based" methods, which use optical flow to move pixels around, often suffer from re-sampling artifacts—a cumulative blurring effect caused by repeatedly interpolating pixel values across frames. Furthermore, most current models fail when faced with high-resolution 2K video due to massive memory requirements.

Methods

The authors propose a decoupled pipeline called RGVI, visualized in the figure below:

Figure 2: Overall pipeline of RGVI.

The framework consists of four main stages:

  1. Internal Pixel Propagation (One-Shot Pixel Pulling): Instead of the standard approach of warping color values frame-by-frame (which causes blur), RGVI warps the optical flow fields themselves. It chains these flows to create a global map, then "pulls" the color from the source frame to the target frame in a single step. This preserves sub-pixel accuracy without the "telephone game" blur of repeated sampling.
  2. Reference Generation: For areas that cannot be filled by propagation, the system selects a "key frame"—the frame that, if filled, would provide the most information to the rest of the video. It then uses Stable Diffusion to fill this frame. This allows for "Generation Mode," where users can use text prompts to replace objects (e.g., replacing a bear with a "sleeping cat").
  3. Reference Propagation: The high-quality content generated by Stable Diffusion is then spread to all other frames using the same one-shot pulling mechanism.
  4. Per-Frame Completion: A lightweight CNN performs a final pass to fix tiny remaining holes or unreliable pixels identified by a bi-directional verification protocol.

Additionally, they introduce a trick for occlusion handling: by providing a "positive mask" for objects that should stay in front of the inpainted area, they prevent "color bleeding" where the background accidentally smears onto foreground objects.

Datasets

The authors trained their per-frame network on YouTube-VOS 2018. For evaluation, they used:

  • DAVIS 2016 & YouTube-VOS 2018: Standard benchmarks for video restoration.
  • HQVI (High-Quality Video Inpainting): A new benchmark introduced in this paper. Unlike older datasets that use random shapes to mask videos, HQVI uses realistic objects and alpha matte composition to simulate real-world editing. It features 2K resolution videos and specific scenarios for object removal, texture replacement, and complex occlusions.
Figure 4: Example videos from the HQVI dataset. Nega- tive masks are highlighted in green, while positive masks are highlighted in red.

Key Insights and Ideas

  • Warp Flows, Not Pixels: The "aha moment" for propagation is that optical flow is inherently smoother than color data. Warping the flow maps and then doing a single color lookup prevents the blurry "smearing" common in recurrent warping methods like ProPainter or E2FGVI.
  • Decoupling is a Feature, Not a Bug: By separating generation from propagation, the authors can plug in the best available tools for each (RAFT for flow, Stable Diffusion for generation) without them interfering with each other's training objectives.
  • Key Frame Optimization: Rather than generating content for every frame (which is slow and inconsistent), identifying a single "most influential" frame to generate and then propagating that content ensures much better temporal stability.

Key Results

RGVI demonstrates a clear lead over previous state-of-the-art (SOTA) methods like ProPainter and FuseFormer:

  • Visual Quality: As seen in Figure 1, RGVI maintains much sharper textures and more realistic structures in complex areas like fences or rocky terrain.
  • Quantitative Performance: On the HQVI dataset at 480p, RGVI achieved a VFID (Video Frechet Inception Distance) of 0.0311, significantly better than ProPainter's 0.0478, indicating much higher perceptual realism.
  • Scalability: RGVI is one of the few frameworks capable of processing 2K resolution (1200x2160) video on a single consumer-grade GPU (Titan RTX) without running out of memory.
  • User Preference: In a user study, RGVI was ranked as the best-performing method by a significant margin.
Figure 1: Qualitative comparison between RGVI and state-of-the-art methods.

Limitations and Future Work

While powerful, RGVI still relies heavily on the quality of the underlying optical flow. If the flow estimation (via RAFT) fails—common in extremely fast motion or motion blur—the inpainting will show structural misalignments. Additionally, while Stable Diffusion provides high-quality references, the generated content can occasionally look "unnatural" or out of place in the specific lighting of the original video. The authors suggest that integrating even more robust generative models and improving flow completion in occluded areas are the next logical steps.

Summary updated

BibTeX
@inproceedings{cho2025elevating,
  author = {Suhwan Cho and Seoung Wug Oh and Sangyoun Lee and Joon-Young Lee},
  title = {{Elevating Flow-Guided Video Inpainting with Reference Generation}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i3.32255},
}
Figure