Update README.md

This commit is contained in:
RhymesAI 2024-10-18 09:04:14 +00:00 committed by system
parent 2afcdf81aa
commit b2a21d443b
No known key found for this signature in database
GPG Key ID: 6A528E38E0733467

@ -5,8 +5,8 @@ language:
---
<p align="center">
🔗 <a href="https://rhymes.ai/" target="_blank"> Try Aria!</a> · 📖 <a href="https://www.rhymes.ai/blog-details/aria-first-open-multimodal-native-moe-model" target="_blank">Blog</a> · 📌 <a href="https://arxiv.org/pdf/2410.05993" target="_blank">Paper</a>
· ⭐<a href="https://github.com/rhymes-ai/Aria" target="_blank">GitHub</a>
<a href="https://rhymes.ai/" target="_blank"> Gallery</a> · <a href="https://github.com/rhymes-ai/Aria" target="_blank">GitHub</a> · <a href="https://www.rhymes.ai/blog-details/" target="_blank">Blog</a> · <a href="https://arxiv.org/pdf/2410.05993" target="_blank">Paper</a> · <a href="https://discord" target="_blank">Discord</a>
</p>
# Gallery
@ -72,9 +72,56 @@ Allegro is capable of producing high-quality, 6-second videos at 30 frames per s
# Quick start
You can quickly get started with Allegro using the Hugging Face Diffusers library.
For more tutorials, see Allegro GitHub (link-tbd).
Install necessary requirements:
```python
pip install diffusers transformers imageio
```
Inference on single gpu:
```python
from diffusers import DiffusionPipeline
import torch
allegro_pipeline = DiffusionPipeline.from_pretrained(
"rhythms-ai/allegro", trust_remote_code=True, torch_dtype=torch.bfloat16
).to("cuda")
allegro_pipeline.vae = allegro_pipeline.vae.to(torch.float32)
prompt = "a video of an astronaut riding a horse on mars"
positive_prompt = """
(masterpiece), (best quality), (ultra-detailed), (unwatermarked),
{}
emotional, harmonious, vignette, 4k epic detailed, shot on kodak, 35mm photo,
sharp focus, high budget, cinemascope, moody, epic, gorgeous
"""
negative_prompt = """
nsfw, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality,
low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry.
"""
num_sampling_steps, guidance_scale, seed = 100, 7.5, 42
user_prompt = positive_prompt.format(args.user_prompt.lower().strip())
out_video = allegro_pipeline(
user_prompt,
negative_prompt=negative_prompt,
num_frames=88,
height=720,
width=1280,
num_inference_steps=num_sampling_steps,
guidance_scale=guidance_scale,
max_sequence_length=512,
generator = torch.Generator(device="cuda:0").manual_seed(seed)
).video[0]
imageio.mimwrite("test_video.mp4", out_video, fps=15, quality=8)
```
# License
This repo is released under the Apache 2.0 License.
# Disclaimer
The Allegro models are provided on an "AS IS" basis, and we disclaim any liability for consequences or damages arising from your use. Users are kindly advised to ensure compliance with all applicable laws and regulations. This includes, but is not limited to, prohibitions against illegal activities and the generation of content that is violent, pornographic, obscene, or otherwise deemed non-safe, inappropriate, or illegal. By using these models, you agree that we shall not be held accountable for any consequences resulting from your use.