File size: 1,446 Bytes
5efdfea f821fec 5efdfea d4977a2 5efdfea |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
---
base_model: stabilityai/stable-diffusion-3.5-medium
library_name: peft
---
# Model Card for Model ID
**[Update]** We release a new **GenEval model** that maintains image quality close to the **base model**, while still achieving the original **GenEval score of 95**. _Feel free to give it a try!
<!-- Provide a quick summary of what the model is/does. -->
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.
## Model Details
### Model Sources
<!-- Provide the basic links for the model. -->
- **Repository:** https://github.com/yifan123/flow_grpo
- **Paper:** https://www.arxiv.org/pdf/2505.05470
## Uses
```python
import torch
from diffusers import StableDiffusion3Pipeline
from diffusers.schedulers import FlowMatchEulerDiscreteScheduler
from peft import PeftModel
model_id = "stabilityai/stable-diffusion-3.5-medium"
lora_ckpt_path = "jieliu/SD3.5M-FlowGRPO-GenEval"
device = "cuda"
pipe = StableDiffusion3Pipeline.from_pretrained(model_id, torch_dtype=torch.float16)
pipe.transformer = PeftModel.from_pretrained(pipe.transformer, lora_ckpt_path)
pipe.transformer = pipe.transformer.merge_and_unload()
pipe = pipe.to(device)
prompt = 'a photo of a black kite and a green bear'
image = pipe(prompt, height=512, width=512, num_inference_steps=40,guidance_scale=4.5,negative_prompt="").images[0]
image.save(f"flow_grpo.png")
``` |