kneiff commited on
Commit
4735128
·
1 Parent(s): 91abfa3

- F2K config: Added F2K config

Browse files

- pony config: increase larning rate

Files changed (2) hide show
  1. configs/F2K.knf.yaml +313 -0
  2. configs/PONY.knf.yaml +1 -1
configs/F2K.knf.yaml ADDED
@@ -0,0 +1,313 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ==============================================================
2
+ # == Directories
3
+ # ==============================================================
4
+
5
+
6
+ # > Dataset sync derives SOURCE/, MANIFEST.knf.xlsx, and HF/<config-id>/ from this filename.
7
+
8
+ # -- Map exported subset names to source subfolders in MANIFEST.knf.xlsx.
9
+ mappings:
10
+ # > Anchor identity examples get sampled at a lower probability below.
11
+ felkin_anchor:
12
+ - "0-ANCHOR" # Source folder for anchor identity images.
13
+ # > Explicit anatomy close-up subsets are kept separate for sampling control.
14
+ genitals:
15
+ - "6-DICK" # Source folder for exposed anatomy close-ups.
16
+ - "6-SHEATH" # Source folder for sheathed anatomy close-ups.
17
+ # > Complete body.
18
+ fullbody:
19
+ - "0-FULLBODY" # Full-body identity examples; also included in rest subset.
20
+ - "99-VERSION-LEANER" # Alternate leaner full-body examples.
21
+ # > General body, hand, leg, tail, and leaner variant images.
22
+ body_details:
23
+ - "1-TORSO" # Torso detail examples.
24
+ - "3-HANDS" # Hand detail examples.
25
+ - "4-LEGS" # Leg/foot detail examples.
26
+ - "5-TAIL" # Tail detail examples.
27
+ # > Focused fur-texture crops derived from high-resolution Rook sources.
28
+ fur:
29
+ - "7-FUR" # Fur crops for coat, mane, spots, paws, tail, and anatomy-adjacent texture.
30
+ head:
31
+ - "2-HEAD" # Face/head detail examples.
32
+
33
+ # > Also export manifest rows marked sfw into an additional generated sfw subset.
34
+ export_sfw_subset: true # < Add generated sfw subset from rows marked sfw.
35
+
36
+ # ==============================================================
37
+ # == Images
38
+ # ==============================================================
39
+
40
+ # Export-time mirroring writes fixed extra image/caption pairs before
41
+ # SimpleTuner sees the dataset. flip_only keeps kneifftools from applying its
42
+ # own random crop, rotation, or color jitter.
43
+ augmentations:
44
+ mirrored_extra: true # Add one mirrored copy per selected source image.
45
+ mirrored_transform: flip_only # Exact horizontal mirror, no kneifftools crop/jitter.
46
+ seed: 12345 # Makes mirrored export naming deterministic.
47
+
48
+ # Export image area bounds before SimpleTuner sees the dataset. The upper bound
49
+ # preserves more source detail than Chroma while staying below roughly 1280x1280.
50
+ image_resize:
51
+ min_pixel_area: 512 # Upscale tiny images below roughly 512x512 area.
52
+ max_pixel_area: 1280 # Downscale large images above roughly 1280x1280 area.
53
+
54
+ # ==============================================================
55
+ # == Captions
56
+ # ==============================================================
57
+
58
+ # Controlled caption rendering context used by all generated sidecars.
59
+ caption:
60
+ subject_sex: male # Adds male subject wording to prose renderers.
61
+ add_domains_to_tags: false # Flux2 captions are natural prose, not domain-tag tails.
62
+
63
+ # Flux2 Klein uses a Qwen-style text stack; use Kneiff's natural-language flux2 profile.
64
+ caption_outputs:
65
+ mode: hybrid_txt # One .txt sidecar per image containing selected formats.
66
+ formats: [flux2] # Natural-language caption profile for Flux2 Klein training.
67
+ tag_scope: supplemental # Kept explicit for consistency with shipped overlays.
68
+
69
+ # Optional per-subset caption output overrides. Keep commented unless a subset
70
+ # needs different caption files or formats.
71
+ # caption_outputs_overrides:
72
+ # felkin_anchor:
73
+ # mode: hybrid_txt
74
+ # formats: [flux2]
75
+ # genitals:
76
+ # mode: hybrid_txt
77
+ # formats: [flux2]
78
+ # fullbody:
79
+ # mode: hybrid_txt
80
+ # formats: [flux2]
81
+ # body_details:
82
+ # mode: hybrid_txt
83
+ # formats: [flux2]
84
+ # fur:
85
+ # mode: hybrid_txt
86
+ # formats: [flux2]
87
+ # head:
88
+ # mode: hybrid_txt
89
+ # formats: [flux2]
90
+ # sfw:
91
+ # mode: hybrid_txt
92
+ # formats: [flux2]
93
+
94
+ # ==============================================================
95
+ # == Publishing
96
+ # ==============================================================
97
+
98
+ publishing:
99
+ huggingface:
100
+ pretty_name: Ladybug Felkin # Human-readable dataset-card base title.
101
+ version: v5.6-f2k # Public dataset version label.
102
+ optimized_for_model: FLUX.2 Klein Base 4B # Rendered as [For FLUX.2 Klein Base 4B].
103
+ tags: [flux2, flux2-klein, flux2-klein-4b, lora, diffusion-training, image-captioning]
104
+ adult_content: true # Render the adult-content notice in README.md.
105
+
106
+ # ==============================================================
107
+ # == LoRA Training
108
+ # ==============================================================
109
+
110
+ training:
111
+ enabled: true # Enables kneifftools training artifact generation.
112
+ backend: simpletuner # Selects the SimpleTuner LoRA backend.
113
+
114
+ simpletuner:
115
+
116
+ # enabled: true # Optional backend-specific switch; defaults to enabled.
117
+
118
+ # -- Generated artifact filenames written into TRAINING/<config-id>_<run>.
119
+ config_filename: simpletuner-config.json # Top-level SimpleTuner config.
120
+ data_backend_filename: simpletuner-multidatabackend.json # Multi-databackend config.
121
+
122
+ # Generated cache/output directories. Relative paths resolve below TRAINING/<config-id>_<run>.
123
+ cache_root: .simpletuner-cache # Shared model, text, and VAE cache root.
124
+ output_dir: _simpletuner-output # Normal full-run checkpoint output dir.
125
+
126
+ # Subset-specific SimpleTuner dataloader overrides. Any key here is merged
127
+ # into the subset backend entry after the dataset defaults below.
128
+ subsets:
129
+ felkin_anchor:
130
+ probability: 1 # Sample anchor identity images at steady exposure.
131
+ resolution: 1280 # High-resolution identity anchors support 1280 area.
132
+ # minimum_image_size: 1024 # Avoid using weakly upscaled anchors.
133
+ crop: false # Preserve full source composition.
134
+ # repeats: 0 # Optional per-subset repeat count.
135
+ # disabled: false # Optional per-subset on/off switch.
136
+ fullbody:
137
+ probability: 8.0 # Sample full-body subset at high probability.
138
+ resolution: 1280 # Full-body images are the strongest high-res subset.
139
+ crop: false # Preserve full-body composition.
140
+ # repeats: 0
141
+ # disabled: false
142
+ body_details:
143
+ probability: 3 # Sample body detail subset at normal probability.
144
+ crop: false # Preserve detail framing; many samples are already close crops.
145
+ # repeats: 0
146
+ # disabled: false
147
+ fur:
148
+ probability: 2.0 # Give focused fur crops extra exposure.
149
+ crop: false # Preserve texture crop intent; do not random-crop fur samples.
150
+ # repeats: 0
151
+ # disabled: false
152
+ head:
153
+ probability: 2 # Sample head/face details at extra exposure.
154
+ resolution: 1280 # Preserve detail in high-res head crops.
155
+ crop: false # Preserve detail framing; many samples are close crops.
156
+ genitals:
157
+ probability: 4 # Sample anatomy subset at normal probability.
158
+ crop: false # Preserve anatomy crop framing.
159
+ # repeats: 0
160
+ # disabled: false
161
+
162
+ # Dataset backend defaults copied into every image subset entry.
163
+ dataset:
164
+ type: local # SimpleTuner local filesystem backend.
165
+ dataset_type: image # Image dataset backend, not text embeds.
166
+ resolution: 1024 # Default target area edge for mixed-resolution subsets.
167
+ minimum_image_size: 512 # Keep smaller detail/anatomy crops after export upscaling.
168
+ maximum_image_size: 1280 # Upper bound for input image sizing.
169
+ target_downsample_size: 1280 # Downsample target for cache generation.
170
+ resolution_type: pixel_area # Area-based buckets, not smaller-edge resize.
171
+ caption_strategy: textfile # Read captions from exported .txt sidecars.
172
+ metadata_backend: discovery # Discover images/captions from directories.
173
+ crop: false # Preserve source framing for this Flux2 Klein run.
174
+ crop_style: center # Inert while crop is false; avoids random-crop defaults.
175
+ crop_aspect: preserve # Preserve original aspect instead of square crop.
176
+ # repeats: 0 # Dataset-level repeat count; subset can override.
177
+ # disabled: false # Dataset-level backend switch.
178
+
179
+ # Optional shared text-embedding backend overrides. Commented keys show the
180
+ # kneifftools-owned defaults for the generated text_embeds backend.
181
+ # text_embeds:
182
+ # id: text-embeds # Backend id used by SimpleTuner.
183
+ # type: local # Store embeddings on local filesystem.
184
+ # dataset_type: text_embeds
185
+ # default: true # Marks this as the shared embedding backend.
186
+ # cache_dir: .simpletuner-cache/text # Override generated text cache dir.
187
+ # disabled: false
188
+
189
+ # Generate a SimpleTuner user_prompt_library JSON from fixed Flux2 prompts
190
+ # plus manifest-derived controls.
191
+ validation_prompts:
192
+ enabled: true
193
+ filename: simpletuner-validation-prompts.json
194
+ positive_prefix: "masterpiece, best quality, score_7, safe, "
195
+ custom:
196
+ f2k_portrait: "Rook_Kaefer, a male felkin ladybug character, close-up portrait, detailed expressive face, black and red shell markings, soft studio lighting, clean illustration."
197
+ f2k_fullbody_reference: "Rook_Kaefer, a male felkin ladybug character, full-body character reference, standing in a neutral pose, visible head, torso, arms, legs, tail, shell markings, clean anatomy."
198
+ f2k_body_detail: "Rook_Kaefer, a male felkin ladybug character, body detail reference, torso, hands, legs, tail, clear proportions, clean anatomy, detailed illustration."
199
+ # f2k_fur_shell_detail: "Rook_Kaefer, a male felkin ladybug character, texture detail reference, soft fur, mane, paws, tail, red and black ladybug shell markings, crisp close-up detail."
200
+ # f2k_anatomy_reference: "Rook_Kaefer, a male felkin ladybug character, nude anatomy reference, sheath detail, clean lighting, neutral reference pose, detailed illustration."
201
+ from_manifest:
202
+ enabled: true
203
+ seed: 42
204
+ profile: flux2
205
+ activation_token: Rook_Kaefer
206
+ species_token: felkin
207
+ negative_control_species: wolf
208
+ exchanges:
209
+ - [erection, fully_sheathed]
210
+
211
+ # Model and LoRA settings merged into the top-level SimpleTuner config.
212
+ model:
213
+ model_type: lora # Train a LoRA adapter.
214
+ model_family: flux2 # Use SimpleTuner's FLUX.2 model family.
215
+ model_flavour: klein-4b # First practical Klein run: lower VRAM, Apache-licensed 4B base.
216
+ lora_rank: 64 # LoRA rank/capacity.
217
+ lora_alpha: 64 # LoRA alpha scaling.
218
+ lora_type: standard # Standard LoRA, not an alternate adapter type.
219
+ lora_format: comfyui # Ask SimpleTuner to save ComfyUI-style LoRA keys.
220
+ flux_lora_target: all # Train all Flux2 LoRA target modules.
221
+
222
+ # Base FLUX.2 Klein asset. Klein models use the bundled Qwen3 text
223
+ # encoder, so no separate T5/text-encoder path is set here.
224
+ pretrained_model_name_or_path: black-forest-labs/FLUX.2-klein-base-4B
225
+ pretrained_transformer_model_name_or_path: null
226
+ pretrained_transformer_subfolder: null
227
+ pretrained_unet_model_name_or_path: null
228
+ pretrained_vae_model_name_or_path: null
229
+ pretrained_t5_model_name_or_path: null
230
+ pretrained_text_encoder_model_name_or_path: null
231
+
232
+ # Precision defaults for FLUX.2 Klein LoRA training.
233
+ base_model_precision: no_change
234
+ base_model_default_dtype: bf16
235
+ mixed_precision: bf16
236
+ # init_lora: /path/to/existing.safetensors # Optional LoRA resume/init weights.
237
+ # lycoris_config: /path/to/lycoris.json # Optional LyCORIS config path.
238
+
239
+ # == Curricular warmup
240
+ subset_warmup:
241
+ enabled: true
242
+ subsets: [genitals, fullbody]
243
+ steps: 600 # !! First steps of the total run are ONLY listed subsets!
244
+
245
+ # Full-run trainer config. trainer_testrun below overrides selected keys
246
+ # only when knf lora sync/train is called with --testrun.
247
+ trainer:
248
+ tracker_project_name: kneifftools-lora-training # Experiment tracker project.
249
+ tracker_run_name: ladybird-f2k # Full-run tracker name.
250
+ hub_model_id: ladybird-f2k-lora # Optional Hub model id if push_to_hub is enabled.
251
+
252
+ optimizer: adamw_bf16 # BF16 AdamW optimizer.
253
+ learning_rate: 0.00012 # 1.2e-4; carried over from the earlier F2K run.
254
+ lr_scheduler: constant_with_warmup # Ramp up LR to avoid weird color biases.
255
+ lr_warmup_steps: 100
256
+ seed: 42 # Training seed.
257
+ gradient_checkpointing: true # Reduce VRAM by recomputing activations.
258
+ max_grad_norm: 1.0 # Clip gradients for stability.
259
+ grad_clip_method: norm # Clip by gradient norm.
260
+
261
+ train_batch_size: 2 # Per-device batch size.
262
+ gradient_accumulation_steps: 1 # Effective batch multiplier.
263
+ num_train_epochs: 0 # Step-based training; max_train_steps controls run length.
264
+ max_train_steps: 2600 # Full Flux2 Klein character run.
265
+ ignore_final_epochs: true # This fixes early stop due to weird epoch calculation by simpletuner
266
+
267
+ caption_dropout_probability: 0.0 # Disable caption dropout; keep trigger behavior stable.
268
+ data_backend_sampling: auto-weighting # Auto-balance dataloader sampling based on subset probabilities and sizes.
269
+
270
+ # push_to_hub: false # Upload final artifacts to Hugging Face Hub.
271
+ # push_checkpoints_to_hub: false # Upload intermediate checkpoints.
272
+ checkpoints_total_limit: 5 # Keep latest 5 checkpoints.
273
+ checkpoint_step_interval: 200 # Save checkpoint every 200 steps.
274
+ validation_step_interval: 200 # Run validation every 200 steps.
275
+ validation_on_startup: true # Render baseline validation before training.
276
+ validation_prompt_library: false # Disable SimpleTuner built-in prompt library.
277
+ validation_disable_unconditional: true # Skip unconditional validation branch.
278
+ validation_resolution: 1024x1024 # Keep validation affordable for the first Flux2 run.
279
+ validation_num_inference_steps: 30 # Full-run validation sampling steps.
280
+ validation_guidance: 4.0 # Inference guidance used by validation.
281
+ validation_guidance_real: null # Remove Chroma default guidance-real from generated config.
282
+ validation_guidance_rescale: 0.0 # Guidance rescale; 0 disables rescale.
283
+ validation_seed: 42 # Deterministic validation seed.
284
+ num_eval_images: 1 # Images per validation prompt.
285
+ flux_guidance_mode: constant # Keep Flux2 validation guidance stable across prompts.
286
+ flux_guidance_value: 1.0 # Flux2 Klein guidance value from packaged template.
287
+
288
+ report_to: tensorboard # Write TensorBoard logs.
289
+ logging_dir: logs # TensorBoard log dir relative to TRAINING/<config-id>_<run>.
290
+
291
+ # Additional kneifftools-owned SimpleTuner defaults. Leave commented to
292
+ # use defaults from src/kneiff/training/lora/simpletuner.py.
293
+ # use_ema: false
294
+ # vae_batch_size: 1
295
+ # data_backend_sampling: uniform
296
+ # allow_dataset_oversubscription: true
297
+ # aspect_bucket_alignment: 64
298
+ tokenizer_max_length: 512
299
+ # t5_padding: zero
300
+ # fully_unload_text_encoder: true
301
+ # offload_during_startup: true
302
+ # keep_vae_loaded: false
303
+ # resume_from_checkpoint: /path/to/checkpoint
304
+
305
+ # Short smoke-run overrides. These merge last only with --testrun.
306
+ trainer_testrun:
307
+ validation_on_startup: false
308
+ tracker_run_name: ladybird-f2k-testrun # Separate tracker/log name for smoke runs.
309
+ output_dir: _simpletuner-output-testrun # Keep smoke checkpoints away from full run.
310
+ max_train_steps: 12 # Tiny run to verify plumbing.
311
+ checkpoint_step_interval: 12 # Save at the end of the smoke run.
312
+ validation_step_interval: 12 # Validate at the end of the smoke run.
313
+ validation_num_inference_steps: 12 # Faster validation for smoke runs.
configs/PONY.knf.yaml CHANGED
@@ -252,7 +252,7 @@ training:
252
  # hub_model_id: ladybird-pony-lora # Optional Hub model id if push_to_hub is enabled.
253
 
254
  optimizer: adamw_bf16 # BF16 AdamW optimizer.
255
- learning_rate: 0.00025 # SDXL LoRA learning rates fall between 1e-4 and 5e-4
256
  lr_scheduler: constant_with_warmup # Ramp up LR to avoid weird color biases.
257
  lr_warmup_steps: 100
258
  seed: 42 # Training seed.
 
252
  # hub_model_id: ladybird-pony-lora # Optional Hub model id if push_to_hub is enabled.
253
 
254
  optimizer: adamw_bf16 # BF16 AdamW optimizer.
255
+ learning_rate: 0.0005 # SDXL LoRA learning rates fall between 1e-4 and 5e-4
256
  lr_scheduler: constant_with_warmup # Ramp up LR to avoid weird color biases.
257
  lr_warmup_steps: 100
258
  seed: 42 # Training seed.