Diffusers
Anzhc commited on
Commit
3b8bbf2
·
verified ·
1 Parent(s): 1b0a41c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +236 -5
README.md CHANGED
@@ -1,5 +1,236 @@
1
- ---
2
- license: other
3
- license_name: fair-ai-public-license-1.0-sd
4
- license_link: https://freedevproject.org/faipl-1.0-sd/
5
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_name: fair-ai-public-license-1.0-sd
4
+ license_link: https://freedevproject.org/faipl-1.0-sd/
5
+ base_model:
6
+ - CabalResearch/NoobAI-Flux2VAE-RectifiedFlow
7
+ library_name: diffusers
8
+ ---
9
+ ## Model Details
10
+
11
+ A continuation of the [NoobAI Flux2 VAE experiment](https://huggingface.co/CabalResearch/NoobAI-Flux2VAE-RectifiedFlow)
12
+
13
+ More info on supporting us: [click me](https://huggingface.co/CabalResearch/NoobAI-Flux2VAE-RectifiedFlow-0.3#potential-future)
14
+
15
+ ### Model Description
16
+
17
+ Resumed for 4 more epochs, model has shown a nice improvement. We observe good convergence to new details, that were hard to achieve on prior arch. Compositions and stability are strongly improved relative to Epoch 2, as well as downstream trainability (like LoRAs).
18
+
19
+ Current state is usable for normal generations, so we encourage you to try it. We will provide an [easy node for ComfyUI](https://github.com/Anzhc/SDXL-Flux2VAE-ComfyUI-Node), as well as basic workflow. If you are an A1111 user, please use [ReForge](https://github.com/Panchovix/stable-diffusion-webui-reForge), it has native support, instructions will be below.
20
+
21
+
22
+ ![e2-6 progress](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/luRNeWtDiT78z-cfuMI8k.png)
23
+
24
+ Once again, we are working with limited compute, but are quite happy with the result so far, and hope to continue working on the model.
25
+
26
+
27
+ - **Developed by:** Cabal Research (Bluvoll, Anzhc)
28
+ - **Funded by:** Community
29
+ - **License:** [fair-ai-public-license-1.0-sd](https://freedevproject.org/faipl-1.0-sd/)
30
+ - **Finetuned from model:** [NoobAI Flux2 VAE experiment](https://huggingface.co/CabalResearch/NoobAI-Flux2VAE-RectifiedFlow)
31
+
32
+
33
+ ## Bias and Limitations
34
+
35
+ While we are seeing new level of details, it is still early to call it a day. Complex intersections, extremely small details, abstract and wide shots will pose a significant challenge to model and result in noise-like patterns, but we see steady progression in resolving that noise through epochs.
36
+
37
+ Most biases of official dataset will apply(Blue Archive, etc.).
38
+
39
+ We are yet to get to steady composition and anatomy, but good LoRAs help drastically with this at current stage.
40
+
41
+
42
+ ## Model Output Examples
43
+
44
+ ![00182-1507939795](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/aGUOjzYm857vyJ4Bw3A3s.png)
45
+
46
+ ![00175-1757655322](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/910YmdSXDkPfixIwyKbfv.png)
47
+
48
+ ![00180-26729011](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/19dUzddyfZDdBfWI38B5P.png)
49
+
50
+ ![00177-246779580](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/6ZZQd3m5TeG2OQYbaDSeq.png)
51
+
52
+ ![00178-1560785548](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/RzsGySlS8YEBLginowFSZ.png)
53
+
54
+ ![00181-1519334009](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/2dZug4PjLhmgr7YSTaOFe.png)
55
+
56
+ ![00179-1426592070](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/gsWqweJ-__V2L4-a0sncF.png)
57
+
58
+ P.S. We are pretty bad at generating images, on Epoch 2 we've seen quite a few examples of much better generations that what we've shown, wonder if this time it will also be the case.
59
+
60
+ # Recommendations
61
+
62
+ ### Inference
63
+
64
+ #### Comfy
65
+
66
+ ![image](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/urIE5XGaUpjkaXutaiebs.png)
67
+
68
+ (Workflow is available alongside model in repo)
69
+ We will provide a Node, and hope it will be adapted natively in main repo eventually:
70
+ **https://github.com/Anzhc/SDXL-Flux2VAE-ComfyUI-Node**
71
+
72
+ Same as your normal inference, but with addition of SD3 sampling node, as this model is Flow-based.
73
+
74
+ Recommended Parameters:
75
+ **Sampler**: Euler, Euler A, DPM++ SDE, etc.
76
+ **Steps**: 20-28
77
+ **CFG**: 6-9
78
+ **Shift**: 3-12
79
+ **Schedule**: Normal/Simple/SGM Uniform/Quadratic
80
+ **Positive Quality Tags**: `masterpiece, best quality`
81
+ **Negative Tags**: `worst quality, normal quality, bad anatomy`
82
+
83
+
84
+ #### A1111 WebUI
85
+
86
+ (All screenshots are repeating our RF release, as there is no difference in setup)
87
+
88
+
89
+ Recommended WebUI: [ReForge](https://github.com/Panchovix/stable-diffusion-webui-reForge) - has native support for Flow models, and we've PR'd our native support for Flux2vae-based SDXL modification.
90
+
91
+
92
+ **How to use in ReForge**:
93
+
94
+ ![изображение](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/UV5Yp66H7YlccdQqborPf.png)
95
+ (ignore Sigma max field at the top, this is not used in RF)
96
+
97
+ Support for RF in ReForge is being implemented through a built-in extension:
98
+
99
+ ![изображение](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/LpMF0lmC96X001Au9fFU_.png)
100
+
101
+
102
+ ![imagen](https://cdn-uploads.huggingface.co/production/uploads/634cf025fe861cc73a2e7dd0/siEBfX41E6D_DUEqaXMgs.png)
103
+
104
+ Set parameters to that, and you're good to go.
105
+
106
+ Flux2VAE does not currently have an appropriate high quality preview method, please use Approx Cheap option, which would allow you to see simple PCA projection(ReForge).
107
+
108
+ Recommended Parameters:
109
+ **Sampler**: Euler A Comfy RF, Euler A2, Euler, DPM++ SDE Comfy, etc. **ALL VARIANTS MUST BE RF OR COMFY, IF AVAILABLE. In ComfyUI routing is automatic, but not in the case of WebUI.**
110
+ **Steps**: 20-28
111
+ **CFG**: 6-9
112
+ **Shift**: 3-12
113
+ **Schedule**: Normal/Simple/SGM Uniform
114
+ **Positive Quality Tags**: `masterpiece, best quality`
115
+ **Negative Tags**: `worst quality, normal quality, bad anatomy`
116
+
117
+ **ADETAILER FIX FOR RF**:
118
+ By default, Adetailer discards Advanced Model Sampling extension, which breaks RF. You need to add AMS to this part of settings:
119
+
120
+ ![изображение](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/RQMtfm5Xi3V7oNsqXoZJN.png)
121
+
122
+ Add: `advanced_model_sampling_script,advanced_model_sampling_script_backported` to there.
123
+
124
+ If that does not work, go into adetailer extension, find args.py, open it, replace _builtin_scripts like this:
125
+
126
+ ![изображение](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/rmnS-i_kciJzTZmeR-mGP.png)
127
+
128
+ Here is a copypaste for easy copy:
129
+ ```
130
+ _builtin_script = (
131
+ "advanced_model_sampling_script",
132
+ "advanced_model_sampling_script_backported",
133
+ "hypertile_script",
134
+ "soft_inpainting",
135
+ )
136
+ ```
137
+
138
+ Or use my fork of Adetailer - https://github.com/Anzhc/aadetailer-reforge
139
+
140
+ ## Training
141
+
142
+ ### Model Composition
143
+ (Relative to base it's trained from)
144
+
145
+ Unet: Same
146
+ CLIP L: Same, Frozen
147
+ CLIP G: Same, Frozen
148
+ VAE: [Flux2 VAE](https://huggingface.co/black-forest-labs/FLUX.2-dev/tree/main/vae)
149
+
150
+
151
+ ### Training Details
152
+ (Main Stage Training)
153
+
154
+ **Samples seen**(unbatched steps): ~50 million samples seen
155
+ **Learning Rate**: 6-5e-5 (mixed)
156
+ **Effective Batch size**: ~1400
157
+ **Precision**: Mixed BF16
158
+ **Optimizer**: AdamW8bit with Kahan Summation
159
+ **Weight Decay**: 0.01
160
+ **Schedule**: Constant with warmup
161
+ **Timestep Sampling Strategy**: Logit-Normal -0.2 1.5 (sometimes referred to as Lognorm), Shift 2.5
162
+ **Text Encoders**: Frozen
163
+ **Keep Token**: False
164
+ **Tag Dropout**: 10%
165
+ **Uncond Dropout**: 10%
166
+ **Shuffle**: True
167
+
168
+ **VAE Conv Padding**: False
169
+ **VAE Shift**: 0.0760
170
+ **VAE Scale**: 0.6043
171
+
172
+ **Additional Features used**: Protected Tags, Cosine Optimal Transport.
173
+
174
+ #### Training Data
175
+
176
+ 6 epochs of the original NoobAI dataset, including images up to October 2024, minus screencap data(was not shared).
177
+
178
+
179
+ ### LoRA Training
180
+
181
+ Current state of the model provides adequate trainability, but expect the need to train for a bit longer, as we are still undertrained.
182
+ My current style training settings (Anzhc):
183
+
184
+ **Learning Rate**: tested up to **7.5e-4**
185
+ **Batch Size**: 144 (6 real * 24 accum), using SGA(Stochastic Gradient Accumulation) - without SGA I probably would lower accum to 4-8.
186
+ **Optimizer**: Adamw8bit with Kahan summation
187
+ **Schedule**: ReREX (Use REX for simplicity, or Cosine annealing)
188
+ **Precision**: Full BF16
189
+ **Weight Decay**: 0.02
190
+ **Timestep Sampling Strategy**: Logit-Normal(either 0.0 1.0, or -0.2 1.5), Shift 2.5-4.5
191
+
192
+ **Dim/Alpha/Conv/Alpha**: 24/24/24/24 (Lycoris/Locon)
193
+
194
+ **Text Encoders**: Frozen
195
+
196
+ **Optimal Transport**: True
197
+
198
+ **Expected Dataset Size**: 100-200 images (Can be even 10, but balance with repeats to roughly this target.)
199
+ **Epochs**: 50
200
+
201
+ Concepts seem to train at similar speed to prior NoobAI models, but have not tested explicitly.
202
+
203
+ ### Hardware
204
+
205
+ Model was trained on cloud 8xH200 node.
206
+
207
+ ### Software
208
+
209
+ Custom fork of [SD-Scripts](https://github.com/bluvoll/sd-scripts)(maintained by Bluvoll)
210
+
211
+ ## Acknowledgements
212
+
213
+ ### Special Thanks
214
+
215
+ **To a special supporter who singlehandidly sponsored whole run and preferred to stay anonymous**
216
+
217
+ ---
218
+
219
+ # Support
220
+ If you wish to support our continuous effort of making waifus 0.2% better, you can do it here:
221
+
222
+ ### **https://ko-fi.com/bluvoll** (Blu, donate here to support training)
223
+
224
+ https://ko-fi.com/anzhc (Anzhc, non-training, just survival)
225
+
226
+ ![image](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/qpcOFLCI-B7QBADEYwMhA.png)
227
+
228
+ Crypto link pending.
229
+
230
+ # Potential future
231
+
232
+ **Expected Compute Needed**: We still consider full run to be in range of 20+ epochs, but no longer think that it is the bare minimum for stable model, as progress with just current 6 epochs has been quite drastic in that regard. 10 epochs are likely a good marker for that.
233
+
234
+ **Dataset**: We would love to start processing of the booru data with our in-house classification models to fix some of the glaring issues with the default Danbooru dataset, as well as thorough processing to some of the concepts, but we as of now we don't have budget to rent a dedicated server for persistent storage.
235
+
236
+ **Future Training**: We have confirmation from Sponsor that we would continue training of the model beyond Epoch 6, but it will resume after a short break.