Live2Diff: Live Stream Translation via Uni-directional Attention in Video Diffusion Models

Zhening Xing, Gereon Fox, Yanhong Zeng, Xingang Pan, Mohamed Elgharib, Christian Theobalt, Kai Chen · DOI

Abstract

Live2Diff is a novel framework that enables high-quality, temporally consistent video-to-video translation at interactive framerates (up to 16 FPS). By introducing a uni-directional temporal attention mechanism with a "warmup" phase and an efficient KV-cache pipeline, it allows for live streaming style transfer without the flickering or identity drift common in previous streaming diffusion models.

Introduction

Diffusion models have revolutionized image and video generation, but applying them to live streaming remains a significant challenge. Most state-of-the-art video diffusion models rely on bi-directional temporal attention, requiring access to both past and future frames. In a live stream, the future is unknown, making these models unusable for real-time applications.

Existing streaming solutions often process frames independently. While fast, this leads to severe flickering because the model lacks temporal memory. Conversely, simply adopting uni-directional attention often fails in video; without a strong initial context, the model's output quickly deviates from the original subject's appearance, a problem known as structural inconsistency.

Methodology

Live2Diff redesigns the video diffusion pipeline for the "next-frame-prediction" paradigm through several key innovations.

Uni-directional Attention with Warmup

Instead of looking at future frames, the model uses a masked attention mechanism. To solve the "cold start" problem, the first few frames of a stream (the "warmup" area) are processed with bi-directional attention. These warmup frames then act as a permanent anchor for all subsequent frames in the stream, ensuring the character's identity and background stay stable.

Comparison of temporal attention mechanisms: (a) standard bi-directional, (b) sliding window, (c) standard uni-directional, and (d) the proposed uni-directional attention with warmup.

Efficiency and Speed

To achieve interactive speeds, Live2Diff employs a KV-cache mechanism, caching Key (K) and Value (V) matrices from previous frames to prevent redundant computations. Additionally, a pipelined denoising strategy handles multiple frames at different denoising stages in parallel, maximizing GPU throughput.

Structural Priors

The system incorporates a lightweight depth-map input (using MiDaS) to ensure the generated video maintains the same spatial structure as the original input, preventing the model from hallucinating new shapes.

Experiments and Results

The model was fine-tuned on video data from Shutterstock and evaluated using the DAVIS-2017 dataset. Various community-provided DreamBooth and LoRA models were used to demonstrate different target styles.

Key Results

  • Speed: Live2Diff achieves 16 FPS for 512x512 resolution on an NVIDIA RTX 4090 GPU.
  • Temporal Smoothness: Qualitative tests show Live2Diff significantly reduces background flickering compared to StreamDiffusion. Quantitative metrics (CLIP score and Warp Error) indicate it is nearly as smooth as non-streaming models.
  • User Preference: A user study involving 15 participants found that Live2Diff's results were preferred over baselines for both structural consistency and temporal smoothness.

Conclusion

Live2Diff successfully brings real-time style translation to live video by combining uni-directional attention with a warmup phase and efficient caching. While limitations exist regarding fast motion and structural rigidity, it provides a robust framework for interactive video generation. Future work will focus on improving depth estimation and allowing for more significant structural transformations.

Summary updated

BibTeX
@misc{xing2024live,
  author = {Zhening Xing and Gereon Fox and Yanhong Zeng and Xingang Pan and Mohamed Elgharib and Christian Theobalt and Kai Chen},
  title = {{Live2Diff: Live Stream Translation via Uni-directional Attention in Video Diffusion Models}},
  year = {2024},
  eprint = {2407.08701},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.08701},
}
Figure