davidrd123 commited on
Commit
72ef3ad
·
verified ·
1 Parent(s): 18e4e2e

Model card auto-generated by SimpleTuner

Browse files
Files changed (1) hide show
  1. README.md +247 -0
README.md ADDED
@@ -0,0 +1,247 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ - safe-for-work
11
+ - lora
12
+ - template:sd-lora
13
+ - standard
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: 'In the style of m4rc0 anime background paintings, A series of industrial machines are arranged in rows inside a large, spacious warehouse. Bright natural light streams in from expansive windows, casting shadows across the wooden floor. The interior is filled with structural elements like beams and supports, suggesting a manufacturing environment.'
22
+ parameters:
23
+ negative_prompt: 'blurry, cropped, ugly'
24
+ output:
25
+ url: ./assets/image_1_0.png
26
+ - text: 'In the style of m4rc0 anime background paintings, A moonlit alley with clothes hanging on a line and dimly lit buildings. The sky is overcast with clouds partially covering the moon. Balconies and beams create shadows across the scene.'
27
+ parameters:
28
+ negative_prompt: 'blurry, cropped, ugly'
29
+ output:
30
+ url: ./assets/image_2_0.png
31
+ - text: 'In the style of m4rc0 anime background paintings, A dark, starry night sky with swirling clouds over a mountainous landscape. A small, illuminated caravan sits in an open field dotted with white flowers.'
32
+ parameters:
33
+ negative_prompt: 'blurry, cropped, ugly'
34
+ output:
35
+ url: ./assets/image_3_0.png
36
+ - text: 'In the style of m4rc0 anime background paintings, A green chalkboard with handwritten text partially covered by shadows cast from a window. The window frame and sunlight create distinct lines and patterns on the board. Artwork pages are pinned at the top.'
37
+ parameters:
38
+ negative_prompt: 'blurry, cropped, ugly'
39
+ output:
40
+ url: ./assets/image_4_0.png
41
+ - text: 'In the style of m4rc0 anime background paintings, A misty morning harbor with fishing boats gently bobbing in the water. The rising sun casts long shadows across weathered wooden docks, while seabirds circle overhead. Stacked crates and coiled ropes line the pier.'
42
+ parameters:
43
+ negative_prompt: 'blurry, cropped, ugly'
44
+ output:
45
+ url: ./assets/image_5_0.png
46
+ - text: 'In the style of m4rc0 anime background paintings, A two-story library interior with spiral staircases and towering wooden bookshelves. Autumn sunlight filters through stained glass windows, creating colorful patterns on leather armchairs and scattered open books.'
47
+ parameters:
48
+ negative_prompt: 'blurry, cropped, ugly'
49
+ output:
50
+ url: ./assets/image_6_0.png
51
+ - text: 'In the style of m4rc0 anime background paintings, An abandoned Victorian greenhouse with broken glass panels and overgrown vines. Shafts of afternoon light pierce through the dusty air, illuminating scattered terra cotta pots and rusted gardening tools.'
52
+ parameters:
53
+ negative_prompt: 'blurry, cropped, ugly'
54
+ output:
55
+ url: ./assets/image_7_0.png
56
+ - text: 'In the style of m4rc0 anime background paintings, A rural train platform at dusk with a wooden waiting shelter. Paper lanterns cast a warm glow on the wooden planks, while steam from a distant locomotive drifts across the purple-orange sky.'
57
+ parameters:
58
+ negative_prompt: 'blurry, cropped, ugly'
59
+ output:
60
+ url: ./assets/image_8_0.png
61
+ ---
62
+
63
+ # MarcoBackground-LoRA
64
+
65
+ This is a standard PEFT LoRA derived from [black-forest-labs/FLUX.1-dev](https://huggingface.co/black-forest-labs/FLUX.1-dev).
66
+
67
+
68
+ No validation prompt was used during training.
69
+
70
+ None
71
+
72
+
73
+
74
+ ## Validation settings
75
+ - CFG: `3.0`
76
+ - CFG Rescale: `0.0`
77
+ - Steps: `20`
78
+ - Sampler: `FlowMatchEulerDiscreteScheduler`
79
+ - Seed: `42`
80
+ - Resolution: `896x1280`
81
+ - Skip-layer guidance:
82
+
83
+ Note: The validation settings are not necessarily the same as the [training settings](#training-settings).
84
+
85
+ You can find some example images in the following gallery:
86
+
87
+
88
+ <Gallery />
89
+
90
+ The text encoder **was not** trained.
91
+ You may reuse the base model text encoder for inference.
92
+
93
+
94
+ ## Training settings
95
+
96
+ - Training epochs: 0
97
+ - Training steps: 500
98
+ - Learning rate: 8e-05
99
+ - Learning rate schedule: polynomial
100
+ - Warmup steps: 100
101
+ - Max grad norm: 0.1
102
+ - Effective batch size: 3
103
+ - Micro-batch size: 3
104
+ - Gradient accumulation steps: 1
105
+ - Number of GPUs: 1
106
+ - Gradient checkpointing: True
107
+ - Prediction type: flow-matching (extra parameters=['shift=3', 'flux_guidance_mode=constant', 'flux_guidance_value=1.0', 'flow_matching_loss=compatible', 'flux_lora_target=all'])
108
+ - Optimizer: adamw_bf16
109
+ - Trainable parameter precision: Pure BF16
110
+ - Caption dropout probability: 10.0%
111
+
112
+ - SageAttention: Enabled inference
113
+ - LoRA Rank: 64
114
+ - LoRA Alpha: None
115
+ - LoRA Dropout: 0.1
116
+ - LoRA initialisation style: default
117
+
118
+
119
+ ## Datasets
120
+
121
+ ### marco-256
122
+ - Repeats: 10
123
+ - Total number of images: 34
124
+ - Total number of aspect buckets: 2
125
+ - Resolution: 0.065536 megapixels
126
+ - Cropped: False
127
+ - Crop style: None
128
+ - Crop aspect: None
129
+ - Used for regularisation data: No
130
+ ### marco-crop-256
131
+ - Repeats: 10
132
+ - Total number of images: 34
133
+ - Total number of aspect buckets: 1
134
+ - Resolution: 0.065536 megapixels
135
+ - Cropped: True
136
+ - Crop style: center
137
+ - Crop aspect: square
138
+ - Used for regularisation data: No
139
+ ### marco-512
140
+ - Repeats: 10
141
+ - Total number of images: 34
142
+ - Total number of aspect buckets: 1
143
+ - Resolution: 0.262144 megapixels
144
+ - Cropped: False
145
+ - Crop style: None
146
+ - Crop aspect: None
147
+ - Used for regularisation data: No
148
+ ### marco-crop-512
149
+ - Repeats: 10
150
+ - Total number of images: 34
151
+ - Total number of aspect buckets: 1
152
+ - Resolution: 0.262144 megapixels
153
+ - Cropped: True
154
+ - Crop style: center
155
+ - Crop aspect: square
156
+ - Used for regularisation data: No
157
+ ### marco-768
158
+ - Repeats: 10
159
+ - Total number of images: 34
160
+ - Total number of aspect buckets: 1
161
+ - Resolution: 0.589824 megapixels
162
+ - Cropped: False
163
+ - Crop style: None
164
+ - Crop aspect: None
165
+ - Used for regularisation data: No
166
+ ### marco-crop-768
167
+ - Repeats: 10
168
+ - Total number of images: 34
169
+ - Total number of aspect buckets: 1
170
+ - Resolution: 0.589824 megapixels
171
+ - Cropped: True
172
+ - Crop style: center
173
+ - Crop aspect: square
174
+ - Used for regularisation data: No
175
+ ### marco-1024
176
+ - Repeats: 10
177
+ - Total number of images: 34
178
+ - Total number of aspect buckets: 2
179
+ - Resolution: 1.048576 megapixels
180
+ - Cropped: False
181
+ - Crop style: None
182
+ - Crop aspect: None
183
+ - Used for regularisation data: No
184
+ ### marco-crop-1024
185
+ - Repeats: 10
186
+ - Total number of images: 34
187
+ - Total number of aspect buckets: 1
188
+ - Resolution: 1.048576 megapixels
189
+ - Cropped: True
190
+ - Crop style: center
191
+ - Crop aspect: square
192
+ - Used for regularisation data: No
193
+ ### marco-1440
194
+ - Repeats: 10
195
+ - Total number of images: 34
196
+ - Total number of aspect buckets: 4
197
+ - Resolution: 2.0736 megapixels
198
+ - Cropped: False
199
+ - Crop style: None
200
+ - Crop aspect: None
201
+ - Used for regularisation data: No
202
+ ### marco-crop-1440
203
+ - Repeats: 10
204
+ - Total number of images: 34
205
+ - Total number of aspect buckets: 1
206
+ - Resolution: 2.0736 megapixels
207
+ - Cropped: True
208
+ - Crop style: center
209
+ - Crop aspect: square
210
+ - Used for regularisation data: No
211
+
212
+
213
+ ## Inference
214
+
215
+
216
+ ```python
217
+ import torch
218
+ from diffusers import DiffusionPipeline
219
+
220
+ model_id = 'black-forest-labs/FLUX.1-dev'
221
+ adapter_id = 'davidrd123/MarcoBackground-LoRA'
222
+ pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) # loading directly in bf16
223
+ pipeline.load_lora_weights(adapter_id)
224
+
225
+ prompt = "An astronaut is riding a horse through the jungles of Thailand."
226
+
227
+
228
+ ## Optional: quantise the model to save on vram.
229
+ ## Note: The model was quantised during training, and so it is recommended to do the same during inference time.
230
+ from optimum.quanto import quantize, freeze, qint8
231
+ quantize(pipeline.transformer, weights=qint8)
232
+ freeze(pipeline.transformer)
233
+
234
+ 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
235
+ image = pipeline(
236
+ prompt=prompt,
237
+ num_inference_steps=20,
238
+ generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(42),
239
+ width=896,
240
+ height=1280,
241
+ guidance_scale=3.0,
242
+ ).images[0]
243
+ image.save("output.png", format="PNG")
244
+ ```
245
+
246
+
247
+