AB
AiBoss
project

RAIN - A solution for real-time animation generation and live-action facial expression transplantation in video streaming.

RAIN (Real-time Animation Of Infinite Video Stream) is an innovative real-time animation solution that enables real-time animation of infinite video streams using consumer-grade hardware, such as a single RTX 4090 GPU. Core...

What is RAIN?

RAIN (Real-time Animation of Infinite Video Stream) is an innovative real-time animation solution that enables the real-time animation of infinite video streams using consumer-grade hardware, such as a single RTX 4090 GPU. Its core technology lies in efficiently computing frame-marked attention with varying noise levels and long time intervals, while simultaneously denoising a large number of frame marks to generate video frames with extremely low latency, maintaining the long-term continuity and consistency of the video stream. By introducing a small number of additional one-dimensional attention blocks and fine-tuning the Stable Diffusion model, RAIN can generate high-quality, consistent, infinitely long video streams in real-time with low latency after several rounds of training. This has significant implications for the field of real-time animation, providing powerful technical support for applications such as online interaction and virtual character generation.

RAIN's main functions

  • Real-time animation generationIt can generate animations in real time with low latency on consumer-grade GPUs, such as a single RTX 4090, breaking through the limitations of traditional methods in terms of generation speed and latency. This allows animation content to be presented instantly, making it suitable for scenarios that require real-time interaction, such as live streaming and online meetings.
  • Infinite video streamingIt breaks the limitation of video length and can continuously generate video streams of infinite length, meeting the needs of long-term live streaming or continuous animation display, and making it possible to create a continuous and smooth visual experience.
  • High quality and consistency assuranceBy efficiently calculating frame tag attention at different noise levels and over long time intervals, and simultaneously denoising a large number of frame tags, the generated video maintains a high standard of visual quality while preserving long-term continuity and consistency, thus avoiding abrupt changes and quality degradation in the image.
  • Model fine-tuning and adaptation: Targeted fine-tuning of the Stable Diffusion model allows it to quickly adapt to real-time animation generation tasks, achieving ideal generation results with only a few training cycles, thus reducing model training costs and time investment.

RAIN's technical principles

  • Frame tagging attention mechanismThe core of RAIN lies in efficiently computing attention across frame tags with varying noise levels and long time intervals. RAIN increases the size of the StreamBatch, assigning each p consecutive frame tags to denoising groups with the same noise level, and progressively increasing the noise level of these groups. This fully utilizes the hardware's computational potential, allowing the model to compute attention over longer frame tag sequences, significantly improving the consistency and continuity of the generated video stream.
  • Optimization of the noise reduction processRAIN introduces an innovative approach to denoising. By combining long-term attention across different denoising groups, RAIN's attention calculations across noise levels effectively improve continuity and visual quality. This synergistic effect of long-term attention and attention across noise levels significantly enhances the smoothness and visual appeal of animation.
  • Application of Consistency ModelRAIN accelerates the sampling process of diffusion models by using a consistency model. The consistency model satisfies specific mathematical conditions, enabling the model to generate samples in a single step. Through the consistency distillation loss function, RAIN trains a model capable of rapid sampling, achieving multi-step sampling and improving sampling efficiency.
  • Flow diffusion technologyRAIN borrows from the Stream Diffusion technique, pushing frames with different noise levels into a batch for processing, making full use of the GPU's batch computing capabilities.
  • Reference mechanismTo maintain consistency across roles, RAIN employs a reference mechanism. A pre-trained 2D UNet is used as a ReferenceNet to perform inference on reference images, caching the input hidden state before spatial attention operations.
  • Two-stage training strategyRAIN employs a two-stage training strategy. In the first stage, the model is trained on image pairs from the same video, simultaneously training the reference network, pose guide, and denoising UNet. In the second stage, noise is added to the video frames, and the motion module is fine-tuned according to specific time steps to adapt to temporal changes. This training strategy enables the model to accept streaming video input and process infinitely long videos.

RAIN's project address

Application scenarios of RAIN

  • Virtual character interactionIn games and virtual reality (VR)/augmented reality (AR) applications, RAIN can generate animations of virtual characters in real time, and the characters can respond in real time to the player's movements and expressions, enhancing immersion and interactivity.
  • Animation ProductionFor animation production companies, RAIN can serve as an auxiliary tool to quickly generate animation drafts or previews, improving production efficiency.
  • Virtual streamerOn live streaming platforms, RAIN can generate real-time animations of virtual anchors. The virtual anchors can react in real time based on the anchor's voice and facial expressions, providing richer and more diverse live streaming content.
  • Online EducationIn online education platforms, RAIN can generate animations of virtual teachers, making teaching content more vivid and engaging.