kneiff commited on
Commit
a48e098
·
1 Parent(s): f7a3e51

add config for chroma base

Browse files
Files changed (2) hide show
  1. MANIFEST.knf.xlsx +2 -2
  2. configs/CHROMA_BASE.knf.yaml +302 -0
MANIFEST.knf.xlsx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:3de159d07d52f461a5be62fdcc442e0fe10e1a25845600cf3975047a3ebbfa3e
3
- size 14892239
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dbea508609557d68236652ddb95f796eff2a13f6dab2665ecf5274613ea45c83
3
+ size 14890902
configs/CHROMA_BASE.knf.yaml ADDED
@@ -0,0 +1,302 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 identity, body, face, 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 texture 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. Chroma1-Base
49
+ # starts from SimpleTuner's 512px Chroma example; validation still renders at 1024.
50
+ image_resize:
51
+ min_pixel_area: 512 # Upscale tiny images below roughly 512x512 area.
52
+ max_pixel_area: 512 # Downscale large images above roughly 512x512 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: true # Emits domain tags, e.g. meta:shaded.
62
+
63
+ # Default caption sidecar layout for every exported subset.
64
+ caption_outputs:
65
+ mode: hybrid_txt # One .txt sidecar per image containing selected formats.
66
+ formats: [chroma] # Chroma-profile single-line captions for Chroma 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: [chroma]
75
+ # genitals:
76
+ # mode: hybrid_txt
77
+ # formats: [chroma]
78
+ # fullbody:
79
+ # mode: hybrid_txt
80
+ # formats: [chroma]
81
+ # body_details:
82
+ # mode: hybrid_txt
83
+ # formats: [chroma]
84
+ # fur:
85
+ # mode: hybrid_txt
86
+ # formats: [chroma]
87
+ # head:
88
+ # mode: hybrid_txt
89
+ # formats: [chroma]
90
+ # sfw:
91
+ # mode: hybrid_txt
92
+ # formats: [chroma]
93
+
94
+ # ==============================================================
95
+ # == Publishing
96
+ # ==============================================================
97
+
98
+ publishing:
99
+ huggingface:
100
+ pretty_name: Ladybug Felkin # Human-readable dataset-card base title.
101
+ version: v5.4-chroma-base # Public dataset version label.
102
+ optimized_for_model: Chroma1-Base # Rendered as [For Chroma1-Base].
103
+ tags: [chroma, chroma1-base, 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
+ # enabled: true # Optional backend-specific switch; defaults to enabled.
116
+
117
+ # -- Generated artifact filenames written into TRAINING/<config-id>_<run>.
118
+ config_filename: simpletuner-config.json # Top-level SimpleTuner config.
119
+ data_backend_filename: simpletuner-multidatabackend.json # Multi-databackend config.
120
+
121
+ # Generated cache/output directories. Relative paths resolve below TRAINING/<config-id>_<run>.
122
+ cache_root: .simpletuner-cache # Shared model, text, and VAE cache root.
123
+ output_dir: _simpletuner-output # Normal full-run checkpoint output dir.
124
+
125
+ # Subset-specific SimpleTuner dataloader overrides. Any key here is merged
126
+ # into the subset backend entry after the dataset defaults below.
127
+ subsets:
128
+ felkin_anchor:
129
+ probability: 0.2 # Sample anchor identity images at steady exposure.
130
+ crop: false # Preserve full source composition.
131
+ # repeats: 0 # Optional per-subset repeat count.
132
+ # disabled: false # Optional per-subset on/off switch.
133
+ fullbody:
134
+ probability: 8 # Sample full-body subset at high probability.
135
+ crop: false # Preserve full-body composition.
136
+ # repeats: 0
137
+ # disabled: false
138
+ body_details:
139
+ probability: 4 # Sample body detail subset at normal probability.
140
+ crop: false # Preserve detail framing; many samples are already close crops.
141
+ # repeats: 0
142
+ # disabled: false
143
+ fur:
144
+ probability: 1 # Give focused fur crops extra exposure.
145
+ crop: false # Preserve texture crop intent; do not random-crop fur samples.
146
+ # repeats: 0
147
+ # disabled: false
148
+ head:
149
+ probability: 2 # Sample head/face details at extra exposure.
150
+ crop: false # Preserve detail framing; many samples are close crops.
151
+ genitals:
152
+ probability: 3 # Sample anatomy subset at normal probability.
153
+ crop: false # Preserve anatomy crop framing.
154
+ # repeats: 0
155
+ # disabled: false
156
+
157
+ # Dataset backend defaults copied into every image subset entry.
158
+ dataset:
159
+ type: local # SimpleTuner local filesystem backend.
160
+ dataset_type: image # Image dataset backend, not text embeds.
161
+ resolution: 512 # First Chroma1-Base profile follows SimpleTuner's 512px example.
162
+ minimum_image_size: 512 # Keep smaller detail/anatomy crops after export upscaling.
163
+ maximum_image_size: 512 # Upper bound for input image sizing.
164
+ target_downsample_size: 512 # Downsample target for cache generation.
165
+ resolution_type: pixel_area # Area-based buckets, not smaller-edge resize.
166
+ caption_strategy: textfile # Read captions from exported .txt sidecars.
167
+ metadata_backend: discovery # Discover images/captions from directories.
168
+ crop: false # Preserve source framing for the Chroma run.
169
+ crop_style: center # Inert while crop is false; avoids random-crop defaults.
170
+ crop_aspect: preserve # Preserve original aspect instead of square crop.
171
+ # repeats: 0 # Dataset-level repeat count; subset can override.
172
+ # disabled: false # Dataset-level backend switch.
173
+
174
+ # Optional shared text-embedding backend overrides. Commented keys show the
175
+ # kneifftools-owned defaults for the generated text_embeds backend.
176
+ # text_embeds:
177
+ # id: text-embeds # Backend id used by SimpleTuner.
178
+ # type: local # Store embeddings on local filesystem.
179
+ # dataset_type: text_embeds
180
+ # default: true # Marks this as the shared embedding backend.
181
+ # cache_dir: .simpletuner-cache/text # Override generated text cache dir.
182
+ # disabled: false
183
+
184
+ # Generate a SimpleTuner user_prompt_library JSON from the curated Rook
185
+ # showcase prompts plus manifest-derived controls.
186
+ validation_prompts:
187
+ enabled: true
188
+ filename: simpletuner-validation-prompts.json
189
+ from_prompt_pack:
190
+ prompts: rook-kaefer
191
+ caption_styles: [nlg]
192
+ uses: [training_validation]
193
+ from_manifest:
194
+ enabled: true
195
+ seed: 42
196
+ profile: chroma
197
+ activation_token: Rook_Kaefer
198
+ species_token: felkin
199
+ negative_control_species: wolf
200
+ exchanges:
201
+ - [erection, fully_sheathed]
202
+
203
+ # Model and LoRA settings merged into the top-level SimpleTuner config.
204
+ model:
205
+ model_type: lora # Train a LoRA adapter.
206
+ model_family: chroma # Use SimpleTuner's Chroma model family.
207
+ model_flavour: base # Chroma1-Base foundation variant.
208
+ lora_rank: 64 # LoRA rank/capacity.
209
+ lora_alpha: 64 # LoRA alpha scaling.
210
+ lora_type: standard # Standard LoRA, not an alternate adapter type.
211
+ lora_format: comfyui # Convert output naming/layout for ComfyUI.
212
+ flux_lora_target: all # Train all Flux/Chroma LoRA target modules.
213
+
214
+ # Base Chroma assets. The active transformer is loaded from the HF repo
215
+ # because no local Chroma1-Base single-file checkpoint is staged yet.
216
+ pretrained_model_name_or_path: lodestones/Chroma1-Base
217
+ pretrained_transformer_model_name_or_path: null
218
+ pretrained_transformer_subfolder: null
219
+ pretrained_vae_model_name_or_path: /mnt/wsl/comfyui-models/models/vae/ae.safetensors
220
+ pretrained_t5_model_name_or_path: /mnt/wsl/comfyui-models/models/text_encoders/t5xxl/flanT5XXLTextEncorder_fp16.safetensors
221
+
222
+ # Precision defaults for Chroma LoRA training.
223
+ base_model_precision: no_change
224
+ base_model_default_dtype: bf16
225
+ mixed_precision: bf16
226
+ # init_lora: /path/to/existing.safetensors # Optional LoRA resume/init weights.
227
+ # lycoris_config: /path/to/lycoris.json # Optional LyCORIS config path.
228
+
229
+ # == Curricular warmup
230
+ subset_warmup:
231
+ enabled: true
232
+ subsets: [genitals, fullbody, head]
233
+ steps: 1000 # !! First steps of the total run are ONLY listed subsets!
234
+
235
+ # Full-run trainer config. trainer_testrun below overrides selected keys
236
+ # only when knf lora sync/train is called with --testrun.
237
+ trainer:
238
+ tracker_project_name: kneifftools-lora-training # Experiment tracker project.
239
+ tracker_run_name: ladybird-chroma-base # Full-run tracker name.
240
+ hub_model_id: ladybird-chroma-base-lora # Optional Hub model id if push_to_hub is enabled.
241
+
242
+ optimizer: adamw_bf16 # BF16 AdamW optimizer.
243
+ learning_rate: 0.00005 # Conservative Chroma LoRA starting point.
244
+ lr_scheduler: constant_with_warmup # ramp up LR to avoid weird color biases.
245
+ lr_warmup_steps: 200
246
+ seed: 42 # Training seed.
247
+ gradient_checkpointing: true # Reduce VRAM by recomputing activations.
248
+ max_grad_norm: 1.0 # Clip gradients for stability.
249
+ grad_clip_method: norm # Clip by gradient norm.
250
+
251
+ train_batch_size: 4 # Per-device batch size.
252
+ gradient_accumulation_steps: 1 # Effective batch multiplier.
253
+ num_train_epochs: 0 # Step-based training; max_train_steps controls run length.
254
+ max_train_steps: 4000 # ANIMA-aligned Chroma character run with extended warmup.
255
+ ignore_final_epochs: true # This fixes early stop due to weird epoch calculation by simpletuner
256
+
257
+ caption_dropout_probability: 0.0 # Disable caption dropout; keep trigger behavior stable.
258
+ data_backend_sampling: auto-weighting # Auto-balance dataloader sampling based on subset probabilities and sizes.
259
+
260
+ # push_to_hub: false # Upload final artifacts to Hugging Face Hub.
261
+ # push_checkpoints_to_hub: false # Upload intermediate checkpoints.
262
+ checkpoints_total_limit: 5 # Keep latest 5 checkpoints.
263
+ checkpoint_step_interval: 400 # Save checkpoint every 200 steps.
264
+ validation_step_interval: 400 # Run validation every 200 steps.
265
+ validation_on_startup: true # Render baseline validation before training.
266
+ validation_prompt_library: false # Disable SimpleTuner built-in prompt library.
267
+ validation_disable_unconditional: true # Skip unconditional validation branch.
268
+ validation_resolution: 512x512 # Keep Base validation at native Chroma/Flux image size.
269
+ validation_num_inference_steps: 24 # Full-run validation sampling steps.
270
+ validation_guidance: 1.0 # CFG guidance used by validation.
271
+ validation_guidance_real: 2.5 # Chroma/flow guidance-real default.
272
+ validation_guidance_rescale: 0.0 # Guidance rescale; 0 disables rescale.
273
+ validation_seed: 42 # Deterministic validation seed.
274
+ num_eval_images: 1 # Images per validation prompt.
275
+ validation_negative_prompt: "signature, worst quality, low quality, score_1, score_2, score_3, artist name" # Shared validation negative prompt.
276
+
277
+ report_to: tensorboard # Write TensorBoard logs.
278
+ logging_dir: logs # TensorBoard log dir relative to TRAINING/<config-id>_<run>.
279
+
280
+ # Additional kneifftools-owned SimpleTuner defaults. Leave commented to
281
+ # use defaults from src/kneiff/training/lora/simpletuner.py.
282
+ # use_ema: false
283
+ # vae_batch_size: 1
284
+ # data_backend_sampling: uniform
285
+ # allow_dataset_oversubscription: true
286
+ aspect_bucket_alignment: 64
287
+ tokenizer_max_length: 512
288
+ t5_padding: zero
289
+ # fully_unload_text_encoder: true
290
+ # offload_during_startup: true
291
+ # keep_vae_loaded: false
292
+ # resume_from_checkpoint: /path/to/checkpoint
293
+
294
+ # Short smoke-run overrides. These merge last only with --testrun.
295
+ trainer_testrun:
296
+ validation_on_startup: false
297
+ tracker_run_name: ladybird-chroma-base-testrun # Separate tracker/log name for smoke runs.
298
+ output_dir: _simpletuner-output-testrun # Keep smoke checkpoints away from full run.
299
+ max_train_steps: 12 # Tiny run to verify plumbing.
300
+ checkpoint_step_interval: 12 # Save at the end of the smoke run.
301
+ validation_step_interval: 12 # Validate at the end of the smoke run.
302
+ validation_num_inference_steps: 12 # Faster validation for smoke runs.