Jayce-Ping commited on
Commit
e9cad7c
·
verified ·
1 Parent(s): e21a72d

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +53 -172
README.md CHANGED
@@ -1,197 +1,78 @@
1
  ---
2
  base_model: stabilityai/stable-diffusion-3.5-medium
3
  library_name: peft
 
4
  tags:
5
  - lora
 
 
 
 
 
 
6
  ---
7
 
8
- # Model Card for Model ID
9
 
10
- <!-- This model card has been generated automatically according to the information provided by the PEFT library. -->
11
 
12
- ## Model Details
13
 
14
- ### Model Description
15
 
16
- <!-- Provide a longer summary of what this model is. -->
17
 
18
- - **Developed by:** [More Information Needed]
19
- - **Funded by [optional]:** [More Information Needed]
20
- - **Shared by [optional]:** [More Information Needed]
21
- - **Model type:** [More Information Needed]
22
- - **Language(s) (NLP):** [More Information Needed]
23
- - **License:** [More Information Needed]
24
- - **Finetuned from model [optional]:** [More Information Needed]
25
 
26
- ### Model Sources [optional]
 
 
27
 
28
- <!-- Provide the basic links for the model. -->
29
 
30
- - **Repository:** [More Information Needed]
31
- - **Paper:** [Flow-DPPO: Divergence Proximal Policy Optimization for Flow Matching Models](https://huggingface.co/papers/2606.11025)
32
- - **Demo [optional]:** [More Information Needed]
 
33
 
34
- ## Uses
 
 
 
35
 
36
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
 
 
 
 
 
37
 
38
- ### Direct Use
39
 
40
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
 
 
 
 
 
 
 
 
 
 
 
41
 
42
- [More Information Needed]
43
 
44
- ### Downstream Use [optional]
 
 
 
 
 
 
 
45
 
46
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
47
-
48
- [More Information Needed]
49
-
50
- ### Out-of-Scope Use
51
-
52
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
53
-
54
- [More Information Needed]
55
-
56
- ## Bias, Risks, and Limitations
57
-
58
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
59
-
60
- [More Information Needed]
61
-
62
- ### Recommendations
63
-
64
- <!-- This section provides recommendations for the use of the model. -->
65
-
66
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
67
-
68
- ## How to Get Started with the Model
69
-
70
- Use the code below to get started with the model.
71
-
72
- [More Information Needed]
73
-
74
- ## Training Details
75
-
76
- ### Training Data
77
-
78
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
79
-
80
- [More Information Needed]
81
-
82
- ### Training Procedure
83
-
84
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is useful to do so. -->
85
-
86
- #### Preprocessing [optional]
87
-
88
- [More Information Needed]
89
-
90
- #### Training Hyperparameters
91
-
92
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
93
-
94
- #### Speeds, Sizes, Times [optional]
95
-
96
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
97
-
98
- [More Information Needed]
99
-
100
- ## Evaluation
101
-
102
- <!-- This section describes the evaluation protocols and provides the results. -->
103
-
104
- ### Testing Data, Factors & Metrics
105
-
106
- #### Testing Data
107
-
108
- <!-- This should link to a Dataset Card if possible. -->
109
-
110
- [More Information Needed]
111
-
112
- #### Factors
113
-
114
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
115
-
116
- [More Information Needed]
117
-
118
- #### Metrics
119
-
120
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
121
-
122
- [More Information Needed]
123
-
124
- ### Results
125
-
126
- [More Information Needed]
127
-
128
- #### Summary
129
-
130
- ## Model Examination [optional]
131
-
132
- <!-- Relevant interpretability work for the model goes here -->
133
-
134
- [More Information Needed]
135
-
136
- ## Environmental Impact
137
-
138
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
139
-
140
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in Lacoste et al. (2019).
141
-
142
- - **Hardware Type:** [More Information Needed]
143
- - **Hours used:** [More Information Needed]
144
- - **Cloud Provider:** [More Information Needed]
145
- - **Compute Region:** [More Information Needed]
146
- - **Carbon Emitted:** [More Information Needed]
147
-
148
- ## Technical Specifications [optional]
149
-
150
- ### Model Architecture and Objective
151
-
152
- [More Information Needed]
153
-
154
- ### Compute Infrastructure
155
-
156
- [More Information Needed]
157
-
158
- #### Hardware
159
-
160
- [More Information Needed]
161
-
162
- #### Software
163
-
164
- [More Information Needed]
165
-
166
- ## Citation [optional]
167
-
168
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
169
-
170
- **BibTeX:**
171
-
172
- [More Information Needed]
173
-
174
- **APA:**
175
-
176
- [More Information Needed]
177
-
178
- ## Glossary [optional]
179
-
180
- <!-- Clearly defined terms go in this section. -->
181
-
182
- [More Information Needed]
183
-
184
- ## More Information [optional]
185
-
186
- [More Information Needed]
187
-
188
- ## Model Card Authors [optional]
189
-
190
- [More Information Needed]
191
-
192
- ## Model Card Contact
193
-
194
- [More Information Needed]
195
  ### Framework versions
196
 
197
  - PEFT 0.19.1
 
1
  ---
2
  base_model: stabilityai/stable-diffusion-3.5-medium
3
  library_name: peft
4
+ pipeline_tag: text-to-image
5
  tags:
6
  - lora
7
+ - text-to-image
8
+ - diffusers
9
+ - flow-matching
10
+ - reinforcement-learning
11
+ - flow-dppo
12
+ - geneval2
13
  ---
14
 
15
+ # SD3.5 GenEval2 Single-Reward (Flow-DPPO)
16
 
17
+ A LoRA adapter for [`stabilityai/stable-diffusion-3.5-medium`](https://huggingface.co/stabilityai/stable-diffusion-3.5-medium), fine-tuned with **Flow-DPPO** on GenEval2 in the **single-reward** setting (optimizing the GenEval2 reward only).
18
 
19
+ ## Flow-DPPO
20
 
21
+ [**Flow-DPPO**](https://huggingface.co/papers/2606.11025) (Flow Divergence Proximal Policy Optimization) is an online reinforcement learning method for flow-matching image/video generators. Methods such as Flow-GRPO and Flow-CPS cast the denoising process as a Markov Decision Process and apply PPO-style ratio clipping to enforce a trust region. Flow-DPPO argues that ratio clipping is a noisy, single-sample proxy for the true policy divergence, which over-constrains some parts of the trajectory and under-constrains others.
22
 
23
+ Because the per-step policy of a flow model is Gaussian, the KL divergence between the old and new policies can be computed exactly and cheaply. Flow-DPPO replaces ratio clipping with a divergence-proximal constraint, implemented as an **asymmetric divergence mask**: a gradient update is blocked only when (1) the advantage and ratio indicate the update is moving the policy *away* from the old policy, and (2) the exact KL already exceeds a threshold. Updates that move *back toward* the old policy are never blocked, accelerating recovery from overshooting.
24
 
25
+ This yields higher reward, better KL-proximal efficiency, stronger robustness to catastrophic forgetting, balanced multi-objective optimization, and stable multi-epoch training.
 
 
 
 
 
 
26
 
27
+ - Paper: https://huggingface.co/papers/2606.11025
28
+ - Code: https://github.com/Tencent-Hunyuan/UniRL/tree/main/FlowDPPO
29
+ - Trained with the [Flow-Factory](https://github.com/Jayce-Ping/Flow-Factory) RL framework.
30
 
31
+ ## Usage
32
 
33
+ ```python
34
+ import torch
35
+ from diffusers import StableDiffusion3Pipeline
36
+ from peft import PeftModel
37
 
38
+ pipe = StableDiffusion3Pipeline.from_pretrained(
39
+ "stabilityai/stable-diffusion-3.5-medium",
40
+ torch_dtype=torch.bfloat16,
41
+ )
42
 
43
+ # Load the Flow-DPPO LoRA adapter
44
+ pipe.transformer = PeftModel.from_pretrained(
45
+ pipe.transformer,
46
+ "Tencent-Hunyuan-Multimodal-RL/SD3.5-GenEval2-Single-Reward",
47
+ torch_dtype=torch.bfloat16,
48
+ )
49
 
50
+ pipe.enable_model_cpu_offload() # remove and call pipe.to("cuda") if you have enough VRAM
51
 
52
+ prompt = "four white cats are behind a red bagel"
53
+ image = pipe(
54
+ prompt,
55
+ height=1024,
56
+ width=1024,
57
+ guidance_scale=4.5,
58
+ num_inference_steps=40,
59
+ max_sequence_length=512,
60
+ generator=torch.Generator("cpu").manual_seed(0),
61
+ ).images[0]
62
+ image.save("output.png")
63
+ ```
64
 
65
+ ## Citation
66
 
67
+ ```bibtex
68
+ @article{ping2026flowdppo,
69
+ title={Flow-DPPO: Divergence Proximal Policy Optimization for Flow Matching Models},
70
+ author={Ping, Bowen and Zhou, Xiangxin and Qi, Penghui and Luo, Minnan and Bo, Liefeng and Pang, Tianyu},
71
+ journal={arXiv preprint arXiv:2606.11025},
72
+ year={2026}
73
+ }
74
+ ```
75
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  ### Framework versions
77
 
78
  - PEFT 0.19.1