PEEKABOO: Interactive Video Generation via Masked-Diffusion

Yash Jain, Anshul Nasery, Vibhav Vineet, Harkirat S. BehlCVPR 2023

Abstract

Modern video generation models like Sora have achieved remarkable success in producing high-quality videos. However, a significant limitation is their inability to offer interactive control to users, a feature that promises to open up unprecedented applications and creativity. In this work, we introduce the first solution to equip diffusion-based video generation models with spatio-temporal control. We present PEEKABOO, a novel masked attention module, which seamlessly integrates with current video generation models offering control without the need for additional training or inference overhead. To facilitate future research, we also introduce a comprehensive benchmark for interactive video generation. Our extensive qualitative and quantitative assessments reveal that PEEKABOO achieves up to a 3.8x improvement in mIoU over baseline models, all while maintaining the same latency.

Introduction: The Challenge of Steering Video

While generative video models have reached staggering levels of visual quality, they remain notoriously difficult to "steer." If a user wants a panda to play peekaboo behind a specific bamboo stalk or a bald eagle to fly in a very particular arc, standard text-to-video models offer little help—the user is largely at the mercy of the model's random seeds.

Examples of interactive video generation using PEEKABOO, showing precise control over object location and trajectory.

Existing solutions for "controllable" generation usually fall into two camps: heavyweight adapters like ControlNet, which require expensive retraining for every new base model, or inference-time optimization methods that use external guidance, often doubling or tripling generation time. PEEKABOO offers a "third way": a plug-and-play module that requires zero training and adds zero latency.

Methods: Masked Spatio-Temporal Mixed Attention

The core innovation of PEEKABOO is the enforcement of "local context" during the critical early stages of the diffusion process. Instead of letting every pixel attend to every other pixel globally, PEEKABOO applies specialized masks to the model's internal attention layers.

The Spatio-Temporal Attention module architecture, featuring spatial, cross, and temporal attention masks.

The module modifies three specific attention layers within the standard 3D UNet architecture:

  • Masked Cross-Attention ($M_{CA}$): Ensures that specific text tokens (e.g., "Eagle") only influence pixels within the user-defined bounding box. This is the most critical lever for spatial control.
  • Masked Spatial-Attention ($M_{SA}$): Prevents foreground pixels from "seeing" background pixels early on, allowing the object and its environment to evolve independently before merging. This creates the "Peekaboo" effect, preventing feature bleeding.
  • Masked Temporal-Attention ($M_{TA}$): Ensures object consistency across time by forcing pixels to attend to the same object's location in previous and future frames along its specified trajectory.

Crucially, this masking is only applied for a small number of initial denoising steps. After this "seeding" phase, the masks are removed, allowing the model's natural priors to seamlessly blend the foreground object into the background.

Evaluation and Key Results

To evaluate PEEKABOO, the authors introduced the SSv2-ST (Spatio-Temporal) and IMC (Interactive Motion Control) benchmarks, alongside standard datasets like DAVIS16 and LaSOT.

Key findings include:

  • Superior Accuracy: PEEKABOO achieved a 2.9× to 3.8× improvement in mIoU (Mean Intersection over Union) over baseline models like ZeroScope. Generated objects were significantly more likely to match the intended size and location.
  • Zero Latency: Because masking is a simple binary multiplication during attention calculation, it adds virtually no computational overhead (1.03x vs. 2.2x for competing guidance methods).
  • Correcting Model Failures: PEEKABOO can fix "numeracy failures." If a model generates three objects when asked for one, the spatial mask forces focus on a single location, correcting the count.

Limitations and Future Work

While powerful, PEEKABOO faces challenges when there is a mismatch between the mask size and the subject's natural scale, or when a text prompt's motion contradicts the provided trajectory. Future work aims to extend this training-free control to image-to-video tasks and long-form video generation.

Summary updated

BibTeX
@inproceedings{jain2023peekaboo,
  author = {Yash Jain and Anshul Nasery and Vibhav Vineet and Harkirat S. Behl},
  title = {{PEEKABOO: Interactive Video Generation via Masked-Diffusion}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
  url = {https://openreview.net/forum?id=77uKULYqin},
}
Figure