Repolode
kohya-ss

kohya-ss/sd-scripts

Training, generation and utility scripts for Stable Diffusion and other image generation models, covering LoRA and fine-tuning.

Stars
7,242
Forks
1,224
Open issues
917
Last commit
23 hours ago

What is it?

sd-scripts is a Python collection of command-line scripts for training and running image generation models. It covers LoRA training, full fine-tuning (including DreamBooth-style training), Textual Inversion for SD and SDXL, and inpainting model training. Supported model families include Stable Diffusion 1.x/2.x, SDXL, SD3/SD3.5, FLUX.1, LUMINA, HunyuanImage-2.1, Anima and MOSS-Image.

Beyond training, the repository includes image generation scripts, dataset caching tools, WD14-based image tagging, model conversion and LoRA merging utilities. Training is configured through dataset config files and runs on PyTorch with Hugging Face Accelerate. Installation instructions cover Windows and Linux/WSL2, with optional xformers and DeepSpeed support.

The project is aimed at users who want scripted, reproducible training workflows rather than a graphical interface, and it ships documentation in English and Japanese.

Key features

  • 01Trains LoRA networks, including LoHa, LoKr, OFTv2 and BOFT variants for supported models.
  • 02Supports full fine-tuning and DreamBooth-style training, plus Textual Inversion for SD and SDXL.
  • 03Provides inpainting model training for SD1.5 and SDXL.
  • 04Includes image generation scripts and utilities for model conversion, image tagging and LoRA merging.
  • 05Configures datasets and captions through config files, with support for multi-line captions.

Use cases

  • Training a custom character or style LoRA for FLUX.1 or SDXL on a local GPU.
  • Fine-tuning a Stable Diffusion checkpoint on a curated image dataset.
  • Batch-tagging training images with WD14 before training.
  • Running reproducible, script-based training experiments on Linux or WSL2 servers.

Topics

FAQ

What is sd-scripts?
Training, generation and utility scripts for Stable Diffusion and other image generation models, covering LoRA and fine-tuning. sd-scripts is a Python collection of command-line scripts for training and running image generation models. It covers LoRA training, full fine-tuning (including DreamBooth-style training), Textual Inversion for SD and SDXL, and inpainting model training. Supported model families include Stable Diffusion 1.x/2.x, SDXL, SD3/SD3.5, FLUX.1, LUMINA, HunyuanImage-2.1, Anima and MOSS-Image.
Is sd-scripts free to use? What license does it have?
sd-scripts is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is sd-scripts still maintained?
Actively maintained. The last commit to sd-scripts was on Oct 18, 2026.
What can I use sd-scripts for?
Training a custom character or style LoRA for FLUX.1 or SDXL on a local GPU. Fine-tuning a Stable Diffusion checkpoint on a curated image dataset. Batch-tagging training images with WD14 before training. Running reproducible, script-based training experiments on Linux or WSL2 servers.
Where can I get sd-scripts?
The source code and installation instructions are on GitHub: https://github.com/kohya-ss/sd-scripts

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects