Instructions to use feizhengcong/mochi-1-preview-diffusers with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use feizhengcong/mochi-1-preview-diffusers with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("feizhengcong/mochi-1-preview-diffusers", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
|
Download README.md from feizhengcong/mochi-1-preview-diffusers: direct link, hf CLI and curl.
- Browser
- Download file 1.73 kB
-
https://huggingface.co/feizhengcong/mochi-1-preview-diffusers/resolve/main/README.md
- Command line
-
hf download hf://feizhengcong/mochi-1-preview-diffusers/README.md
-
curl -L -o README.md https://huggingface.co/feizhengcong/mochi-1-preview-diffusers/resolve/main/README.md
1.73 kB
| license: apache-2.0 | |
| Diffusers formation for mochi-1-preview model. | |
| It was create by scripts: https://github.com/huggingface/diffusers/blob/main/scripts/convert_mochi_to_diffusers.py | |
| The model can be directly load from pretrained with mochi branch: https://github.com/huggingface/diffusers/tree/mochi-t2v | |
| You can directly use the zipped file branch in: https://huggingface.co/feizhengcong/mochi-1-preview-diffusers/blob/main/diffusers-mochi.zip | |
| ```bash | |
| from diffusers import MochiPipeline | |
| from diffusers.utils import export_to_video | |
| pipe = MochiPipeline.from_pretrained(model_path, torch_dtype=torch.bfloat16) | |
| pipe.to("cuda") | |
| prompt = "Close-up of a chameleon's eye, with its scaly skin changing color. Ultra high resolution 4k." | |
| frames = pipe(prompt, | |
| num_inference_steps=50, | |
| guidance_scale=4.5, | |
| num_frames=61, | |
| generator=torch.Generator(device="cuda").manual_seed(42), | |
| ).frames[0] | |
| export_to_video(frames, "mochi.mp4") | |
| ``` | |
| Some generated results: | |
| <video controls autoplay src="https://cdn-uploads.huggingface.co/production/uploads/62e34a12c9bece303d146af8/Cm3I6kidy2YP5nu3un7XP.mp4"></video> | |
| <video controls autoplay src="https://cdn-uploads.huggingface.co/production/uploads/62e34a12c9bece303d146af8/bVNem7sGTvBEjxQG7MHw_.mp4"></video> | |
| <video controls autoplay src="https://cdn-uploads.huggingface.co/production/uploads/62e34a12c9bece303d146af8/0YWv2KJwH_UB2WkWjO_bP.mp4"></video> | |
| <video controls autoplay src="https://cdn-uploads.huggingface.co/production/uploads/62e34a12c9bece303d146af8/TOLKdMx-kFLCNXD6nIVHm.mp4"></video> | |
| Pretty thanks for the discussion in https://github.com/huggingface/diffusers/pull/9769 | |
| 11.04 updation for vae encoder releasing. | |
| --- | |
| license: apache-2.0 | |
| --- |