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
File size: 1,105 Bytes
9356fa9 05d8082 9356fa9 7fc7e34 02a21e2 7fc7e34 9356fa9 7fc7e34 9356fa9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | # ADM-G-256
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-256`
## Layout
```text
ADM-G-256/
βββ pipeline.py
βββ model_index.json
βββ unet/
βββ classifier/
βββ scheduler/
```
## Load
```python
from pathlib import Path
import torch
from diffusers import DDPMScheduler, DiffusionPipeline
model_dir = Path("./BiliSakura/ADM-diffusers/ADM-G-256")
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 = DDPMScheduler.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=1.0,
num_inference_steps=250,
generator=generator,
).images[0]
out
```
|