Views
No views yet
Flow-OPD: On-Policy Distillation for Flow Matching Models — Evaluated on SD-3.5-Medium, Flow-OPD achieves +18pt average improvement over vanilla GRPO.
1import torch
2from diffusers import StableDiffusion3Pipeline
3from peft import PeftModel
4
5model_id = "stabilityai/stable-diffusion-3.5-medium"
6lora_ckpt_path = "CostaliyA/Flow-OPD"#dev ckpt
7device = "cuda"
8
9pipe = StableDiffusion3Pipeline.from_pretrained(model_id, torch_dtype=torch.float16)
10pipe.transformer = PeftModel.from_pretrained(pipe.transformer, lora_ckpt_path)
11pipe.transformer = pipe.transformer.merge_and_unload()
12pipe = pipe.to(device)
13
14prompt = "a photo of a black kite and a green bear"
15image = pipe(prompt, height=512, width=512, num_inference_steps=40, guidance_scale=4.5, negative_prompt="").images[0]
16image.save("flow_opd.png")| Model | GenEval | OCR | DeQA | PickScore | Average |
|---|---|---|---|---|---|
| SD-3.5-M (base) | 0.63 | 0.59 | 4.07 | 21.64 | 0.72 |
| GRPO-Mix | 0.73 | 0.83 | 4.33 | 21.84 | 0.82 |
| Flow-OPD | 0.92 | 0.94 | 4.35 | 23.08 | 0.90 |
1@article{fang2026flow,
2 title={Flow-OPD: On-Policy Distillation for Flow Matching Models},
3 author={Fang, Zhen and Huang, Wenxuan and Zeng, Yu and Zhao, Yiming and Chen, Shuang and Feng, Kaituo and Lin, Yunlong and Chen, Lin and Chen, Zehui and Cao, Shaosheng and others},
4 journal={arXiv preprint arXiv:2605.08063},
5 year={2026}
6}