playerzer0x commited on
Commit
f413716
·
verified ·
1 Parent(s): 08200a7

Model card auto-generated by SimpleTuner

Browse files
Files changed (1) hide show
  1. README.md +376 -0
README.md ADDED
@@ -0,0 +1,376 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ base_model: "black-forest-labs/FLUX.1-dev"
4
+ tags:
5
+ - flux
6
+ - flux-diffusers
7
+ - text-to-image
8
+ - diffusers
9
+ - simpletuner
10
+ - not-for-all-audiences
11
+ - lora
12
+ - template:sd-lora
13
+ - lycoris
14
+ inference: true
15
+ widget:
16
+ - text: 'unconditional (blank prompt)'
17
+ parameters:
18
+ negative_prompt: 'blurry, cropped, ugly'
19
+ output:
20
+ url: ./assets/image_0_0.png
21
+ - text: 'gh logo, on four cans, black background'
22
+ parameters:
23
+ negative_prompt: 'blurry, cropped, ugly'
24
+ output:
25
+ url: ./assets/image_1_0.png
26
+ - text: 'gh logo, green background, on a bottle and a can'
27
+ parameters:
28
+ negative_prompt: 'blurry, cropped, ugly'
29
+ output:
30
+ url: ./assets/image_2_0.png
31
+ - text: 'gh logo, on a bottle and 4 cans, white background'
32
+ parameters:
33
+ negative_prompt: 'blurry, cropped, ugly'
34
+ output:
35
+ url: ./assets/image_3_0.png
36
+ - text: 'gh logo, on a bottle and two cans, red orange background'
37
+ parameters:
38
+ negative_prompt: 'blurry, cropped, ugly'
39
+ output:
40
+ url: ./assets/image_4_0.png
41
+ - text: 'gh cans, yellow background, brown red can, served with other drinks'
42
+ parameters:
43
+ negative_prompt: 'blurry, cropped, ugly'
44
+ output:
45
+ url: ./assets/image_5_0.png
46
+ - text: 'gh cans, white background'
47
+ parameters:
48
+ negative_prompt: 'blurry, cropped, ugly'
49
+ output:
50
+ url: ./assets/image_6_0.png
51
+ - text: 'gh cans, in a bucket of ice, white background'
52
+ parameters:
53
+ negative_prompt: 'blurry, cropped, ugly'
54
+ output:
55
+ url: ./assets/image_7_0.png
56
+ - text: 'gh cans, being held, out of focus background'
57
+ parameters:
58
+ negative_prompt: 'blurry, cropped, ugly'
59
+ output:
60
+ url: ./assets/image_8_0.png
61
+ - text: 'dct desert rally racing background, driving a Ducati bike, out of focus shrubbery'
62
+ parameters:
63
+ negative_prompt: 'blurry, cropped, ugly'
64
+ output:
65
+ url: ./assets/image_9_0.png
66
+ - text: 'dct desert rally racing background, driving a Ducati bike, splashing water'
67
+ parameters:
68
+ negative_prompt: 'blurry, cropped, ugly'
69
+ output:
70
+ url: ./assets/image_10_0.png
71
+ - text: 'dct desert rally racing background, driving a Ducati bike, rider in a white motocross outfit, dust cloud'
72
+ parameters:
73
+ negative_prompt: 'blurry, cropped, ugly'
74
+ output:
75
+ url: ./assets/image_11_0.png
76
+ - text: 'dct desert rally racing background, driving a Ducati bike, view of a lake with shrubs and trees in the background, other riders and spectators'
77
+ parameters:
78
+ negative_prompt: 'blurry, cropped, ugly'
79
+ output:
80
+ url: ./assets/image_12_0.png
81
+ - text: 'anytylrjy woman, wearing a neckless and an opaque brown dress standing on the red carpet, hair done up, front view'
82
+ parameters:
83
+ negative_prompt: 'blurry, cropped, ugly'
84
+ output:
85
+ url: ./assets/image_13_0.png
86
+ - text: 'anytylrjy woman, putting on lipstick in front of a mirror, wearing a flowing white dress or bathrobe, looking in multiple mirrors, makeup on table'
87
+ parameters:
88
+ negative_prompt: 'blurry, cropped, ugly'
89
+ output:
90
+ url: ./assets/image_14_0.png
91
+ - text: 'anytylrjy woman, holding a makeup kit, staring directly at camera, brown background, wearing a ring and eggshell dress'
92
+ parameters:
93
+ negative_prompt: 'blurry, cropped, ugly'
94
+ output:
95
+ url: ./assets/image_15_0.png
96
+ - text: 'anytylrjy woman, wearing an elegant emerald green dress, wearing earrings and a necklace, white background'
97
+ parameters:
98
+ negative_prompt: 'blurry, cropped, ugly'
99
+ output:
100
+ url: ./assets/image_16_0.png
101
+ - text: 'mrtnprr style'
102
+ parameters:
103
+ negative_prompt: 'blurry, cropped, ugly'
104
+ output:
105
+ url: ./assets/image_17_0.png
106
+ - text: 'mrtnprr style'
107
+ parameters:
108
+ negative_prompt: 'blurry, cropped, ugly'
109
+ output:
110
+ url: ./assets/image_18_0.png
111
+ - text: 'mrtnprr style'
112
+ parameters:
113
+ negative_prompt: 'blurry, cropped, ugly'
114
+ output:
115
+ url: ./assets/image_19_0.png
116
+ - text: 'mrtnprr style'
117
+ parameters:
118
+ negative_prompt: 'blurry, cropped, ugly'
119
+ output:
120
+ url: ./assets/image_20_0.png
121
+ - text: 'a photo of a daisy'
122
+ parameters:
123
+ negative_prompt: 'blurry, cropped, ugly'
124
+ output:
125
+ url: ./assets/image_21_0.png
126
+ ---
127
+
128
+ # growwithdaisy/ghxdct_style_focus_20241113_125207
129
+
130
+ This is a LyCORIS adapter derived from [black-forest-labs/FLUX.1-dev](https://huggingface.co/black-forest-labs/FLUX.1-dev).
131
+
132
+
133
+ The main validation prompt used during training was:
134
+
135
+
136
+
137
+ ```
138
+ a photo of a daisy
139
+ ```
140
+
141
+ ## Validation settings
142
+ - CFG: `3.5`
143
+ - CFG Rescale: `0.0`
144
+ - Steps: `20`
145
+ - Sampler: `None`
146
+ - Seed: `69`
147
+ - Resolution: `1024x1024`
148
+
149
+ Note: The validation settings are not necessarily the same as the [training settings](#training-settings).
150
+
151
+ You can find some example images in the following gallery:
152
+
153
+
154
+ <Gallery />
155
+
156
+ The text encoder **was not** trained.
157
+ You may reuse the base model text encoder for inference.
158
+
159
+
160
+ ## Training settings
161
+
162
+ - Training epochs: 5
163
+ - Training steps: 500
164
+ - Learning rate: 5e-06
165
+ - Max grad norm: 2.0
166
+ - Effective batch size: 8
167
+ - Micro-batch size: 1
168
+ - Gradient accumulation steps: 1
169
+ - Number of GPUs: 8
170
+ - Prediction type: flow-matching (extra parameters=['shift=3', 'flux_guidance_value=1.0'])
171
+ - Rescaled betas zero SNR: False
172
+ - Optimizer: optimi-stableadamwweight_decay=1e-3
173
+ - Precision: Pure BF16
174
+ - Quantised: No
175
+ - Xformers: Not used
176
+ - LyCORIS Config:
177
+ ```json
178
+ {
179
+ "algo": "lokr",
180
+ "multiplier": 1,
181
+ "linear_dim": 1000000,
182
+ "linear_alpha": 1,
183
+ "factor": 16,
184
+ "init_lokr_norm": 0.001,
185
+ "apply_preset": {
186
+ "target_module": [
187
+ "FluxTransformerBlock",
188
+ "FluxSingleTransformerBlock"
189
+ ],
190
+ "module_algo_map": {
191
+ "Attention": {
192
+ "factor": 16
193
+ },
194
+ "FeedForward": {
195
+ "factor": 8
196
+ }
197
+ }
198
+ }
199
+ }
200
+ ```
201
+
202
+ ## Datasets
203
+
204
+ ### gh_logo-512
205
+ - Repeats: 0
206
+ - Total number of images: ~32
207
+ - Total number of aspect buckets: 4
208
+ - Resolution: 0.262144 megapixels
209
+ - Cropped: False
210
+ - Crop style: None
211
+ - Crop aspect: None
212
+ - Used for regularisation data: No
213
+ ### gh_cans-512
214
+ - Repeats: 0
215
+ - Total number of images: ~56
216
+ - Total number of aspect buckets: 6
217
+ - Resolution: 0.262144 megapixels
218
+ - Cropped: False
219
+ - Crop style: None
220
+ - Crop aspect: None
221
+ - Used for regularisation data: No
222
+ ### gh_cans-768
223
+ - Repeats: 0
224
+ - Total number of images: ~40
225
+ - Total number of aspect buckets: 5
226
+ - Resolution: 0.589824 megapixels
227
+ - Cropped: False
228
+ - Crop style: None
229
+ - Crop aspect: None
230
+ - Used for regularisation data: No
231
+ ### gh_cans-1024
232
+ - Repeats: 0
233
+ - Total number of images: ~16
234
+ - Total number of aspect buckets: 2
235
+ - Resolution: 1.048576 megapixels
236
+ - Cropped: False
237
+ - Crop style: None
238
+ - Crop aspect: None
239
+ - Used for regularisation data: No
240
+ ### dct_desert_rally_racing_background-512
241
+ - Repeats: 0
242
+ - Total number of images: ~56
243
+ - Total number of aspect buckets: 5
244
+ - Resolution: 0.262144 megapixels
245
+ - Cropped: False
246
+ - Crop style: None
247
+ - Crop aspect: None
248
+ - Used for regularisation data: No
249
+ ### dct_desert_rally_racing_background-768
250
+ - Repeats: 0
251
+ - Total number of images: ~56
252
+ - Total number of aspect buckets: 5
253
+ - Resolution: 0.589824 megapixels
254
+ - Cropped: False
255
+ - Crop style: None
256
+ - Crop aspect: None
257
+ - Used for regularisation data: No
258
+ ### dct_desert_rally_racing_background-1024
259
+ - Repeats: 0
260
+ - Total number of images: ~48
261
+ - Total number of aspect buckets: 4
262
+ - Resolution: 1.048576 megapixels
263
+ - Cropped: False
264
+ - Crop style: None
265
+ - Crop aspect: None
266
+ - Used for regularisation data: No
267
+ ### anytylrjy_woman-512
268
+ - Repeats: 0
269
+ - Total number of images: ~64
270
+ - Total number of aspect buckets: 7
271
+ - Resolution: 0.262144 megapixels
272
+ - Cropped: False
273
+ - Crop style: None
274
+ - Crop aspect: None
275
+ - Used for regularisation data: No
276
+ ### anytylrjy_woman-768
277
+ - Repeats: 0
278
+ - Total number of images: ~64
279
+ - Total number of aspect buckets: 7
280
+ - Resolution: 0.589824 megapixels
281
+ - Cropped: False
282
+ - Crop style: None
283
+ - Crop aspect: None
284
+ - Used for regularisation data: No
285
+ ### anytylrjy_woman-1024
286
+ - Repeats: 0
287
+ - Total number of images: ~72
288
+ - Total number of aspect buckets: 8
289
+ - Resolution: 1.048576 megapixels
290
+ - Cropped: False
291
+ - Crop style: None
292
+ - Crop aspect: None
293
+ - Used for regularisation data: No
294
+ ### mrtnprr_style-512
295
+ - Repeats: 1
296
+ - Total number of images: ~48
297
+ - Total number of aspect buckets: 6
298
+ - Resolution: 0.262144 megapixels
299
+ - Cropped: False
300
+ - Crop style: None
301
+ - Crop aspect: None
302
+ - Used for regularisation data: No
303
+ ### mrtnprr_style-768
304
+ - Repeats: 1
305
+ - Total number of images: ~40
306
+ - Total number of aspect buckets: 5
307
+ - Resolution: 0.589824 megapixels
308
+ - Cropped: False
309
+ - Crop style: None
310
+ - Crop aspect: None
311
+ - Used for regularisation data: No
312
+ ### mrtnprr_style-1024
313
+ - Repeats: 1
314
+ - Total number of images: ~16
315
+ - Total number of aspect buckets: 2
316
+ - Resolution: 1.048576 megapixels
317
+ - Cropped: False
318
+ - Crop style: None
319
+ - Crop aspect: None
320
+ - Used for regularisation data: No
321
+
322
+
323
+ ## Inference
324
+
325
+
326
+ ```python
327
+ import torch
328
+ from diffusers import DiffusionPipeline
329
+ from lycoris import create_lycoris_from_weights
330
+
331
+
332
+ def download_adapter(repo_id: str):
333
+ import os
334
+ from huggingface_hub import hf_hub_download
335
+ adapter_filename = "pytorch_lora_weights.safetensors"
336
+ cache_dir = os.environ.get('HF_PATH', os.path.expanduser('~/.cache/huggingface/hub/models'))
337
+ cleaned_adapter_path = repo_id.replace("/", "_").replace("\\", "_").replace(":", "_")
338
+ path_to_adapter = os.path.join(cache_dir, cleaned_adapter_path)
339
+ path_to_adapter_file = os.path.join(path_to_adapter, adapter_filename)
340
+ os.makedirs(path_to_adapter, exist_ok=True)
341
+ hf_hub_download(
342
+ repo_id=repo_id, filename=adapter_filename, local_dir=path_to_adapter
343
+ )
344
+
345
+ return path_to_adapter_file
346
+
347
+ model_id = 'black-forest-labs/FLUX.1-dev'
348
+ adapter_repo_id = 'playerzer0x/growwithdaisy/ghxdct_style_focus_20241113_125207'
349
+ adapter_filename = 'pytorch_lora_weights.safetensors'
350
+ adapter_file_path = download_adapter(repo_id=adapter_repo_id)
351
+ pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) # loading directly in bf16
352
+ lora_scale = 1.0
353
+ wrapper, _ = create_lycoris_from_weights(lora_scale, adapter_file_path, pipeline.transformer)
354
+ wrapper.merge_to()
355
+
356
+ prompt = "a photo of a daisy"
357
+
358
+
359
+ ## Optional: quantise the model to save on vram.
360
+ ## Note: The model was not quantised during training, so it is not necessary to quantise it during inference time.
361
+ #from optimum.quanto import quantize, freeze, qint8
362
+ #quantize(pipeline.transformer, weights=qint8)
363
+ #freeze(pipeline.transformer)
364
+
365
+ pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu') # the pipeline is already in its target precision level
366
+ image = pipeline(
367
+ prompt=prompt,
368
+ num_inference_steps=20,
369
+ generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(1641421826),
370
+ width=1024,
371
+ height=1024,
372
+ guidance_scale=3.5,
373
+ ).images[0]
374
+ image.save("output.png", format="PNG")
375
+ ```
376
+