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
BiliSakura/ADM-diffusers
Self-contained OpenAI ADM-G checkpoints for Hugging Face diffusers. No external code repo is required β each subfolder ships its own pipeline.py, component modules, and weights.
This repo is derived from the development bundle in Visual-Generative-Foundation-Model-Collection, but inference only needs:
- This model repo (
BiliSakura/ADM-diffusers) - PyPI
diffusers,torch,huggingface_hub
This Hugging Face repo hosts multiple self-contained checkpoints as subfolders. Each subfolder includes its own pipeline.py, model_index.json, weights, and component code (unet/, classifier/, scheduler/).
Available checkpoints
| Subfolder | Resolution | Classifier scale | OpenAI sources |
|---|---|---|---|
ADM-G-256/ |
256Γ256 | 1.0 | 256x256_diffusion.pt + 256x256_classifier.pt |
ADM-G-512/ |
512Γ512 | 4.0 | 512x512_diffusion.pt + 512x512_classifier.pt |
Both resolutions use the class-conditional diffusion checkpoint plus the noisy classifier (not the 256 uncond variant).
ImageNet class labels
Each variant keeps an id2label map directly in its own model_index.json (same style as DiT on the Hub). Runtime label resolution is English-only:
pipe.id2labelβ inspect id β English label correspondencepipe.labelsβ reverse map (English synonym β id), sorted for browsingpipe.get_label_ids("golden retriever")pipe(class_labels="golden retriever", ...)
Chinese labels are still preserved in the main source repo under src/labels/id2label_cn.json for reference.
Demo
Load from Hugging Face
import sys
from pathlib import Path
import torch
from huggingface_hub import snapshot_download
repo_dir = Path(snapshot_download("BiliSakura/ADM-diffusers"))
variant = "ADM-G-512" # or "ADM-G-256"
sys.path.insert(0, str(repo_dir / variant))
from pipeline import ADMPipeline
pipe = ADMPipeline.from_pretrained(".")
pipe.to("cuda")
pipe.unet.float()
pipe.classifier.float()
pipe.classifier.model.dtype = torch.float32
images = pipe(
class_labels=207,
num_inference_steps=250,
classifier_guidance_scale=4.0 if variant == "ADM-G-512" else 1.0,
).images
# Human-readable ImageNet labels (English)
print(pipe.id2label[207]) # "golden retriever"
pipe.get_label_ids("golden retriever") # [207]
images = pipe(class_labels="golden retriever", classifier_guidance_scale=1.0).images
Load from a local clone
import sys
from pathlib import Path
repo = Path("BiliSakura/ADM-diffusers").resolve()
variant = "ADM-G-256"
sys.path.insert(0, str(repo / variant))
from pipeline import ADMPipeline
pipe = ADMPipeline.from_pretrained(".")
pipe.to("cuda")
Repo layout
BiliSakura/ADM-diffusers/
βββ README.md
βββ ADM-G-256/
β βββ pipeline.py
β βββ model_index.json
β βββ unet/
β βββ classifier/
β βββ scheduler/
βββ ADM-G-512/
βββ pipeline.py
βββ model_index.json
βββ demo.png
βββ unet/
βββ classifier/
βββ scheduler/
- Downloads last month
- 42
