Favicon of sd-scripts

sd-scripts

Local image model training scripts for Stable Diffusion, FLUX.1 and Anima. Run on Windows or Linux with PyTorch, under the Apache 2.0 license.

sd-scripts is a collection of Python scripts for training and generating images with models on your own hardware. It's aimed at people who want to customize image models through LoRA training or deeper fine-tuning and are comfortable working with scripts. The project is open source under the Apache 2.0 license.

Model support covers Stable Diffusion 1.x and 2.x, SDXL, SD3 and SD3.5, FLUX.1, LUMINA, HunyuanImage-2.1 and Anima. LoRA training sits alongside full fine-tuning and DreamBooth, though HunyuanImage-2.1 doesn't support the latter two methods. Stable Diffusion and SDXL also support Textual Inversion, while SD1.5 and SDXL support training inpainting models. For people comparing adaptation methods, OFTv2 and BOFT offer orthogonal fine-tuning for SD1.x, SD2.x and SDXL, with support for loading weights in PEFT format.

The collection includes image generation scripts and utilities for model conversion, image tagging with WD14 Tagger, and merging LoRA weights. ControlNet and ControlNet-LLLite training provide further ways to customize image conditioning, including LLLite inpainting. Training tools also include validation, masked loss and visualizations of timestep sampling distributions.

The scripts run on Windows, Linux and WSL2 using PyTorch. Windows ARM64 is supported, including NVIDIA RTX Spark PCs. NVIDIA GPUs use CUDA, and the project also supports Intel GPUs. Training and image generation documentation is available in English and Japanese.

Similar to sd-scripts