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 ImageNet id2label)
  • pipeline.py (custom DiTPipeline)
  • transformer/diffusion_pytorch_model.safetensors
  • vae/diffusion_pytorch_model.safetensors
  • scheduler/scheduler_config.json

Demo

DiT-XL-2-512 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
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support