UniCtrl: Improving the Spatiotemporal Consistency of Text-to-Video Diffusion Models via Training-Free Unified Attention Control

Tian Xia, Xuweiyi Chen, Sihan Xu

TL;DR

This paper introduces UniCtrl, a training-free, plug-and-play method to significantly improve the temporal consistency of text-to-video diffusion models. By unifying attention control mechanisms, UniCtrl enhances semantic consistency across frames while preserving motion diversity, making it universally applicable to existing video generation models.

What Problem Does This Paper Address?

Generating realistic and consistent videos from text prompts is a major challenge for diffusion models. While these models excel at image generation, maintaining semantic coherence and smooth motion across consecutive frames in a video remains difficult. Existing text-to-video models often struggle with temporal inconsistencies, leading to flickering objects, unnatural transitions, and a lack of overall visual stability. This paper aims to bridge this gap by proposing a method that enhances spatiotemporal consistency without requiring any additional training.

Methods

UniCtrl is a novel, plug-and-play framework that integrates three key techniques:

  • Cross-Frame Self-Attention Control (SAC): This method leverages the observation that attention keys and values play a crucial role in determining spatial and semantic information, respectively. By using the keys and values from the first frame across all self-attention layers in subsequent frames, UniCtrl enforces semantic consistency.
  • Motion Injection (MI): To counteract the potential loss of motion diversity that can arise from strict consistency, UniCtrl introduces a motion branch. This branch preserves the original queries (which control spatial information and motion) from the base model, ensuring that motion is not sacrificed for consistency. A "motion injection degree" parameter controls the trade-off between consistency and motion.
  • Spatiotemporal Synchronization (SS): To further enhance consistency, SS synchronizes the latent representation of the motion branch with the output branch's latent state before each sampling step. This ensures that the motion branch starts from a consistent spatial context, bridging the gap between the two branches.

These three components are unified into a single framework that can be applied during inference without any parameter tuning.

Datasets

The paper evaluates UniCtrl on prompts from two standard video datasets:

  • UCF-101: A dataset of human actions in videos.
  • MSR-VTT: A large-scale dataset for video captioning and retrieval.

The authors state they used prompts from UCF-101 and randomly selected 100 unique prompts from MSR-VTT for their evaluation.

Key Insights and Ideas

  • Attention is Key (and Value) to Consistency: The core idea is that by controlling the attention mechanism, specifically by reusing information from the initial frame, we can enforce consistency across video frames. This is a powerful insight into how diffusion models process temporal information.
  • Balancing Act: Consistency vs. Motion: A critical challenge in video generation is maintaining both temporal consistency and natural motion. UniCtrl's dual-branch approach (output branch for consistency, motion branch for motion) and the tunable motion injection degree highlight the authors' understanding of this trade-off.
  • Training-Free Universality: The most significant insight is that these improvements can be achieved without any additional training. This makes UniCtrl a highly practical and broadly applicable tool for enhancing existing text-to-video models.

Key Results

UniCtrl demonstrates significant improvements across various metrics and backbones:

  • Quantitative Improvements: UniCtrl consistently improves DINO scores (measuring spatiotemporal consistency) across backbones like AnimateDiff, VideoCrafter, and AnimateLCM, with improvements ranging from 2.12 to 2.44. It also shows substantial gains in FVD and FVMD scores, indicating better video quality and motion consistency.
  • Motion Preservation: While improving consistency, UniCtrl effectively preserves motion diversity. In some cases, it outperforms baselines like FreeInit in motion strength by a significant margin (11.67 to 17.65).
  • Qualitative Examples: Figures and tables showcase UniCtrl's ability to generate videos with remarkably consistent objects and backgrounds, while maintaining fluid and natural motion. For instance, in the "walking with a dog" example, UniCtrl ensures consistent appearances of both the lady and the dog, unlike FreeInit.
  • Component Contributions: Ablation studies confirm the necessity of each component (SAC, MI, SS) for achieving the overall performance gains. SAC is crucial for spatiotemporal consistency, MI for motion diversity, and SS for bridging the gap between the two.

Limitations and Future Work

The authors acknowledge several limitations:

  • Attention Mechanism Dependency: UniCtrl's reliance on the attention mechanism means it cannot be applied to models that do not utilize this component.
  • Color Consistency: Ensuring the same values across frames limits the ability to change colors within the video, thus restricting color manipulation.
  • Spatial Consistency: While spatiotemporal consistency is improved, complete spatial consistency across all frames is not yet guaranteed. The authors suggest controlling temporal attention blocks as a future direction.
  • Inference Speed: The need for additional computation to preserve motion queries slightly affects inference speed.

Future work could involve addressing these limitations, particularly by exploring temporal attention control for enhanced spatial consistency and optimizing inference speed.

Summary updated

BibTeX
@article{xia2024unictrl,
  author = {Tian Xia and Xuweiyi Chen and Sihan Xu},
  title = {{UniCtrl: Improving the Spatiotemporal Consistency of Text-to-Video Diffusion Models via Training-Free Unified Attention Control}},
  journal = {Accepted by TMLR},
  year = {2024},
  url = {https://openreview.net/forum?id=x2uFJ79OjK},
}
Figure