Views
No views yet


| Model | Allegro |
|---|---|
| Description | Text-to-Video Generation Model |
| Download | Hugging Face |
| Parameter | VAE: 175M |
| DiT: 2.8B | |
| Inference Precision | VAE: FP32/TF32/BF16/FP16 (best in FP32/TF32) |
| DiT/T5: BF16/FP32/TF32 | |
| Context Length | 79.2K |
| Resolution | 720 x 1280 |
| Frames | 88 |
| Video Length | 6 seconds @ 15 FPS |
| Single GPU Memory Usage | 9.3G BF16 (with cpu_offload) |
conda create -n rllegro python=3.10 -y to run the following example.pip install git+https://github.com/huggingface/diffusers.git torch==2.4.1 transformers==4.40.1 accelerate sentencepiece imageio imageio-ffmpeg beautifulsoup41import torch
2from diffusers import AutoencoderKLAllegro, AllegroPipeline
3from diffusers.utils import export_to_video
4vae = AutoencoderKLAllegro.from_pretrained("rhymes-ai/Allegro", subfolder="vae", torch_dtype=torch.float32)
5pipe = AllegroPipeline.from_pretrained(
6 "rhymes-ai/Allegro", vae=vae, torch_dtype=torch.bfloat16
7)
8pipe.to("cuda")
9pipe.vae.enable_tiling()
10prompt = "A seaside harbor with bright sunlight and sparkling seawater, with many boats in the water. From an aerial view, the boats vary in size and color, some moving and some stationary. Fishing boats in the water suggest that this location might be a popular spot for docking fishing boats."
11
12positive_prompt = """
13(masterpiece), (best quality), (ultra-detailed), (unwatermarked),
14{}
15emotional, harmonious, vignette, 4k epic detailed, shot on kodak, 35mm photo,
16sharp focus, high budget, cinemascope, moody, epic, gorgeous
17"""
18
19negative_prompt = """
20nsfw, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality,
21low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry.
22"""
23
24prompt = prompt.format(prompt.lower().strip())
25
26video = pipe(prompt, negative_prompt=negative_prompt, guidance_scale=7.5, max_sequence_length=512, num_inference_steps=100, generator = torch.Generator(device="cuda:0").manual_seed(42)).frames[0]
27export_to_video(video, "output.mp4", fps=15)pipe.enable_sequential_cpu_offload() to offload the model into CPU for less GPU memory cost (about 9.3G, compared to 27.5G if CPU offload is not enabled), but the inference time will increase significantly.