ShiyiZhang/Self-OPD
<h1 align="center">Self-OPD</h1> <h3 align="center">On-Policy Distillation for Flow Matching Models without Teacher</h3>
<div align="center"> <a href="https://github.com/Shiy-Zhang/Self-OPD"><img src="https://img.shields.io/badge/Code-9E95B7?logo=github"></a> <a href="https://huggingface.co/stabilityai/stable-diffusion-3.5-medium"><img src="https://img.shields.io/badge/Base_Model-SD3.5--Medium-yellow"></a> </div>
Model Card
This repository hosts the mixed-reward LoRA weights for Self-OPD, a teacher-free, on-policy distillation framework for flow-matching text-to-image models.
Self-OPD uses the current policy's self-exploration to construct step-wise distillation targets and jointly improve compositional generation, text rendering, and human preference alignment.
Base Model
The LoRA adapter is trained from `stabilityai/stable-diffusion-3.5-medium`. Powered by Stability AI.
Usage
Use the official Self-OPD repository for inference and evaluation:
git clone https://github.com/Shiy-Zhang/Self-OPD.git
cd Self-OPD
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
bash scripts/infer.shThe inference script downloads ShiyiZhang/Self-OPD automatically. Access to the gated SD3.5-Medium base model must be accepted on Hugging Face before first use.
Examples
The three samples below are produced by scripts/infer.py with its default settings (bfloat16, 40 inference steps, guidance scale 4.5, 512×512, max_sequence_length=256). For a single prompt the image generator is seeded with exactly --seed, so each command below regenerates the image above it. Running bash scripts/infer.sh produces all three.
python scripts/infer.py \
--prompt "A vast desert landscape under a scorching sun, where a mirage forms the shimmering letters \"Water This Way\" on the distant horizon, creating an illusion of hope in an otherwise barren and arid environment." \
--seed 142
python scripts/infer.py \
--prompt "A storefront with 'Google Brain Toronto' written on it." \
--seed 215
python scripts/infer.py \
--prompt "A laptop on top of a teddy bear." \
--seed 268Citation
@article{zhang2026self,
title={Self-OPD: On-Policy Distillation for Flow Matching Models without Teacher},
author={Zhang, Shiyi and Liu, Mushui and Tong, Yunze and He, Wanggui and Zou, Siyu and Liu, Jinlong and Yu, Yunlong and Song, Jian and Jiang, Hao and Huang, Pipei and others},
journal={arXiv preprint arXiv:2608.26872},
year={2026}
}