Instructions to use BiliSakura/DiT-diffusers with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use BiliSakura/DiT-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/DiT-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/DiT-diffusers
Diffusers-ready checkpoints for Diffusion Transformers (DiT), re-packaged for local/offline use with a project-owned custom DiTPipeline.
Re-distribution notice: weights and configs in this repo are re-distributed from
facebook/DiT-XL-2-512. Original work: Scalable Diffusion Models with Transformers (ICCV 2023). License: CC BY-NC 4.0.
This repo is derived from the development bundle in Visual-Generative-Foundation-Model-Collection. Inference only needs:
- This model repo (
BiliSakura/DiT-diffusers) - PyPI
diffusers,torch,safetensors
Important note
This repo intentionally does not use Diffusers built-in diffusers.DiTPipeline.
Instead, each model subfolder contains pipeline.py with a custom class named DiTPipeline.
Available checkpoints
| Subfolder | Resolution | Source |
|---|---|---|
DiT-XL-2-256/ |
256Γ256 | facebook/DiT-XL-2-256 |
DiT-XL-2-512/ |
512Γ512 | facebook/DiT-XL-2-512 |
Each subfolder is a self-contained Diffusers model repo with:
model_index.json(includes ImageNetid2label)pipeline.py(customDiTPipeline)transformer/diffusion_pytorch_model.safetensorsvae/diffusion_pytorch_model.safetensorsscheduler/scheduler_config.json
Demo
from pathlib import Path
import torch
from diffusers import DiffusionPipeline
model_dir = Path("path/to/DiT-XL-2-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,
).to("cuda")
generator = torch.Generator(device="cuda").manual_seed(0)
out = pipe(
class_labels=[207],
num_inference_steps=250,
guidance_scale=4.0,
generator=generator,
).images[0]
out
Repo layout
BiliSakura/DiT-diffusers/
βββ README.md
βββ DiT-XL-2-256/
βββ DiT-XL-2-512/
βββ README.md
βββ model_index.json
βββ pipeline.py
βββ demo.png
βββ transformer/
β βββ config.json
β βββ diffusion_pytorch_model.safetensors
βββ vae/
β βββ config.json
β βββ diffusion_pytorch_model.safetensors
βββ scheduler/
βββ scheduler_config.json
- Downloads last month
- -
