Views
No views yet


| Model | Allegro-T2V-40x720P |
|---|---|
| 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 | 36K |
| Resolution | 720 x 1280 |
| Frames | 40 |
| Video Length | 3 seconds @ 15 FPS |
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-T2V-40x720P", subfolder="vae", torch_dtype=torch.float32)
5
6pipe = AllegroPipeline.from_pretrained(
7 "rhymes-ai/Allegro-T2V-40x720P", vae=vae, torch_dtype=torch.bfloat16
8)
9pipe.to("cuda")
10pipe.vae.enable_tiling()
11
12prompt = "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."
13
14positive_prompt = """
15(masterpiece), (best quality), (ultra-detailed), (unwatermarked),
16{}
17emotional, harmonious, vignette, 4k epic detailed, shot on kodak, 35mm photo,
18sharp focus, high budget, cinemascope, moody, epic, gorgeous
19"""
20
21negative_prompt = """
22nsfw, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality,
23low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry.
24"""
25
26prompt = prompt.format(prompt.lower().strip())
27
28video = 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]
29export_to_video(video, "output.mp4", fps=15)pipe.enable_sequential_cpu_offload() to offload the model into CPU for less GPU memory cost, but the inference time will increase significantly.