SiD-DiT: Score Distillation of Flow Matching Models
Model Card
SiD-DiT is a score-distillation pipeline for pretrained text-to-image flow-matching models. We introduce a general framework that can accelerate sampling in flow-matching models by distilling pretrained flow-matching teachers into high-quality few-step students, providing a principled way to unify acceleration techniques across both diffusion- and flow-based generators.
Installation
# download model files from this repo
git clone https://huggingface.co/YGu1998/SiD-DiT-SD3-medium
# install packages
cd SiD_pipelines
pip install -r requirements.txt
cd ..
Inference with SiD-DiT
import torch
from SiD_pipelines import SiDSD3Pipeline
if torch.cuda.is_available():
torch_dtype = torch.bfloat16
device = "cuda"
else:
torch_dtype = torch.float32
device = "cpu"
model_repo_id = "YGu1998/SiD-DiT-SD3-medium"
prompt = ["a studio portrait of an elderly woman smiling, soft window light, 85mm lens"]
pipe = SiDSD3Pipeline.from_pretrained(
model_repo_id,
torch_dtype=torch_dtype,
).to(device)
generator = torch.Generator(device=device).manual_seed(42)
image = pipe(
prompt=prompt,
guidance_scale=1.0,
num_inference_steps=4,
width=1024,
height=1024,
generator=generator,
time_scale=1000,
).images[0]
image.save("example.png")
License
- Base model:
stabilityai/stable-diffusion-3-medium-diffusers - Base license: Stability AI Non-Commercial Research Community License
(
stabilityai-nc-research-community)
This checkpoint is a non-commercial research derivative of Stable Diffusion 3 Medium and inherits the same license. You may only use these weights under the terms of the Stability AI Non-Commercial Research Community License. In particular, commercial or revenue-generating use (including production services, internal business tooling intended for commercial advantage, or hosted APIs) requires an appropriate commercial license from Stability AI.
This repository does not grant any additional rights beyond the base model license. You are responsible for ensuring that your use of this checkpoint complies with the Stability AI license and applicable law.
- Downloads last month
- 20