Instructions to use BiliSakura/ADM-diffusers with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use BiliSakura/ADM-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("BiliSakura/ADM-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
- Local Apps
- Draw Things
- DiffusionBee
| # ADM-G-512 | |
| Self-contained ADM-G checkpoint inside [`BiliSakura/ADM-diffusers`](https://huggingface.co/BiliSakura/ADM-diffusers). Runtime dependencies: this folder + PyPI `diffusers`/`torch` only. | |
| ## Hub path | |
| `BiliSakura/ADM-diffusers/ADM-G-512` | |
| ## Demo | |
|  | |
| Settings used for this demo image: `ADM-G-512`, `DDIMScheduler`, `num_inference_steps=50`, `guidance_scale=4.0`, `seed=42`, class `"golden retriever"`. | |
| ## Layout | |
| ```text | |
| ADM-G-512/ | |
| βββ pipeline.py | |
| βββ model_index.json | |
| βββ demo.png | |
| βββ unet/ | |
| βββ classifier/ | |
| βββ scheduler/ | |
| ``` | |
| ## Load | |
| ```python | |
| from pathlib import Path | |
| import torch | |
| from diffusers import DDIMScheduler, DiffusionPipeline | |
| model_dir = Path("./BiliSakura/ADM-diffusers/ADM-G-512") | |
| pipe = DiffusionPipeline.from_pretrained( | |
| str(model_dir), | |
| local_files_only=True, | |
| custom_pipeline=str(model_dir / "pipeline.py"), | |
| trust_remote_code=True, | |
| torch_dtype=torch.bfloat16, | |
| ) | |
| pipe = pipe.to("cuda") | |
| pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config) | |
| class_id = pipe.get_label_ids("golden retriever")[0] | |
| generator = torch.Generator(device="cuda").manual_seed(42) | |
| out = pipe( | |
| class_labels=class_id, | |
| guidance_scale=4.0, | |
| num_inference_steps=50, | |
| generator=generator, | |
| ).images[0] | |
| out | |
| ``` | |