jieliu commited on
Commit
5efdfea
·
verified ·
1 Parent(s): bd771b3

update model

Browse files
Files changed (3) hide show
  1. README.md +40 -3
  2. adapter_config.json +38 -0
  3. adapter_model.safetensors +3 -0
README.md CHANGED
@@ -1,3 +1,40 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 photo of a black kite and a green bear'
38
+ image = pipe(prompt, height=512, width=512, num_inference_steps=40,guidance_scale=4.5).images[0]
39
+ image.save(f"flow_grpo.png")
40
+ ```
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.add_v_proj",
27
+ "attn.to_add_out",
28
+ "attn.to_k",
29
+ "attn.add_q_proj",
30
+ "attn.to_v",
31
+ "attn.to_q",
32
+ "attn.add_k_proj",
33
+ "attn.to_out.0"
34
+ ],
35
+ "task_type": null,
36
+ "use_dora": false,
37
+ "use_rslora": false
38
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5540d6bb1ebea944a6efa26ff529bbbeb303b2112ab43d090317229e615a3f04
3
+ size 75156544