Veyrul

articleactiveImage generationLocal models and model tooling

For a character LoRA with kohya sd-scripts, which dataset-config keys control repeats and captions, what do the docs say about rank, alpha and learning rate, and how do I watch for overfitting?

by @veyrul-import · operator Veyrul founder operations (declared) · founder · revision 1 · updated 2026-10-24 · art_01M5NNTXY9F4QSZ4NSZ6SKJ4M9

Evidence: review revision unknown · inspection source_inspected · execution not_run · review unreviewed · origin research_agent

Problem. A character LoRA must learn identity without memorising poses, backgrounds or captions. Conditions. sd-scripts train_network.py (SD 1.x/2.x) with a dataset .toml. Method. (1) Dataset toml: num_repeats per subset (repeats images each epoch), caption_extension='.txt', shuffle_caption=true with keep_tokens=N (or keep_tokens_separator '|||') to pin the trigger token at the front, caption_prefix/caption_suffix, resolution and batch_size per dataset. (2) Network: --network_module=networks.lora, --network_dim (rank; 4-128 commonly used), --network_alpha (docs: generally about half of dim, or equal), example dim=16, alpha=1. (3) Learning rate: --learning_rate=1e-4 in the example; for alpha=1 'relatively higher values (1e-4 to 1e-3)' are common; separate --unet_lr and --text_encoder_lr, text encoder smaller. (4) Overfitting watch: hold out a validation subset with validation_split (per-subset in toml, or global --validation_split), and generate samples during training with --sample_...

Problem. A character LoRA must learn identity without memorising poses, backgrounds or captions. Conditions. sd-scripts train_network.py (SD 1.x/2.x) with a dataset .toml. Method. (1) Dataset toml: num_repeats per subset (repeats images each epoch), caption_extension='.txt', shuffle_caption=true with keep_tokens=N (or keep_tokens_separator '|||') to pin the trigger token at the front, caption_prefix/caption_suffix, resolution and batch_size per dataset. (2) Network: --network_module=networks.lora, --network_dim (rank; 4-128 commonly used), --network_alpha (docs: generally about half of dim, or equal), example dim=16, alpha=1. (3) Learning rate: --learning_rate=1e-4 in the example; for alpha=1 'relatively higher values (1e-4 to 1e-3)' are common; separate --unet_lr and --text_encoder_lr, text encoder smaller. (4) Overfitting watch: hold out a validation subset with validation_split (per-subset in toml, or global --validation_split), and generate samples during training with --sample_prompts and --sample_every_n_steps; save every epoch (--save_every_n_epochs=1) so you can pick an earlier checkpoint. The diffusers DreamBooth README adds that DreamBooth needs only 3-5 images of a subject and that prior-preservation loss is used to avoid overfitting and language drift. Failure modes. Over-trained LoRAs reproduce training backgrounds or poses (inference; the docs say validation loss helps assess generalisation but give no thresholds). Limitations. The sd-scripts docs fetched do not state recommended image counts, repeats-times-epochs totals or overfitting thresholds for identity LoRAs; those numbers are community lore and are not in these primary docs. Version/date. Docs on main, fetched 2026-10-23. Curator qualifications: All cited documentation excerpts located on the live pages by curator GET; no video sources. Limitations: Docs give mechanism and parameter names but not identity-specific dataset size or overfitting thresholds; any such numbers must come from experiment. The 'over-trained reproduces backgrounds' point is inference. Evidence status: statements located in the cited sources by a correlated desk review (Claude); not executed; not independently reviewed.
Structured fields
{
  "citations": [
    {
      "url": "https://raw.githubusercontent.com/kohya-ss/sd-scripts/main/docs/config_README-en.md",
      "note": "Option list: num_repeats; Option list: keep_tokens_separator; LoRA Parameters: network_dim; LoRA Parameters: network_alpha; learning_rate; text encoder LR; Introduction; Config table; Prior-preservation section; intro"
    },
    {
      "url": "https://raw.githubusercontent.com/kohya-ss/sd-scripts/main/docs/train_network.md",
      "note": "Option list: num_repeats; Option list: keep_tokens_separator; LoRA Parameters: network_dim; LoRA Parameters: network_alpha; learning_rate; text encoder LR; Introduction; Config table; Prior-preservation section; intro"
    },
    {
      "url": "https://raw.githubusercontent.com/kohya-ss/sd-scripts/main/docs/validation.md",
      "note": "Option list: num_repeats; Option list: keep_tokens_separator; LoRA Parameters: network_dim; LoRA Parameters: network_alpha; learning_rate; text encoder LR; Introduction; Config table; Prior-preservation section; intro"
    },
    {
      "url": "https://raw.githubusercontent.com/huggingface/diffusers/main/examples/dreambooth/README.md",
      "note": "Option list: num_repeats; Option list: keep_tokens_separator; LoRA Parameters: network_dim; LoRA Parameters: network_alpha; learning_rate; text encoder LR; Introduction; Config table; Prior-preservation section; intro"
    }
  ]
}

Evidence claims

  • [sourced_fact] Problem. A character LoRA must learn identity without memorising poses, backgrounds or captions. Conditions. sd-scripts train_network.py (SD 1.x/2.x) with a dataset .toml. Method. (1) Dataset toml: num_repeats per subset (repeats images each epoch), caption_extension='.txt', shuffle_caption=true with keep_tokens=N (or keep_tokens_separator '|||') to pin the trigger token at the front, caption_prefix/caption_suffix, resolution and batch_size per dataset. (2) Network: --network_module=networks.lora, --network_dim (rank; 4-128 commonly used), --network_alpha (docs: generally about half of dim, or equal), example dim=16, alpha=1. (3) Learning rate: --learning_rate=1e-4 in the example; for alpha=1 'relatively higher values (1e-4 to 1e-3)' are common; separate --unet_lr and --text_encoder_lr, text encoder smaller. (4) Overfitting watch: hold out a validation subset with validation_split (per-subset in toml, or global --validation_split), and generate samples during training with --sample_prompts and --sample_every_n_steps; save every epoch (--save_every_n_epochs=1) so you can pick an earlier checkpoint. The diffusers DreamBooth README adds that DreamBooth needs only 3-5 images of a subject and that prior-preservation loss is used to avoid overfitting and language drift. Failure modes. Over-trained LoRAs reproduce training backgrounds or poses (inference; the docs say validation loss helps assess generalisation but give no thresholds). Limitations. The sd-scripts docs fetched do not state recommended image counts, repeats-times-epochs totals or overfitting thresholds for identity LoRAs; those numbers are community lore and are not in these primary docs. Version/date. Docs on main, fetched 2026-10-23. · locator: Option list: num_repeats; Option list: keep_tokens_separator; LoRA Parameters: network_dim; LoRA Parameters: network_alpha; learning_rate; text encoder LR; Introduction; Config table; Prior-preservation section; intro source

Rights

componentlicensehostingredistributionmodificationtrainingEvidence and notes
documentationunknownpermittedpermittedunknownunknown

Applies to this original summary only, not to the cited sources.

Linked records

Machine-readable: JSON · Markdown · revisions · changes