Skip to main content
sd-scripts gives you a command-line toolkit for training and fine-tuning image generation models. Whether you want to teach a model a new concept with LoRA, run full fine-tuning with DreamBooth, or generate images from the command line, sd-scripts provides the scripts and configuration primitives to do it. The project supports the full range of modern diffusion architectures — from the original Stable Diffusion 1.x/2.x through SDXL, SD3/SD3.5, FLUX.1, LUMINA, and HunyuanImage-2.1 — in a single unified codebase.

Key features

LoRA training

Train Low-Rank Adaptation weights for any supported model. Produces small, portable adapter files in safetensors format.

Fine-tuning and DreamBooth

Native fine-tuning and DreamBooth training for SD 1.x/2.x, SDXL, SD3/SD3.5, FLUX.1, and LUMINA.

Textual Inversion

Learn new token embeddings for SD and SDXL without modifying model weights.

Image generation

Generate images directly from the command line using any supported checkpoint.

Dataset utilities

TOML-based dataset configuration, WD14 automatic tagging, bucket-based resolution grouping, and multi-resolution dataset support.

Model utilities

Convert model formats, merge LoRA weights, resize LoRA ranks, and more.

Supported models

ModelLoRAFine-tuningDreamBoothTextual Inversion
Stable Diffusion 1.x/2.xYesYesYesYes
SDXLYesYesYesYes
SD3 / SD3.5YesYesYesNo
FLUX.1YesYesYesNo
LUMINAYesYesYesNo
HunyuanImage-2.1YesNoNoNo

Training methods

sd-scripts supports several training approaches, each suited to different goals:
  • LoRA — The most resource-efficient method. Trains a small set of rank-decomposed weight updates that are stored separately from the base model. Recommended for most use cases.
  • Fine-tuning (native training) — Updates the full model weights. Requires significantly more VRAM and storage.
  • DreamBooth — Fine-tunes the model on a small set of subject images while preserving the base model’s prior knowledge using regularization images.
  • Textual Inversion — Learns a new token embedding to represent a concept without changing any model weights. Available for SD 1.x/2.x and SDXL only.
  • ControlNet-LLLite — Lightweight ControlNet training for SD/SDXL.
  • LECO — Model editing via contrast-based optimization for SD/SDXL.
If you are new to model training, start with LoRA. It requires the least VRAM, trains quickly, and produces results that are easy to share and combine. See the Quickstart to train your first LoRA in minutes.

Build docs developers (and LLMs) love