Temporally Consistent Object Editing in Videos using Extended Attention
AmirHossein Zamani, Amir G. Aghdam, Tiberiu Popa, Eugene Belilovsky
TL;DR
The paper tackles the challenge of localized, temporally coherent video editing. It introduces a framework that substitutes self-attention with Extended Attention in a pre-trained inpainting Stable Diffusion model, enabling cross-frame dependencies without fine-tuning and handling arbitrary mask shapes. By processing frames with a mask and text prompts over $T=50$ diffusion steps and using a frame-aware pre-processing stage, the method achieves consistent edits across frames for tasks such as object retargeting, replacement, and removal. Quantitative and qualitative results on BANMo, DAVIS, and YouTube-VOS demonstrate competitive fidelity and robust temporal coherence, with ablations validating key design choices and demonstrating memory-friendly modifications to the diffusion model.
Abstract
Image generation and editing have seen a great deal of advancements with the rise of large-scale diffusion models that allow user control of different modalities such as text, mask, depth maps, etc. However, controlled editing of videos still lags behind. Prior work in this area has focused on using 2D diffusion models to globally change the style of an existing video. On the other hand, in many practical applications, editing localized parts of the video is critical. In this work, we propose a method to edit videos using a pre-trained inpainting image diffusion model. We systematically redesign the forward path of the model by replacing the self-attention modules with an extended version of attention modules that creates frame-level dependencies. In this way, we ensure that the edited information will be consistent across all the video frames no matter what the shape and position of the masked area is. We qualitatively compare our results with state-of-the-art in terms of accuracy on several video editing tasks like object retargeting, object replacement, and object removal tasks. Simulations demonstrate the superior performance of the proposed strategy.
