update model
Browse files- lora/README.md +40 -0
- lora/adapter_config.json +38 -0
- lora/adapter_model.safetensors +3 -0
lora/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: stabilityai/stable-diffusion-3.5-medium
|
| 3 |
+
library_name: peft
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
# Model Card for Model ID
|
| 7 |
+
|
| 8 |
+
<!-- Provide a quick summary of what the model is/does. -->
|
| 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 |
+
## Model Details
|
| 12 |
+
|
| 13 |
+
### Model Sources
|
| 14 |
+
|
| 15 |
+
<!-- Provide the basic links for the model. -->
|
| 16 |
+
|
| 17 |
+
- **Repository:** https://github.com/yifan123/flow_grpo
|
| 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-GenEval"
|
| 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 weathered cave explorers journal page, with the phrase "lost city near" prominently written in faded ink, surrounded by sketches of ancient ruins and cryptic symbols, under a dim, mystical light.'
|
| 38 |
+
image = pipe(prompt, height=512, width=512, num_inference_steps=40,guidance_scale=4.5).images[0]
|
| 39 |
+
image.save(f"flow_grpo_text.png")
|
| 40 |
+
```
|
lora/adapter_config.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alpha_pattern": {},
|
| 3 |
+
"auto_mapping": {
|
| 4 |
+
"base_model_class": "SD3Transformer2DModel",
|
| 5 |
+
"parent_library": "diffusers.models.transformers.transformer_sd3"
|
| 6 |
+
},
|
| 7 |
+
"base_model_name_or_path": null,
|
| 8 |
+
"bias": "none",
|
| 9 |
+
"fan_in_fan_out": false,
|
| 10 |
+
"inference_mode": true,
|
| 11 |
+
"init_lora_weights": "gaussian",
|
| 12 |
+
"layer_replication": null,
|
| 13 |
+
"layers_pattern": null,
|
| 14 |
+
"layers_to_transform": null,
|
| 15 |
+
"loftq_config": {},
|
| 16 |
+
"lora_alpha": 64,
|
| 17 |
+
"lora_dropout": 0.0,
|
| 18 |
+
"megatron_config": null,
|
| 19 |
+
"megatron_core": "megatron.core",
|
| 20 |
+
"modules_to_save": null,
|
| 21 |
+
"peft_type": "LORA",
|
| 22 |
+
"r": 32,
|
| 23 |
+
"rank_pattern": {},
|
| 24 |
+
"revision": null,
|
| 25 |
+
"target_modules": [
|
| 26 |
+
"attn.to_add_out",
|
| 27 |
+
"attn.add_q_proj",
|
| 28 |
+
"attn.to_q",
|
| 29 |
+
"attn.to_out.0",
|
| 30 |
+
"attn.add_k_proj",
|
| 31 |
+
"attn.to_v",
|
| 32 |
+
"attn.to_k",
|
| 33 |
+
"attn.add_v_proj"
|
| 34 |
+
],
|
| 35 |
+
"task_type": null,
|
| 36 |
+
"use_dora": false,
|
| 37 |
+
"use_rslora": false
|
| 38 |
+
}
|
lora/adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a82776def305a94d7caa3f7164852bab70c749a5a3ec6de3ab5ee7b5e2d9427e
|
| 3 |
+
size 75156544
|