NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

VideoGrain: Modulating Space-Time Attention for Multi-grained Video Editing

Xiangpeng Yang, Linchao Zhu, Hehe Fan, Yi Yang · DOI

Introduction

While text-to-video diffusion models have achieved remarkable generative capabilities, the task of precise video editing remains a significant challenge. Current frameworks often struggle with multi-grained editing, where specific instances or individual parts of an object need to be modified independently. A common failure mode is "feature bleeding," where attributes intended for one subject (e.g., "Iron Man") erroneously leak into another subject (e.g., "Spider-Man") because the model perceives them as belonging to the same semantic class.

To address this, VideoGrain introduces a zero-shot, training-free framework that modulates the internal attention mechanisms of diffusion models. By controlling how features interact across space and time, VideoGrain enables high-fidelity, instance-level edits without requiring model fine-tuning or complex optimization loops.

The Core Challenge: Feature Coupling

The researchers identify two primary technical hurdles that prevent fine-grained control in standard diffusion-based video editing:

  1. Semantic Misalignment: Global text prompts are typically applied uniformly across all pixels. Without spatial guidance, the model lacks the mechanism to restrict a specific prompt token to a localized region, leading to global attribute shifts rather than targeted edits.
  2. Feature Coupling: Diffusion models naturally group similar objects within their internal feature space. In self-attention layers, pixels representing one instance often attend to pixels of another similar instance. This "coupling" results in texture mixing and inconsistent identities across the video sequence.

Methodology: Spatial-Temporal Layout-Guided Attention

VideoGrain solves these issues through Spatial-Temporal Layout-Guided Attention (ST-Layout Attn), a unified approach to modulating the attention layers of a frozen Stable Diffusion model. The method operates on two fronts:

Cross-Attention Modulation

To resolve semantic misalignment, VideoGrain amplifies the attention scores of local prompts (e.g., "Iron Man") within their corresponding spatial regions while suppressing them elsewhere. This ensures that specific tokens only influence the intended coordinates, preventing the "Iron Man" features from appearing on a different subject in the frame.

Self-Attention Modulation

To break feature coupling, the framework modifies the Query-Key ($QK^\top$) interaction matrix. It increases "intra-region awareness" (encouraging pixels to attend to others within the same object) and reduces "inter-region interference" (preventing pixels from attending to different objects). By manually breaking the symmetry in the self-attention layer, the model is forced to treat distinct instances as separate entities, even if they belong to the same class.

The Zero-Shot Pipeline

The process begins with a standard DDIM inversion of the source video. VideoGrain utilizes instance masks—which can be obtained via SAM-Track or even coarse K-means clusters derived from the model's own features—to guide the attention modulation. During the denoising process, the ST-Layout Attn is injected to steer the generation toward the desired multi-grained edit.

Experimental Results and Insights

VideoGrain was evaluated on a dataset of 76 video-text pairs, including benchmarks like DAVIS and TGVE, as well as real-world footage. The results demonstrate significant improvements over state-of-the-art baselines such as FateZero, TokenFlow, and Ground-A-Video.

  • Quantitative Performance: VideoGrain achieved the highest scores in CLIP-T (text alignment) and Edit-Accuracy. Notably, its Q-edit score—a composite metric for editing quality—reached 25.75, substantially higher than the next best competitor at 16.63.
  • Qualitative Superiority: The method excels at "identity swaps" and "part-level" edits. For example, it can successfully change a specific person's clothing or add accessories like sunglasses to one individual in a crowd while leaving others untouched.
  • Efficiency: As a training-free method that re-engineers attention slices, VideoGrain is highly efficient. It can process a 16-frame edit in approximately 3.83 minutes on an NVIDIA A6000 GPU.

Conclusion and Future Work

VideoGrain demonstrates that the primary bottleneck for fine-grained video control lies in the attention mechanism rather than the generative capacity of the base model. By modulating spatial-temporal interactions, it provides a robust solution for instance-level editing.

However, the method is currently constrained by the capabilities of its base model (Stable Diffusion v1.5) and struggles with massive structural deformations, such as changing a human's skeletal structure. Future work may involve integrating motion priors from more advanced text-to-video foundation models to handle significant shape transformations while maintaining the precise control offered by ST-Layout Attention.

Summary updated

BibTeX
@inproceedings{yang2025videograin,
  author = {Xiangpeng Yang and Linchao Zhu and Hehe Fan and Yi Yang},
  title = {{VideoGrain: Modulating Space-Time Attention for Multi-grained Video Editing}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=SSslAtcPB6},
}
Figure