Instructions to use jieliu/SD3.5M-FlowGRPO-PickScore with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use jieliu/SD3.5M-FlowGRPO-PickScore with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
Improve model card with correct metadata and paper links
Browse filesThis PR improves the model card by:
- Adding the `text-to-image` pipeline tag for better discoverability.
- Updating the paper link to the correct arXiv ID (2605.08063).
- Adding links to the official GitHub repository and project page.
- Adding a citation section for the research paper.
README.md
CHANGED
|
@@ -1,40 +1,52 @@
|
|
| 1 |
---
|
| 2 |
base_model: stabilityai/stable-diffusion-3.5-medium
|
| 3 |
library_name: peft
|
|
|
|
| 4 |
---
|
| 5 |
|
| 6 |
-
#
|
| 7 |
|
| 8 |
-
|
| 9 |
-
This model is trained using Flow-GRPO with LoRA. We provide only the LoRA weights here, so you will need to download the SD 3.5 Medium base model first.
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
|
| 15 |
-
|
| 16 |
|
| 17 |
-
-
|
| 18 |
-
- **Paper:** https://www.arxiv.org/pdf/2505.05470
|
| 19 |
|
| 20 |
## Uses
|
|
|
|
| 21 |
```python
|
| 22 |
import torch
|
| 23 |
from diffusers import StableDiffusion3Pipeline
|
| 24 |
-
from diffusers.schedulers import FlowMatchEulerDiscreteScheduler
|
| 25 |
from peft import PeftModel
|
| 26 |
|
| 27 |
model_id = "stabilityai/stable-diffusion-3.5-medium"
|
|
|
|
| 28 |
lora_ckpt_path = "jieliu/SD3.5M-FlowGRPO-PickScore"
|
| 29 |
device = "cuda"
|
| 30 |
|
| 31 |
-
|
| 32 |
pipe = StableDiffusion3Pipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
| 33 |
pipe.transformer = PeftModel.from_pretrained(pipe.transformer, lora_ckpt_path)
|
| 34 |
pipe.transformer = pipe.transformer.merge_and_unload()
|
| 35 |
pipe = pipe.to(device)
|
| 36 |
|
| 37 |
-
prompt = 'a
|
| 38 |
-
image = pipe(prompt, height=512, width=512, num_inference_steps=40,guidance_scale=4.5,negative_prompt="").images[0]
|
| 39 |
image.save("flow_grpo_pickscore.png")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
```
|
|
|
|
| 1 |
---
|
| 2 |
base_model: stabilityai/stable-diffusion-3.5-medium
|
| 3 |
library_name: peft
|
| 4 |
+
pipeline_tag: text-to-image
|
| 5 |
---
|
| 6 |
|
| 7 |
+
# Flow-OPD: On-Policy Distillation for Flow Matching Models
|
| 8 |
|
| 9 |
+
This repository contains LoRA weights for text-to-image generation, specifically the PickScore-specialized teacher model used in the **Flow-OPD** framework. Flow-OPD is a unified post-training framework that integrates on-policy distillation into Flow Matching models to replace sparse scalar rewards with dense, trajectory-level supervision.
|
|
|
|
| 10 |
|
| 11 |
+
- **Paper:** [Flow-OPD: On-Policy Distillation for Flow Matching Models](https://arxiv.org/abs/2605.08063)
|
| 12 |
+
- **Project Page:** [https://costaliya.github.io/Flow-OPD/](https://costaliya.github.io/Flow-OPD/)
|
| 13 |
+
- **Repository:** [https://github.com/CostaliyA/Flow-OPD](https://github.com/CostaliyA/Flow-OPD)
|
| 14 |
|
| 15 |
+
## Model Details
|
| 16 |
|
| 17 |
+
This model is a LoRA adapter trained using Flow-GRPO. To use it, you must first download the [Stable Diffusion 3.5 Medium](https://huggingface.co/stabilityai/stable-diffusion-3.5-medium) base model.
|
|
|
|
| 18 |
|
| 19 |
## Uses
|
| 20 |
+
|
| 21 |
```python
|
| 22 |
import torch
|
| 23 |
from diffusers import StableDiffusion3Pipeline
|
|
|
|
| 24 |
from peft import PeftModel
|
| 25 |
|
| 26 |
model_id = "stabilityai/stable-diffusion-3.5-medium"
|
| 27 |
+
# This repository's LoRA weights
|
| 28 |
lora_ckpt_path = "jieliu/SD3.5M-FlowGRPO-PickScore"
|
| 29 |
device = "cuda"
|
| 30 |
|
|
|
|
| 31 |
pipe = StableDiffusion3Pipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
| 32 |
pipe.transformer = PeftModel.from_pretrained(pipe.transformer, lora_ckpt_path)
|
| 33 |
pipe.transformer = pipe.transformer.merge_and_unload()
|
| 34 |
pipe = pipe.to(device)
|
| 35 |
|
| 36 |
+
prompt = 'a young male cyborg with white hair sitting down on a throne in a dystopian world, digital art, epic'
|
| 37 |
+
image = pipe(prompt, height=512, width=512, num_inference_steps=40, guidance_scale=4.5, negative_prompt="").images[0]
|
| 38 |
image.save("flow_grpo_pickscore.png")
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
## Citation
|
| 42 |
+
|
| 43 |
+
If you find this work useful, please cite:
|
| 44 |
+
|
| 45 |
+
```bibtex
|
| 46 |
+
@article{fang2026flow,
|
| 47 |
+
title={Flow-OPD: On-Policy Distillation for Flow Matching Models},
|
| 48 |
+
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},
|
| 49 |
+
journal={arXiv preprint arXiv:2605.08063},
|
| 50 |
+
year={2026}
|
| 51 |
+
}
|
| 52 |
```
|