Abstract
Text-to-video diffusion models have made remarkable advancements. Driven by their ability to generate temporally coherent videos, research on zero-shot video editing using these fundamental models has expanded rapidly. To enhance editing quality, structural controls are frequently employed in video editing. Among these techniques, cross-attention mask control stands out for its effectiveness and efficiency. However, when cross-attention masks are naively applied to video editing, they can introduce artifacts such as blurring and flickering. Our experiments uncover a critical factor overlooked in previous video editing research: cross-attention masks are not consistently clear but vary with model structure and denoising timestep. To address this issue, we propose the metric Mask Matching Cost (MMC) that quantifies this variability and propose FreeMask, a method for selecting optimal masks tailored to specific video editing tasks. Using MMC-selected masks, we further improve the masked fusion mechanism within comprehensive attention features, e.g., temp, cross, and self-attention modules. Our approach can be seamlessly integrated into existing zero-shot video editing frameworks with better performance, requiring no control assistance or parameter fine-tuning but enabling adaptive decoupling of unedited semantic layouts with mask precision control. Extensive experiments demonstrate that FreeMask achieves superior semantic fidelity, temporal consistency, and editing quality compared to state-of-the-art methods.
Introduction
Zero-shot video editing—modifying a video based on a text prompt without retraining the underlying model—is a major goal for efficient content creation. However, it faces a significant hurdle: structural control. Current methods often rely on external controls like depth maps or optical flow, which add computational overhead and can be too rigid for "shape editing" (e.g., turning a dog into a bear). Alternatively, internal controls using cross-attention maps are efficient but often "noisy" or "blurry," leading to visual flickering and artifacts.
The authors of FreeMask identified that these internal attention masks are not a monolith; their quality fluctuates wildly depending on the specific U-Net layer and denoising timestep. By finding the "Goldilocks zone" of mask precision, FreeMask improves structural control and temporal consistency without requiring external models or fine-tuning.
The Mask Matching Cost (MMC) Metric
To quantify mask precision, the researchers introduced the Mask Matching Cost (MMC). By comparing internal attention maps against ground-truth segmentations from the DAVIS dataset, they calculated LMMC (Layer-wise) and TMMC (Timestep-wise) costs.
Their analysis revealed two key insights:
- The Inverted U-Shape of Precision: Mask accuracy follows an inverted U-curve across U-Net layers. Outermost layers contain too much low-level spatial noise, while innermost layers lack resolution. The most precise structural masks are found in the middle layers.
- Timestep Evolution: Masks become significantly clearer as the denoising process progresses. Early timesteps are often too chaotic to provide reliable fine-grained masks.
The FreeMask Framework
FreeMask uses these insights to implement Semantic-Adaptive Selection. Different tasks require different mask strategies:
- Style or Attribute Editing: For tasks keeping the structure identical, the system uses a high-precision, static mask.
- Shape Editing: For tasks changing an object's silhouette, it uses a "time-aware" mask that starts coarse and becomes finer, allowing the model the creative freedom to warp boundaries early in the denoising process.
Furthermore, FreeMask applies its optimized masks across all attention modules—Temporal-attention (TA), Self-attention (SA), and Cross-attention (CA). This comprehensive masked fusion ensures that motion information and spatial structures are decoupled between edited and unedited regions, preventing edits from "bleeding" into the background.
Experimental Results
FreeMask was tested against state-of-the-art (SOTA) methods including FateZero, TokenFlow, and AnyV2V using the DAVIS dataset and high-quality "in-the-wild" videos from Pexels.
Quantitative Performance: FreeMask achieved the highest scores in Temporal Consistency (CLIP-Temp) and Structure Preservation (Masked PSNR). Notably, it outperformed FateZero in M.PSNR (25.94 vs 22.72), demonstrating its ability to keep unedited background regions clean.
Qualitative Performance: As shown in Figure 6, FreeMask excels in shape-editing tasks. While other zero-shot methods often produce "ghosting" artifacts or fail to change the silhouette entirely, FreeMask successfully modifies the subject (e.g., turning a girl into a bear) while maintaining original motion and background integrity.
Conclusion and Future Work
FreeMask demonstrates that rethinking internal attention masks can significantly advance zero-shot video editing. By identifying optimal layers and timesteps for mask extraction, the framework achieves superior semantic fidelity and temporal consistency without the need for external control signals.
Future work will address current limitations, such as handling complex scenes with multiple objects moving on different trajectories and extending the framework from appearance editing to full motion editing (e.g., making a sitting animal start running).
Summary updated