quzo commited on
Commit
9ca2117
·
verified ·
1 Parent(s): 98f8844

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.2-dev"
4
+ tags:
5
+ - flux2
6
+ - flux2-diffusers
7
+ - text-to-image
8
+ - image-to-image
9
+ - diffusers
10
+ - simpletuner
11
+ - safe-for-work
12
+ - lora
13
+
14
+ - template:sd-lora
15
+ - standard
16
+ pipeline_tag: text-to-image
17
+ inference: true
18
+
19
+ ---
20
+
21
+ # quzo/textf22
22
+
23
+ This is a PEFT LoRA derived from [black-forest-labs/FLUX.2-dev](https://huggingface.co/black-forest-labs/FLUX.2-dev).
24
+
25
+ The main validation prompt used during training was:
26
+ ```
27
+ 🟫 man is holding a sign that says hello world from flux2
28
+ ```
29
+
30
+
31
+ ## Validation settings
32
+ - CFG: `4.0`
33
+ - CFG Rescale: `0.0`
34
+ - Steps: `16`
35
+ - Sampler: `FlowMatchEulerDiscreteScheduler`
36
+ - Seed: `42`
37
+ - Resolution: `1024x1024`
38
+
39
+
40
+ Note: The validation settings are not necessarily the same as the [training settings](#training-settings).
41
+
42
+
43
+
44
+
45
+ <Gallery />
46
+
47
+ The text encoder **was not** trained.
48
+ You may reuse the base model text encoder for inference.
49
+
50
+
51
+ ## Training settings
52
+
53
+ - Training epochs: 0
54
+ - Training steps: 600
55
+ - Learning rate: 0.0001
56
+ - Learning rate schedule: constant
57
+ - Warmup steps: 0
58
+ - Max grad value: 2.0
59
+ - Effective batch size: 1
60
+ - Micro-batch size: 1
61
+ - Gradient accumulation steps: 1
62
+ - Number of GPUs: 1
63
+ - Gradient checkpointing: True
64
+ - Prediction type: flow_matching[]
65
+ - Optimizer: adamw_bf16
66
+ - Trainable parameter precision: Pure BF16
67
+ - Base model precision: `no_change`
68
+ - Caption dropout probability: 0.1%
69
+
70
+
71
+
72
+ - LoRA Rank: 32
73
+ - LoRA Alpha: None
74
+ - LoRA Dropout: 0.1
75
+ - LoRA initialisation style: default
76
+ - LoRA mode: Standard
77
+
78
+
79
+ ## Datasets
80
+
81
+ ### emi-256
82
+ - Repeats: 10
83
+ - Total number of images: 10
84
+ - Total number of aspect buckets: 3
85
+ - Resolution: 0.065536 megapixels
86
+ - Cropped: False
87
+ - Crop style: None
88
+ - Crop aspect: None
89
+ - Used for regularisation data: No
90
+ ### emi-crop-256
91
+ - Repeats: 10
92
+ - Total number of images: 10
93
+ - Total number of aspect buckets: 2
94
+ - Resolution: 0.065536 megapixels
95
+ - Cropped: True
96
+ - Crop style: center
97
+ - Crop aspect: square
98
+ - Used for regularisation data: No
99
+ ### emi-512
100
+ - Repeats: 10
101
+ - Total number of images: 10
102
+ - Total number of aspect buckets: 3
103
+ - Resolution: 0.262144 megapixels
104
+ - Cropped: False
105
+ - Crop style: None
106
+ - Crop aspect: None
107
+ - Used for regularisation data: No
108
+ ### emi-crop-512
109
+ - Repeats: 10
110
+ - Total number of images: 10
111
+ - Total number of aspect buckets: 2
112
+ - Resolution: 0.262144 megapixels
113
+ - Cropped: True
114
+ - Crop style: center
115
+ - Crop aspect: square
116
+ - Used for regularisation data: No
117
+ ### emi-768
118
+ - Repeats: 10
119
+ - Total number of images: 10
120
+ - Total number of aspect buckets: 1
121
+ - Resolution: 0.589824 megapixels
122
+ - Cropped: False
123
+ - Crop style: None
124
+ - Crop aspect: None
125
+ - Used for regularisation data: No
126
+ ### emi-crop-768
127
+ - Repeats: 10
128
+ - Total number of images: 10
129
+ - Total number of aspect buckets: 2
130
+ - Resolution: 0.589824 megapixels
131
+ - Cropped: True
132
+ - Crop style: center
133
+ - Crop aspect: square
134
+ - Used for regularisation data: No
135
+ ### emi-1024
136
+ - Repeats: 10
137
+ - Total number of images: 10
138
+ - Total number of aspect buckets: 2
139
+ - Resolution: 1.048576 megapixels
140
+ - Cropped: False
141
+ - Crop style: None
142
+ - Crop aspect: None
143
+ - Used for regularisation data: No
144
+ ### emi-crop-1024
145
+ - Repeats: 10
146
+ - Total number of images: 10
147
+ - Total number of aspect buckets: 2
148
+ - Resolution: 1.048576 megapixels
149
+ - Cropped: True
150
+ - Crop style: center
151
+ - Crop aspect: square
152
+ - Used for regularisation data: No
153
+ ### emi-1440
154
+ - Repeats: 10
155
+ - Total number of images: 10
156
+ - Total number of aspect buckets: 2
157
+ - Resolution: 2.0736 megapixels
158
+ - Cropped: False
159
+ - Crop style: None
160
+ - Crop aspect: None
161
+ - Used for regularisation data: No
162
+ ### emi-crop-1440
163
+ - Repeats: 10
164
+ - Total number of images: 10
165
+ - Total number of aspect buckets: 2
166
+ - Resolution: 2.0736 megapixels
167
+ - Cropped: True
168
+ - Crop style: center
169
+ - Crop aspect: square
170
+ - Used for regularisation data: No
171
+
172
+
173
+ ## Inference
174
+
175
+
176
+ ```python
177
+ import torch
178
+ from diffusers import DiffusionPipeline
179
+
180
+ model_id = 'black-forest-labs/FLUX.2-dev'
181
+ adapter_id = 'quzo/quzo/textf22'
182
+ pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) # loading directly in bf16
183
+ pipeline.load_lora_weights(adapter_id)
184
+
185
+ prompt = "🟫 man is holding a sign that says hello world from flux2"
186
+ negative_prompt = 'ugly, cropped, blurry, low-quality, mediocre average'
187
+
188
+ ## Optional: quantise the model to save on vram.
189
+ ## Note: The model was not quantised during training, so it is not necessary to quantise it during inference time.
190
+ #from optimum.quanto import quantize, freeze, qint8
191
+ #quantize(pipeline.transformer, weights=qint8)
192
+ #freeze(pipeline.transformer)
193
+
194
+ 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
195
+ model_output = pipeline(
196
+ prompt=prompt,
197
+ negative_prompt=negative_prompt,
198
+ num_inference_steps=16,
199
+ generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(42),
200
+ width=1024,
201
+ height=1024,
202
+ guidance_scale=4.0,
203
+ ).images[0]
204
+
205
+ model_output.save("output.png", format="PNG")
206
+
207
+ ```
208
+
209
+
210
+