Instructions to use WeiChow/DiffusionOPSD with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use WeiChow/DiffusionOPSD with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-3.5-medium", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("WeiChow/DiffusionOPSD") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
DiffusionOPSD: On-Policy Self-Distillation in Diffusion Models
Reward-guided diffusion post-training through explicit, continually refreshed self-teachers
Overview
DiffusionOPSD is an on-policy self-distillation framework that converts image-level reward guidance into explicit self-teachers for clean-output predictions at sampled on-policy queries. At each outer iteration, a frozen exponential moving average (EMA) self-teacher rolls out trajectories to supply low-noise query states and clean-output anchors; normalized local reward gradients synthesize bounded positive and negative self-teachers around each anchor; and the student policy distills these detached self-teachers under a finite update budget before an online EMA update refreshes the self-teacher.
Separating self-teacher synthesis from student backpropagation removes the decoder and reward model from student backward passes and makes synthesis gain and realized gain separately measurable. Setting M_tgt = 1 admits the exact single-branch variant DiffusionOPSD* (v2), combining single-step self-teacher synthesis, broader prompt coverage (K = 1), and query-prefix rollouts truncated at σ_q.
- Quality across 20 target-reward settings: Across SD3.5-M (512²) and step-distilled Z-Image-Turbo (1024²), DiffusionOPSD and DiffusionOPSD* achieve the best final held-out score across all 20 settings, winning 19 of 20 individually with gains up to 44.0% over the strongest baseline and up to 2.57× the base-anchored gain of ReFL.
- Training efficiency: DiffusionOPSD and DiffusionOPSD* use up to 63% and 74% fewer GPU-hours per 100 updates than DiffusionNFT, reaching baseline terminal quality up to 13.1× faster.
- Zero-shot & human-preference transfer: Joint multi-reward training (PickScore/26 + CLIPScore + HPSv2.1) transfers zero-shot to unseen evaluators, compositional GenEval (+117.9%), and blinded human preference (up to 90% win rate).
Released Checkpoints
DiffusionOPSD* (v2): new.zip
new.zip contains the checkpoints for DiffusionOPSD*, the accelerated single-branch v2 recipe (M_tgt = 1, K = 1, query-prefix rollout stopped at σ_q). See the v2 blog for details.
The archive contains eight rank-32 LoRA adapters, covering SD3.5-M and Z-Image-Turbo × HPSv3, HPSv2.1, CLIPScore, and PickScore. All are the final checkpoint-100 EMA inference weights.
hf download WeiChow/DiffusionOPSD new.zip --local-dir checkpoints/diffusionopsd-star
unzip checkpoints/diffusionopsd-star/new.zip -d checkpoints/diffusionopsd-star
The extracted opsd_v2_2x4_20261012/ directory contains:
| Backbone | Adapter folders |
|---|---|
| SD3.5-M | sd35-m-hpsv3, sd35-m-hpsv2, sd35-m-clipscore, sd35-m-pickscore |
| Z-Image-Turbo | z-image-turbo-hpsv3, z-image-turbo-hpsv2, z-image-turbo-clipscore, z-image-turbo-pickscore |
Each folder contains adapter_config.json and adapter_model.safetensors.
Canonical DiffusionOPSD adapters
The nine top-level adapter folders below contain the canonical DiffusionOPSD (K = 24/12, M_tgt = 2) checkpoints. The DiffusionOPSD* checkpoints are packaged separately in new.zip.
| Checkpoint | Backbone | Training objective |
|---|---|---|
sd35-m-hpsv2 |
Stable Diffusion 3.5 Medium | HPSv2.1 |
sd35-m-pickscore |
Stable Diffusion 3.5 Medium | PickScore |
sd35-m-clipscore |
Stable Diffusion 3.5 Medium | CLIPScore |
sd35-m-hpsv3 |
Stable Diffusion 3.5 Medium | HPSv3 |
z-image-turbo-hpsv2 |
Z-Image-Turbo | HPSv2.1 |
z-image-turbo-pickscore |
Z-Image-Turbo | PickScore |
z-image-turbo-clipscore |
Z-Image-Turbo | CLIPScore |
z-image-turbo-hpsv3 |
Z-Image-Turbo | HPSv3 |
z-image-turbo-pointwise |
Z-Image-Turbo | Pointwise reward |
Download the repository, including new.zip, with:
hf download WeiChow/DiffusionOPSD --local-dir checkpoints/diffusionopsd
Quick Inference
Each checkpoint is a standard PEFT LoRA adapter for the backbone transformer.
SD3.5-M (512², 40 steps, CFG-free evaluation regime):
import torch
from diffusers import StableDiffusion3Pipeline
from peft import PeftModel
pipe = StableDiffusion3Pipeline.from_pretrained(
"stabilityai/stable-diffusion-3.5-medium", torch_dtype=torch.float16
).to("cuda")
pipe.vae.to(dtype=torch.float32)
pipe.transformer = PeftModel.from_pretrained(
pipe.transformer, "checkpoints/diffusionopsd/sd35-m-hpsv3"
)
image = pipe(
"A cinematic photograph of a fox sitting in a sunlit autumn forest",
height=512,
width=512,
num_inference_steps=40,
guidance_scale=1.0,
).images[0]
image.save("sd35_sample.png")
Z-Image-Turbo (1024², native 9-step CFG-free regime, bf16):
import torch
from diffusers import ZImagePipeline
from peft import PeftModel
pipe = ZImagePipeline.from_pretrained(
"Tongyi-MAI/Z-Image-Turbo", torch_dtype=torch.bfloat16
).to("cuda")
pipe.vae.to(dtype=torch.float32)
_peft = PeftModel.from_pretrained(
pipe.transformer, "checkpoints/diffusionopsd/z-image-turbo-hpsv3"
)
image = pipe(
"A cinematic photograph of a fox sitting in a sunlit autumn forest",
height=1024,
width=1024,
num_inference_steps=9,
guidance_scale=0.0,
).images[0]
image.save("zimage_sample.png")
Resources
- Paper: On-Policy Self-Distillation in Diffusion Models
- Code: worldbench/DiffusionOPSD
- Project page: diffusionopsd.github.io
- V2 blog: DiffusionOPSD* (v2)
Please refer to the GitHub repository for installation, exact held-out evaluation scripts (scripts/cross_eval.py, scripts/native_eval.py, scripts/score_geneval_offline.py), and training instructions.
Citation
@article{zhou2026policy,
title={On-Policy Self-Distillation in Diffusion Models},
author={Zhou, Wei and Zhu, Xiongwei and Kong, Lingdong and Chen, Bo and Zhang, Lei and Liang, Yongyuan and Hou, Xiaoxia and Tian, Ye and Sun, Xian and Wang, Yingshuo and others},
journal={arXiv preprint arXiv:2608.24646},
year={2026}
}
License
The released adapters are provided under the Apache License 2.0. Users must also comply with the licenses of the corresponding base models.
- Downloads last month
- -
Model tree for WeiChow/DiffusionOPSD
Base model
Tongyi-MAI/Z-Image-Turbo