π one paper Latte was accpeted by Transactions on Machine Learning Research (TMLR)

Our paper Latte was accpeted by Transactions on Machine Learning Research (TMLR)
Abstract
We propose Latte, a novel Latent Diffusion Transformer for video generation. Latte first extracts spatio-temporal tokens from input videos and then adopts a series of Transformer blocks to model video distribution in the latent space. In order to model a substantial number of tokens extracted from videos, four efficient variants are introduced from the perspective of decomposing the spatial and temporal dimensions of input videos. To improve the quality of generated videos, we determine the best practices of Latte through rigorous experimental analysis, including video clip patch embedding, model variants, timestep-class information injection, temporal positional embedding, and learning strategies. Our comprehensive evaluation demonstrates that Latte achieves state-of-the-art performance across four standard video generation datasets, i.e., FaceForensics, SkyTimelapse, UCF101, and Taichi-HD. In addition, we extend Latte to the text-to-video generation (T2V) task, where Latte achieves results that are competitive with recent T2V models. We strongly believe that Latte provides valuable insights for future research on incorporating Transformers into diffusion models for video generation. Project page: https://maxin-cn.github.io/latte_project.
Inference
Latte-1 is now integrated into diffusers.
You can easily run Latte using the following code. We also support inference with 4/8-bit quantization, which can reduce GPU memory from 17 GB to 9 GB.
#Please update the version of diffusers at leaset to 0.30.0
from diffusers import LattePipeline
from diffusers.models import AutoencoderKLTemporalDecoder
from torchvision.utils import save_image
import torch
import imageio
torch.manual_seed(0)
device = “cuda” if torch.cuda.is_available() else “cpu”
video_length = 16 # 1 (text-to-image) or 16 (text-to-video)
pipe = LattePipeline.from_pretrained(“maxin-cn/Latte-1”, torch_dtype=torch.float16).to(device)
#Using temporal decoder of VAE
vae = AutoencoderKLTemporalDecoder.from_pretrained(“maxin-cn/Latte-1”, subfolder=“vae_temporal_decoder”, torch_dtype=torch.float16).to(device)
pipe.vae = vae
prompt = “a cat wearing sunglasses and working as a lifeguard at pool.”
videos = pipe(prompt, video_length=video_length, output_type=‘pt’).frames.cpu()