RAIN: Real-time Animation of Infinite Video Stream

Zhilei Shu, Ruili Feng, Yang Cao, Zheng-Jun ZhaarXiv 2024 · DOI

Introduction

Diffusion models have revolutionized image and video generation but are often too computationally expensive for real-time applications. For interactive digital personas or virtual YouTubers, models must be high-quality, real-time, and capable of running indefinitely without quality degradation or character "drift." Existing streaming methods often sacrifice temporal consistency for speed by reducing denoising steps, which limits the number of frames the model can process simultaneously. RAIN (Real-time Animation of Infinite Video Stream) overcomes this bottleneck, achieving 18 FPS on a single consumer-grade RTX 4090 while maintaining high visual stability.

Methodology

The RAIN pipeline introduces several key innovations to enable high-speed, consistent animation:

  • Temporal Adaptive Attention: RAIN groups multiple consecutive frames (p frames) into the same noise level rather than assigning one frame per level. This increases the "StreamBatch" size, allowing the model to attend to longer sequences without increasing the number of denoising steps.
  • Cross-Noise-Level Attention: The authors found that allowing frames at different noise levels to interact through cross-attention significantly enhances visual continuity.
  • LCM Distillation: By employing Latent Consistency Model (LCM) distillation, RAIN can produce high-quality results in as few as four denoising steps, a prerequisite for real-time performance.
  • Reference Mechanism: Utilizing a "ReferenceNet" (adapted from AnimateAnyone), the model caches features from a reference image to lock in character identity, ensuring the character's appearance remains stable throughout an infinite stream.
  • Soft Startup Strategy: To avoid degenerate results at the start of a stream, RAIN initializes the buffer with "pure noise" frames, preventing the error accumulation that occurs when starting from a single static image.

Datasets

The performance of RAIN was validated across three distinct tasks:

  1. UBC-Fashion Dataset: Used for whole-body human movement generation.
  2. Anime Face Dataset: A private collection of 1.8k clips from YouTube used to train the model on porting real human facial expressions to anime characters.
  3. Panda-70M: A subset of 50k clips used to demonstrate the model's capabilities in video style transfer.

Results and Discussion

RAIN achieves a processing speed of 18 FPS for 512x512 video generation on an NVIDIA RTX 4090. In quantitative tests on the UBC-Fashion dataset, it maintains a high SSIM of 0.921 and a competitive FVD of 85.2, performing nearly as well as non-real-time state-of-the-art models.

Figure 1: RAIN enables consistent, real-time animation of diverse anime characters, maintaining identity across an infinite stream of expressions.

A significant finding was the importance of hardware utilization; by grouping frames, the model more effectively saturates the GPU's capacity, providing temporal consistency with minimal overhead. Additionally, the researchers observed a "Causal Masking Paradox": while strict causal masking (looking only at the past) might seem intuitive for streaming, bidirectional attention within the local batch proved more stable after distillation. The model successfully transfers complex human expressions, captured via DWPose, to anime avatars without the character's features "melting" over time.

Limitations and Future Work

Despite its strengths, RAIN has limitations. In rare cases, minor artifacts can accumulate into larger color blocks over time, though these typically dissipate after several hundred frames. The model is also optimized for fixed-scene tasks; high camera motion or rapidly changing backgrounds can lead to a loss of detail. Finally, the grouping of frames introduces a small inherent latency, though it remains within the bounds required for real-time interaction. Future research will focus on mitigating error accumulation and improving performance in dynamic environments.

Summary updated

BibTeX
@misc{shu2024rain,
  author = {Zhilei Shu and Ruili Feng and Yang Cao and Zheng-Jun Zha},
  title = {{RAIN: Real-time Animation of Infinite Video Stream}},
  year = {2024},
  eprint = {2412.19489},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.19489},
}
Figure