kneiff commited on
Commit
6d2b577
·
1 Parent(s): 1371451

update PONY training config

Browse files
Files changed (1) hide show
  1. configs/PONY.knf.yaml +214 -111
configs/PONY.knf.yaml CHANGED
@@ -1,4 +1,8 @@
1
- # Pony Diffusion V6 XL config for the standard Rook LoRA subset layout.
 
 
 
 
2
  # > Dataset sync derives SOURCE/, MANIFEST.knf.xlsx, and HF/<config-id>/ from this filename.
3
 
4
  # -- Map exported subset names to source subfolders in MANIFEST.knf.xlsx.
@@ -27,49 +31,108 @@ mappings:
27
  - "2-HEAD" # Face/head detail examples.
28
 
29
  # > Also export manifest rows marked sfw into an additional generated sfw subset.
30
- export_sfw_subset: false # < Add generated sfw subset from rows marked sfw.
31
 
 
 
 
32
 
33
- caption_outputs:
34
- mode: hybrid_txt
35
- formats: [tag]
36
- tag_scope: all
 
 
 
37
 
 
 
 
 
 
 
 
 
 
 
38
  caption:
39
- subject_sex: male
40
- add_domains_to_tags: false
41
 
42
- augmentations:
43
- mirrored_extra: true
44
- mirrored_transform: flip_only
45
- seed: 12345
 
 
46
 
47
- image_resize:
48
- min_pixel_area: 512
49
- max_pixel_area: 1088
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
 
51
  publishing:
52
  huggingface:
53
- enabled: true
54
- repo_id: null
55
- pretty_name: Rook Pony SDXL LoRA
56
- version: null
57
- optimized_for_model: Pony Diffusion V6 XL
58
- license: null
59
- tags: [sdxl, pony, lora]
60
- provenance: null
61
- adult_content: false
62
- notes: null
 
 
 
 
63
 
64
  training:
65
- enabled: true
66
- backend: simpletuner
 
67
  simpletuner:
68
- enabled: true
69
- config_filename: simpletuner-config.json
70
- data_backend_filename: simpletuner-multidatabackend.json
71
- cache_root: .simpletuner-cache
72
- output_dir: _simpletuner-output
 
 
 
 
73
 
74
  # Subset-specific SimpleTuner dataloader overrides. Any key here is merged
75
  # into the subset backend entry after the dataset defaults below.
@@ -80,7 +143,7 @@ training:
80
  # repeats: 0 # Optional per-subset repeat count.
81
  # disabled: false # Optional per-subset on/off switch.
82
  fullbody:
83
- probability: 8 # Sample full-body subset at high probability.
84
  crop: false # Preserve full-body composition.
85
  # repeats: 0
86
  # disabled: false
@@ -95,7 +158,7 @@ training:
95
  # repeats: 0
96
  # disabled: false
97
  head:
98
- probability: 2 # Sample head/face details at extra exposure.
99
  crop: false # Preserve detail framing; many samples are close crops.
100
  genitals:
101
  probability: 3 # Sample anatomy subset at normal probability.
@@ -103,57 +166,129 @@ training:
103
  # repeats: 0
104
  # disabled: false
105
 
106
- subset_warmup:
107
- enabled: false
108
- subsets: [genitals, fullbody]
109
- steps: 200
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  model:
112
- model_type: lora
113
- model_family: sdxl
114
- model_flavour: null
115
- lora_type: standard
116
- lora_format: diffusers
117
- lora_rank: 64
118
- lora_alpha: 64
119
- flux_lora_target: null
 
 
120
  pretrained_model_name_or_path: /mnt/wsl/comfyui-models/models/checkpoints/_base_finetunes/ponyDiffusionV6XL_v6StartWithThisOne.safetensors
121
  pretrained_unet_model_name_or_path: null
122
  pretrained_vae_model_name_or_path: null
 
 
123
  pretrained_text_encoder_model_name_or_path: null
124
- init_lora: null
125
- lycoris_config: null
126
 
127
- trainer:
128
- mixed_precision: bf16
129
  base_model_precision: no_change
130
  base_model_default_dtype: bf16
131
- optimizer: adamw_bf16
132
- learning_rate: 0.0001
133
- lr_scheduler: constant_with_warmup # ramp up LR to avoid weird color biases.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  lr_warmup_steps: 100
135
- gradient_checkpointing: true
136
- train_batch_size: 1
137
- gradient_accumulation_steps: 1
138
- num_train_epochs: 0
139
- max_train_steps: 4
140
- checkpoint_step_interval: 4
141
- validation_step_interval: 100
142
- validation_prompt_library: false
143
- validation_disable_unconditional: true
144
- validation_resolution: 1024x1024
145
- validation_num_inference_steps: 30
146
- validation_guidance_real: 7.5
147
- num_eval_images: 1
148
- seed: 42
149
- report_to: none
150
- push_to_hub: false
151
- push_checkpoints_to_hub: false
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  use_ema: false
153
  vae_batch_size: 1
154
- data_backend_sampling: uniform
155
- allow_dataset_oversubscription: true
156
- caption_dropout_probability: 0.1
157
  aspect_bucket_alignment: 64
158
  tokenizer_max_length: 77
159
  t5_padding: null
@@ -162,42 +297,10 @@ training:
162
  keep_vae_loaded: false
163
  resume_from_checkpoint: null
164
 
 
165
  trainer_testrun:
166
- output_dir: _simpletuner-output-testrun
167
- max_train_steps: 4
168
- checkpoint_step_interval: 100
169
- validation_step_interval: 4
170
- ignore_final_epochs: true
171
-
172
- dataset:
173
- type: local
174
- dataset_type: image
175
- crop: true
176
- crop_style: random
177
- crop_aspect: preserve
178
- resolution: 1024
179
- minimum_image_size: 1024
180
- maximum_image_size: 1024
181
- target_downsample_size: 1024
182
- resolution_type: pixel_area
183
- caption_strategy: textfile
184
- metadata_backend: discovery
185
- repeats: 0
186
- disabled: false
187
-
188
-
189
-
190
- text_embeds:
191
- id: text-embeds
192
- type: local
193
- dataset_type: text_embeds
194
- default: true
195
- disabled: false
196
-
197
- validation_prompts:
198
- enabled: true
199
- filename: simpletuner-validation-prompts.json
200
- positive_prefix: "score_9, score_8_up, score_7_up, source_furry, rating_safe, "
201
- custom:
202
- custom_portrait: "Rook_Kaefer, felkin, close-up portrait, detailed lighting"
203
- custom_fullbody: "Rook_Kaefer, felkin, full-body character reference, standing, solo"
 
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.
 
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: false # < Keep PONY focused on the explicit mapped subsets.
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.
49
+ image_resize:
50
+ min_pixel_area: 512 # Upscale tiny images below roughly 512x512 area.
51
+ max_pixel_area: 1024 # Downscale large images above roughly 1024x1024 area.
52
+
53
+ # ==============================================================
54
+ # == Captions
55
+ # ==============================================================
56
+
57
+ # Controlled caption rendering context used by all generated sidecars.
58
  caption:
59
+ subject_sex: male # Adds male subject wording to prose renderers.
60
+ add_domains_to_tags: false # Pony tag captions should stay plain, not domain-prefixed.
61
 
62
+ # Pony uses classic SDXL-style tag captions. Use one .txt sidecar per image so
63
+ # SimpleTuner's textfile strategy reads the intended caption directly.
64
+ caption_outputs:
65
+ mode: hybrid_txt # One .txt sidecar per image containing selected formats.
66
+ formats: [tag] # Tag-only captions for Pony/SDXL training.
67
+ tag_scope: all # Keep the full tag tail, including identity and anatomy tags.
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: [tag]
75
+ # tag_scope: all
76
+ # genitals:
77
+ # mode: hybrid_txt
78
+ # formats: [tag]
79
+ # tag_scope: all
80
+ # fullbody:
81
+ # mode: hybrid_txt
82
+ # formats: [tag]
83
+ # tag_scope: all
84
+ # body_details:
85
+ # mode: hybrid_txt
86
+ # formats: [tag]
87
+ # tag_scope: all
88
+ # fur:
89
+ # mode: hybrid_txt
90
+ # formats: [tag]
91
+ # tag_scope: all
92
+ # head:
93
+ # mode: hybrid_txt
94
+ # formats: [tag]
95
+ # tag_scope: all
96
+ # sfw:
97
+ # mode: hybrid_txt
98
+ # formats: [tag]
99
+ # tag_scope: all
100
+
101
+ # ==============================================================
102
+ # == Publishing
103
+ # ==============================================================
104
 
105
  publishing:
106
  huggingface:
107
+ enabled: true # Generate dataset-card metadata during dataset sync.
108
+ repo_id: null # Optional Hugging Face dataset repo id.
109
+ pretty_name: Rook Pony SDXL LoRA # Human-readable dataset-card base title.
110
+ version: null # Public dataset version label.
111
+ optimized_for_model: Pony Diffusion V6 XL # Rendered as [For Pony Diffusion V6 XL].
112
+ license: null # Optional dataset license.
113
+ tags: [sdxl, pony, lora] # Dataset-card tags.
114
+ provenance: null # Optional dataset provenance note.
115
+ adult_content: false # Render the adult-content notice in README.md.
116
+ notes: null # Optional free-form dataset-card notes.
117
+
118
+ # ==============================================================
119
+ # == LoRA Training
120
+ # ==============================================================
121
 
122
  training:
123
+ enabled: true # Enables kneifftools training artifact generation.
124
+ backend: simpletuner # Selects the SimpleTuner LoRA backend.
125
+
126
  simpletuner:
127
+ enabled: true # Optional backend-specific switch; defaults to enabled.
128
+
129
+ # -- Generated artifact filenames written into TRAINING/<config-id>_<run>.
130
+ config_filename: simpletuner-config.json # Top-level SimpleTuner config.
131
+ data_backend_filename: simpletuner-multidatabackend.json # Multi-databackend config.
132
+
133
+ # Generated cache/output directories. Relative paths resolve below TRAINING/<config-id>_<run>.
134
+ cache_root: .simpletuner-cache # Shared model, text, and VAE cache root.
135
+ output_dir: _simpletuner-output # Normal full-run checkpoint output dir.
136
 
137
  # Subset-specific SimpleTuner dataloader overrides. Any key here is merged
138
  # into the subset backend entry after the dataset defaults below.
 
143
  # repeats: 0 # Optional per-subset repeat count.
144
  # disabled: false # Optional per-subset on/off switch.
145
  fullbody:
146
+ probability: 8 # Sample full-body subset at high probability.
147
  crop: false # Preserve full-body composition.
148
  # repeats: 0
149
  # disabled: false
 
158
  # repeats: 0
159
  # disabled: false
160
  head:
161
+ probability: 2 # Sample head/face details at extra exposure.
162
  crop: false # Preserve detail framing; many samples are close crops.
163
  genitals:
164
  probability: 3 # Sample anatomy subset at normal probability.
 
166
  # repeats: 0
167
  # disabled: false
168
 
169
+ # Dataset backend defaults copied into every image subset entry.
170
+ dataset:
171
+ type: local # SimpleTuner local filesystem backend.
172
+ dataset_type: image # Image dataset backend, not text embeds.
173
+ resolution: 1024 # Target area edge; pixel_area means 1024^2 area.
174
+ minimum_image_size: 512 # SimpleTuner lower bound for SDXL/Pony image handling.
175
+ maximum_image_size: 1024 # Upper bound for input image sizing.
176
+ target_downsample_size: 1024 # Downsample target for cache generation.
177
+ resolution_type: pixel_area # Area-based buckets, not smaller-edge resize.
178
+ caption_strategy: textfile # Read captions from exported .txt sidecars.
179
+ metadata_backend: discovery # Discover images/captions from directories.
180
+ crop: false # Default only; every configured subset disables crop above.
181
+ crop_style: random # Inert for crop:false subsets.
182
+ crop_aspect: preserve # Preserve original aspect instead of square crop.
183
+ repeats: 0 # Dataset-level repeat count; subset can override.
184
+ disabled: false # Dataset-level backend switch.
185
+
186
+ # Optional shared text-embedding backend overrides. Commented keys show the
187
+ # kneifftools-owned defaults for the generated text_embeds backend.
188
+ text_embeds:
189
+ id: text-embeds # Backend id used by SimpleTuner.
190
+ type: local # Store embeddings on local filesystem.
191
+ dataset_type: text_embeds
192
+ default: true # Marks this as the shared embedding backend.
193
+ # cache_dir: .simpletuner-cache/text # Override generated text cache dir.
194
+ disabled: false
195
 
196
+ # Generate a SimpleTuner user_prompt_library JSON from fixed Pony prompts.
197
+ # Manifest-derived prompts are intentionally omitted for Pony because
198
+ # kneifftools currently supports generated validation profiles for chroma
199
+ # and flux2 only.
200
+ validation_prompts:
201
+ enabled: true
202
+ filename: simpletuner-validation-prompts.json
203
+ positive_prefix: "score_9, score_8_up, score_7_up, source_furry, rating_safe, "
204
+ custom:
205
+ pony_portrait: "Rook_Kaefer, felkin, close-up portrait, detailed lighting"
206
+ pony_fullbody_reference: "Rook_Kaefer, felkin, full-body character reference, standing, solo"
207
+ # pony_body_detail: "Rook_Kaefer, felkin, body detail reference, torso, hands, legs, tail, clean anatomy"
208
+ # pony_fur_detail: "Rook_Kaefer, felkin, fur texture reference, ladybug markings, mane, tail, paws"
209
+ # pony_anatomy_reference: "Rook_Kaefer, felkin, rating_explicit, nude anatomy reference, sheath detail, clean lighting"
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: sdxl # Use SimpleTuner's SDXL model family.
215
+ model_flavour: null # Pony V6 is loaded from a single SDXL checkpoint.
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: diffusers # SDXL LoRA format expected by SimpleTuner for this run.
220
+ flux_lora_target: null # Remove the Flux/Chroma default from generated config.
221
+
222
+ # Base SDXL/Pony checkpoint from the WSL ComfyUI model store.
223
  pretrained_model_name_or_path: /mnt/wsl/comfyui-models/models/checkpoints/_base_finetunes/ponyDiffusionV6XL_v6StartWithThisOne.safetensors
224
  pretrained_unet_model_name_or_path: null
225
  pretrained_vae_model_name_or_path: null
226
+ pretrained_transformer_model_name_or_path: null
227
+ pretrained_t5_model_name_or_path: null
228
  pretrained_text_encoder_model_name_or_path: null
 
 
229
 
230
+ # Precision defaults for Pony/SDXL LoRA training.
 
231
  base_model_precision: no_change
232
  base_model_default_dtype: bf16
233
+ mixed_precision: bf16
234
+ # init_lora: /path/to/existing.safetensors # Optional LoRA resume/init weights.
235
+ # lycoris_config: /path/to/lycoris.json # Optional LyCORIS config path.
236
+
237
+ # == Curricular warmup
238
+ subset_warmup:
239
+ enabled: false
240
+ subsets: [genitals, fullbody]
241
+ steps: 200 # !! First steps of the total run are ONLY listed subsets when enabled!
242
+
243
+ # Full-run trainer config. trainer_testrun below overrides selected keys
244
+ # only when knf train prepare/start is called with --testrun.
245
+ trainer:
246
+ # tracker_project_name: kneifftools-lora-training # Experiment tracker project.
247
+ # tracker_run_name: ladybird-pony # Full-run tracker name.
248
+ # hub_model_id: ladybird-pony-lora # Optional Hub model id if push_to_hub is enabled.
249
+
250
+ optimizer: adamw_bf16 # BF16 AdamW optimizer.
251
+ learning_rate: 0.0001 # Common SDXL LoRA starting point.
252
+ lr_scheduler: constant_with_warmup # Ramp up LR to avoid weird color biases.
253
  lr_warmup_steps: 100
254
+ seed: 42 # Training seed.
255
+ gradient_checkpointing: true # Reduce VRAM by recomputing activations.
256
+ # max_grad_norm: 1.0 # Optional gradient clipping.
257
+ # grad_clip_method: norm # Optional gradient clipping method.
258
+
259
+ train_batch_size: 1 # Per-device batch size.
260
+ gradient_accumulation_steps: 1 # Effective batch multiplier.
261
+ num_train_epochs: 0 # Step-based training; max_train_steps controls run length.
262
+ max_train_steps: 4 # Current short Pony run length.
263
+
264
+ caption_dropout_probability: 0.1 # Caption dropout for regularization.
265
+ data_backend_sampling: uniform # Uniform dataloader sampling.
266
+ allow_dataset_oversubscription: true
267
+
268
+ push_to_hub: false # Upload final artifacts to Hugging Face Hub.
269
+ push_checkpoints_to_hub: false # Upload intermediate checkpoints.
270
+ # checkpoints_total_limit: 5 # Keep latest 5 checkpoints.
271
+ checkpoint_step_interval: 4 # Save checkpoint every 4 steps.
272
+ validation_step_interval: 100 # Run validation every 100 steps.
273
+ # validation_on_startup: true # Render baseline validation before training.
274
+ validation_prompt_library: false # Disable SimpleTuner built-in prompt library.
275
+ validation_disable_unconditional: true # Skip unconditional validation branch.
276
+ validation_resolution: 1024x1024 # Validation image size.
277
+ validation_num_inference_steps: 30 # Full-run validation sampling steps.
278
+ validation_guidance_real: 7.5 # SDXL/Pony validation guidance.
279
+ # validation_guidance: 5.0 # Alternative CFG field for some SimpleTuner versions.
280
+ # validation_guidance_rescale: 0.0 # Guidance rescale; 0 disables rescale.
281
+ # validation_seed: 42 # Deterministic validation seed.
282
+ num_eval_images: 1 # Images per validation prompt.
283
+ # validation_negative_prompt: "score_4, score_3, score_2, signature, ugly, cropped, blurry, low-quality"
284
+
285
+ report_to: none # Set to tensorboard to write TensorBoard logs.
286
+ # logging_dir: logs # TensorBoard log dir relative to TRAINING/<config-id>_<run>.
287
+
288
+ # Additional kneifftools-owned SimpleTuner defaults. Leave commented to
289
+ # use defaults from src/kneiff/training/lora/simpletuner.py.
290
  use_ema: false
291
  vae_batch_size: 1
 
 
 
292
  aspect_bucket_alignment: 64
293
  tokenizer_max_length: 77
294
  t5_padding: null
 
297
  keep_vae_loaded: false
298
  resume_from_checkpoint: null
299
 
300
+ # Short smoke-run overrides. These merge last only with --testrun.
301
  trainer_testrun:
302
+ output_dir: _simpletuner-output-testrun # Keep smoke checkpoints away from full run.
303
+ max_train_steps: 4 # Tiny run to verify plumbing.
304
+ checkpoint_step_interval: 100 # Avoid extra smoke checkpoints.
305
+ validation_step_interval: 4 # Validate at the end of the smoke run.
306
+ ignore_final_epochs: true # Fix early stop due to SimpleTuner epoch calculation.