playerzer0x commited on
Commit
0074e22
·
verified ·
1 Parent(s): d528c32

Model card auto-generated by SimpleTuner

Browse files
Files changed (1) hide show
  1. README.md +210 -0
README.md ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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: 'cplbrkp scene, a woman wearing a reverse crtdt hot swingers tee throwing a man''s luggage off a balcony, outdoors, dv cam'
22
+ parameters:
23
+ negative_prompt: 'blurry, cropped, ugly'
24
+ output:
25
+ url: ./assets/image_1_0.png
26
+ - text: 'a light-skinned woman, holding reverse crtdt hitters only tee, wearing black clothes, standing on top of an area rug, a projector screen in the background with windows on walls, woman is looking at the tee, two art stands on either side of the woman with sculptures on them'
27
+ parameters:
28
+ negative_prompt: 'blurry, cropped, ugly'
29
+ output:
30
+ url: ./assets/image_2_0.png
31
+ - text: 'the back of a tan-skinned man, wearing reverse crtdt hot swingers tee and white sneakers and dark blue shorts, a light-skinned woman, wearing black clothes, right half of the room is dark and left half is lit up, crtdt hitters only tee draped over the couch'
32
+ parameters:
33
+ negative_prompt: 'blurry, cropped, ugly'
34
+ output:
35
+ url: ./assets/image_3_0.png
36
+ - text: 'a tan-skinned man, wearing white crtdt hot swingers tee and white sneakers and dark blue shorts, holding a smartphone, wearing glasses, hardwood floor, boxes in the background'
37
+ parameters:
38
+ negative_prompt: 'blurry, cropped, ugly'
39
+ output:
40
+ url: ./assets/image_4_0.png
41
+ - text: 'man wearing a reverse crtdt hitters only tee'
42
+ parameters:
43
+ negative_prompt: 'blurry, cropped, ugly'
44
+ output:
45
+ url: ./assets/image_5_0.png
46
+ ---
47
+
48
+ # growwithdaisy/crtdt_20241212_160352_20241212_165412
49
+
50
+ This is a LyCORIS adapter derived from [black-forest-labs/FLUX.1-dev](https://huggingface.co/black-forest-labs/FLUX.1-dev).
51
+
52
+
53
+ The main validation prompt used during training was:
54
+ ```
55
+ man wearing a reverse crtdt hitters only tee
56
+ ```
57
+
58
+
59
+ ## Validation settings
60
+ - CFG: `3.5`
61
+ - CFG Rescale: `0.0`
62
+ - Steps: `20`
63
+ - Sampler: `FlowMatchEulerDiscreteScheduler`
64
+ - Seed: `69`
65
+ - Resolution: `1024x1024`
66
+ - Skip-layer guidance:
67
+
68
+ Note: The validation settings are not necessarily the same as the [training settings](#training-settings).
69
+
70
+ You can find some example images in the following gallery:
71
+
72
+
73
+ <Gallery />
74
+
75
+ The text encoder **was not** trained.
76
+ You may reuse the base model text encoder for inference.
77
+
78
+
79
+ ## Training settings
80
+
81
+ - Training epochs: 17
82
+ - Training steps: 500
83
+ - Learning rate: 0.0002
84
+ - Learning rate schedule: constant
85
+ - Warmup steps: 0
86
+ - Max grad norm: 2.0
87
+ - Effective batch size: 16
88
+ - Micro-batch size: 2
89
+ - Gradient accumulation steps: 1
90
+ - Number of GPUs: 8
91
+ - Gradient checkpointing: True
92
+ - Prediction type: flow-matching (extra parameters=['shift=3', 'flux_guidance_mode=constant', 'flux_guidance_value=1.0', 'flow_matching_loss=compatible'])
93
+ - Optimizer: optimi-stableadamwweight_decay=1e-3
94
+ - Trainable parameter precision: Pure BF16
95
+ - Caption dropout probability: 5.0%
96
+
97
+
98
+ ### LyCORIS Config:
99
+ ```json
100
+ {
101
+ "algo": "lokr",
102
+ "multiplier": 1,
103
+ "linear_dim": 1000000,
104
+ "linear_alpha": 1,
105
+ "factor": 16,
106
+ "init_lokr_norm": 0.001,
107
+ "apply_preset": {
108
+ "target_module": [
109
+ "FluxTransformerBlock",
110
+ "FluxSingleTransformerBlock"
111
+ ],
112
+ "module_algo_map": {
113
+ "Attention": {
114
+ "factor": 16
115
+ },
116
+ "FeedForward": {
117
+ "factor": 8
118
+ }
119
+ }
120
+ }
121
+ }
122
+ ```
123
+
124
+ ## Datasets
125
+
126
+ ### crtdt_20241212_160352-512
127
+ - Repeats: 2
128
+ - Total number of images: ~40
129
+ - Total number of aspect buckets: 4
130
+ - Resolution: 0.262144 megapixels
131
+ - Cropped: False
132
+ - Crop style: None
133
+ - Crop aspect: None
134
+ - Used for regularisation data: No
135
+ ### crtdt_20241212_160352-768
136
+ - Repeats: 1
137
+ - Total number of images: ~40
138
+ - Total number of aspect buckets: 4
139
+ - Resolution: 0.589824 megapixels
140
+ - Cropped: False
141
+ - Crop style: None
142
+ - Crop aspect: None
143
+ - Used for regularisation data: No
144
+ ### crtdt_20241212_160352-1024
145
+ - Repeats: 1
146
+ - Total number of images: ~40
147
+ - Total number of aspect buckets: 4
148
+ - Resolution: 1.048576 megapixels
149
+ - Cropped: False
150
+ - Crop style: None
151
+ - Crop aspect: None
152
+ - Used for regularisation data: No
153
+
154
+
155
+ ## Inference
156
+
157
+
158
+ ```python
159
+ import torch
160
+ from diffusers import DiffusionPipeline
161
+ from lycoris import create_lycoris_from_weights
162
+
163
+
164
+ def download_adapter(repo_id: str):
165
+ import os
166
+ from huggingface_hub import hf_hub_download
167
+ adapter_filename = "pytorch_lora_weights.safetensors"
168
+ cache_dir = os.environ.get('HF_PATH', os.path.expanduser('~/.cache/huggingface/hub/models'))
169
+ cleaned_adapter_path = repo_id.replace("/", "_").replace("\\", "_").replace(":", "_")
170
+ path_to_adapter = os.path.join(cache_dir, cleaned_adapter_path)
171
+ path_to_adapter_file = os.path.join(path_to_adapter, adapter_filename)
172
+ os.makedirs(path_to_adapter, exist_ok=True)
173
+ hf_hub_download(
174
+ repo_id=repo_id, filename=adapter_filename, local_dir=path_to_adapter
175
+ )
176
+
177
+ return path_to_adapter_file
178
+
179
+ model_id = 'black-forest-labs/FLUX.1-dev'
180
+ adapter_repo_id = 'playerzer0x/growwithdaisy/crtdt_20241212_160352_20241212_165412'
181
+ adapter_filename = 'pytorch_lora_weights.safetensors'
182
+ adapter_file_path = download_adapter(repo_id=adapter_repo_id)
183
+ pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) # loading directly in bf16
184
+ lora_scale = 1.0
185
+ wrapper, _ = create_lycoris_from_weights(lora_scale, adapter_file_path, pipeline.transformer)
186
+ wrapper.merge_to()
187
+
188
+ prompt = "man wearing a reverse crtdt hitters only tee"
189
+
190
+
191
+ ## Optional: quantise the model to save on vram.
192
+ ## Note: The model was not quantised during training, so it is not necessary to quantise it during inference time.
193
+ #from optimum.quanto import quantize, freeze, qint8
194
+ #quantize(pipeline.transformer, weights=qint8)
195
+ #freeze(pipeline.transformer)
196
+
197
+ 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
198
+ image = pipeline(
199
+ prompt=prompt,
200
+ num_inference_steps=20,
201
+ generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(69),
202
+ width=1024,
203
+ height=1024,
204
+ guidance_scale=3.5,
205
+ ).images[0]
206
+ image.save("output.png", format="PNG")
207
+ ```
208
+
209
+
210
+