gattaplayer commited on
Commit
eaf6a31
·
verified ·
1 Parent(s): 6b5b0f1

Model card auto-generated by SimpleTuner

Browse files
Files changed (1) hide show
  1. README.md +251 -0
README.md ADDED
@@ -0,0 +1,251 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ base_model: "terminusresearch/FluxBooru-v0.3"
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: 'leirix, a woman lying on a soft pink surface, wearing an elaborate golden jewelry decor with sharp, angular details, including a crown, large earrings, and a series of golden straps wrapping around her body, her expression is confident and playful, with her hand gently touching her hair, the armor contrasts with the soft, delicate appearance of the setting, with subtle green foliage framing the edges, the overall mood is luxurious and sensual, high detail with a focus on the character''s beauty, the golden accents, and the soft atmosphere of the scene'
22
+ parameters:
23
+ negative_prompt: 'blurry, cropped, ugly'
24
+ output:
25
+ url: ./assets/image_1_0.png
26
+ - text: 'leirix, a young woman enjoying a sunny day at the beach, with long, flowing blonde hair that catches the light beautifully and bright, expressive blue eyes, wearing a sleek, one-piece athletic swimsuit with shades of blue and white, perfectly complementing her sun-kissed skin, sitting on a light blue beach towel, her posture relaxed as she leans back slightly, with the serene ocean and sandy beach stretching out behind her, sunlight casts a warm glow, creating soft shadows and highlighting the contours of her figure, scene exudes a peaceful, summery vibe, with the clear sky and calm waves in the background'
27
+ parameters:
28
+ negative_prompt: 'blurry, cropped, ugly'
29
+ output:
30
+ url: ./assets/image_2_0.png
31
+ - text: 'leirix, a young woman with short spiky black hair wearing a pink top and a yellow jacket, creating magical orbs of light with her hands, slightly smiling confidently, a vibrant and energetic atmosphere with colorful glowing lights, sparkles, and a soft-focus disco ball background, dynamic pose with fluid motion, playful expression, bright and vibrant color palette, detailed and stylized, magical effects surrounding her hands'
32
+ parameters:
33
+ negative_prompt: 'blurry, cropped, ugly'
34
+ output:
35
+ url: ./assets/image_3_0.png
36
+ - text: 'leirix, a woman with long blonde wavy hair and bright blue eyes standing by a pool in a black bikini, her body is toned and curves gracefully, she has a large tattoo of a lion and roses on her left arm and another tattoo on her thigh, her face has soft features with a slight, confident smile and a hint of flirtation, her eyes sparkle as she gazes over her shoulder, her lips slightly parted, the background features lush green plants with rich, textured foliage casting deeper shadows and adding layers of depth, while the distant buildings are blurred into a soft, monochromatic wash of color, sunlight casts a warm glow on her skin, water droplets glisten as they reflect the light, adding to the relaxed, tropical atmosphere'
37
+ parameters:
38
+ negative_prompt: 'blurry, cropped, ugly'
39
+ output:
40
+ url: ./assets/image_4_0.png
41
+ - text: 'leirix, a woman in a red outfit with a plunging neckline, her long dark hair cascading around her shoulders, sitting on a red surface surrounded by open comic books, her gaze is direct and confident with a slight smile, she is wearing gold jewelry on her arms and neck, the background is rich red, emphasizing the color contrast between her outfit and the comics, the comics show vibrant panels with the same character, the scene is intimate and seductive, high detail, focused on her expression and the iconic superhero vibe'
42
+ parameters:
43
+ negative_prompt: 'blurry, cropped, ugly'
44
+ output:
45
+ url: ./assets/image_5_0.png
46
+ - text: 'leirix, a young woman in a dynamic crouching pose with black and red spandex suit featuring a white web pattern on the torso and a bold lightning symbol on the chest, her arms are raised with webs shooting out of her hands, her posture is aggressive and ready for action, the background is a vibrant red orange, where the halftone pattern forms a three-dimensional effect, with shadows and highlights giving the illusion of depth, creating a sense of volume behind the character, the webbing extends outward like a vortex, its lines twisting and spiraling around the scene, wrapping the composition in dynamic movement, her body is athletic with defined muscles and sharp details, her suit has white highlights on the shoulders and legs'
47
+ parameters:
48
+ negative_prompt: 'blurry, cropped, ugly'
49
+ output:
50
+ url: ./assets/image_6_0.png
51
+ - text: 'leirix, a woman with long dark hair and red flower adorning her hair, wearing a red outfit, holding a rose delicately in her hand, surrounded by an ornate, intricate frame featuring a background with skulls, skeletons, bats, and red petals, the frame has a stained-glass aesthetic with vibrant colors and fine details that enhance the mystical and dark atmosphere, the character''s expression is serene yet captivating, high contrast, white page'
52
+ parameters:
53
+ negative_prompt: 'blurry, cropped, ugly'
54
+ output:
55
+ url: ./assets/image_7_0.png
56
+ - text: 'leirix, a strong woman standing in a dark cave, holding a flaming torch in one hand, wearing a golden and green outfit with a fur-lined cloak, her expression fierce and determined, her dark hair flowing slightly in the air, a figure in the background is dimly lit, adding a mysterious element, the lighting contrasts between warm orange from the torch and cool blue from the shadows, high detail with focus on the character''s confident stance and the dynamic lighting effects'
57
+ parameters:
58
+ negative_prompt: 'blurry, cropped, ugly'
59
+ output:
60
+ url: ./assets/image_8_0.png
61
+ ---
62
+
63
+ # leirix-fluxbooru-lokr-1.5e-5-bs6-ga4-v03
64
+
65
+ This is a LyCORIS adapter derived from [terminusresearch/FluxBooru-v0.3](https://huggingface.co/terminusresearch/FluxBooru-v0.3).
66
+
67
+
68
+ No validation prompt was used during training.
69
+
70
+ None
71
+
72
+
73
+
74
+ ## Validation settings
75
+ - CFG: `5.0`
76
+ - CFG Rescale: `0.0`
77
+ - Steps: `20`
78
+ - Sampler: `FlowMatchEulerDiscreteScheduler`
79
+ - Seed: `42`
80
+ - Resolution: `1024x1024`
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: 3
97
+ - Training steps: 592
98
+ - Learning rate: 1.5e-05
99
+ - Learning rate schedule: polynomial
100
+ - Warmup steps: 100
101
+ - Max grad norm: 0.01
102
+ - Effective batch size: 12
103
+ - Micro-batch size: 3
104
+ - Gradient accumulation steps: 2
105
+ - Number of GPUs: 2
106
+ - Gradient checkpointing: True
107
+ - Prediction type: flow-matching (extra parameters=['flux_schedule_auto_shift', 'shift=0.0', 'flux_guidance_mode=constant', 'flux_guidance_value=3.5', 'flow_matching_loss=compatible'])
108
+ - Optimizer: optimi-lionweight_decay=1e-3
109
+ - Trainable parameter precision: Pure BF16
110
+ - Caption dropout probability: 10.0%
111
+
112
+
113
+ ### LyCORIS Config:
114
+ ```json
115
+ {
116
+ "algo": "lokr",
117
+ "multiplier": 1.0,
118
+ "linear_dim": 10000,
119
+ "linear_alpha": 1,
120
+ "factor": 12,
121
+ "apply_preset": {
122
+ "target_module": [
123
+ "Attention",
124
+ "FeedForward"
125
+ ],
126
+ "module_algo_map": {
127
+ "Attention": {
128
+ "factor": 12
129
+ },
130
+ "FeedForward": {
131
+ "factor": 6
132
+ }
133
+ }
134
+ }
135
+ }
136
+ ```
137
+
138
+ ## Datasets
139
+
140
+ ### LEIRIX-FLUX-V03-512
141
+ - Repeats: 2
142
+ - Total number of images: ~146
143
+ - Total number of aspect buckets: 2
144
+ - Resolution: 0.262144 megapixels
145
+ - Cropped: True
146
+ - Crop style: random
147
+ - Crop aspect: closest
148
+ - Used for regularisation data: No
149
+ ### LEIRIX-FLUX-V03-768
150
+ - Repeats: 2
151
+ - Total number of images: ~148
152
+ - Total number of aspect buckets: 1
153
+ - Resolution: 0.589824 megapixels
154
+ - Cropped: True
155
+ - Crop style: random
156
+ - Crop aspect: closest
157
+ - Used for regularisation data: No
158
+ ### LEIRIX-FLUX-V03-1024
159
+ - Repeats: 2
160
+ - Total number of images: ~148
161
+ - Total number of aspect buckets: 4
162
+ - Resolution: 1.048576 megapixels
163
+ - Cropped: True
164
+ - Crop style: random
165
+ - Crop aspect: closest
166
+ - Used for regularisation data: No
167
+ ### LEIRIX-FLUX-CROP-V03-512
168
+ - Repeats: 0
169
+ - Total number of images: ~146
170
+ - Total number of aspect buckets: 1
171
+ - Resolution: 0.262144 megapixels
172
+ - Cropped: True
173
+ - Crop style: random
174
+ - Crop aspect: square
175
+ - Used for regularisation data: No
176
+ ### LEIRIX-FLUX-CROP-V03-768
177
+ - Repeats: 0
178
+ - Total number of images: ~146
179
+ - Total number of aspect buckets: 1
180
+ - Resolution: 0.589824 megapixels
181
+ - Cropped: True
182
+ - Crop style: random
183
+ - Crop aspect: square
184
+ - Used for regularisation data: No
185
+ ### LEIRIX-FLUX-CROP-V03-1024
186
+ - Repeats: 0
187
+ - Total number of images: ~146
188
+ - Total number of aspect buckets: 1
189
+ - Resolution: 1.048576 megapixels
190
+ - Cropped: True
191
+ - Crop style: random
192
+ - Crop aspect: square
193
+ - Used for regularisation data: No
194
+
195
+
196
+ ## Inference
197
+
198
+
199
+ ```python
200
+ import torch
201
+ from diffusers import DiffusionPipeline
202
+ from lycoris import create_lycoris_from_weights
203
+
204
+
205
+ def download_adapter(repo_id: str):
206
+ import os
207
+ from huggingface_hub import hf_hub_download
208
+ adapter_filename = "pytorch_lora_weights.safetensors"
209
+ cache_dir = os.environ.get('HF_PATH', os.path.expanduser('~/.cache/huggingface/hub/models'))
210
+ cleaned_adapter_path = repo_id.replace("/", "_").replace("\\", "_").replace(":", "_")
211
+ path_to_adapter = os.path.join(cache_dir, cleaned_adapter_path)
212
+ path_to_adapter_file = os.path.join(path_to_adapter, adapter_filename)
213
+ os.makedirs(path_to_adapter, exist_ok=True)
214
+ hf_hub_download(
215
+ repo_id=repo_id, filename=adapter_filename, local_dir=path_to_adapter
216
+ )
217
+
218
+ return path_to_adapter_file
219
+
220
+ model_id = 'terminusresearch/FluxBooru-v0.3'
221
+ adapter_repo_id = 'gattaplayer/leirix-fluxbooru-lokr-1.5e-5-bs6-ga4-v03'
222
+ adapter_filename = 'pytorch_lora_weights.safetensors'
223
+ adapter_file_path = download_adapter(repo_id=adapter_repo_id)
224
+ pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) # loading directly in bf16
225
+ lora_scale = 1.0
226
+ wrapper, _ = create_lycoris_from_weights(lora_scale, adapter_file_path, pipeline.transformer)
227
+ wrapper.merge_to()
228
+
229
+ prompt = "An astronaut is riding a horse through the jungles of Thailand."
230
+
231
+
232
+ ## Optional: quantise the model to save on vram.
233
+ ## Note: The model was quantised during training, and so it is recommended to do the same during inference time.
234
+ from optimum.quanto import quantize, freeze, qint8
235
+ quantize(pipeline.transformer, weights=qint8)
236
+ freeze(pipeline.transformer)
237
+
238
+ 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
239
+ image = pipeline(
240
+ prompt=prompt,
241
+ num_inference_steps=20,
242
+ generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(42),
243
+ width=1024,
244
+ height=1024,
245
+ guidance_scale=5.0,
246
+ ).images[0]
247
+ image.save("output.png", format="PNG")
248
+ ```
249
+
250
+
251
+