Stable Diffusion 1.x and 2.x are the foundational image generation models supported by sd-scripts. Both share the same UNet + VAE + CLIP pipeline architecture but differ in resolution targets and text encoder configuration.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/kohya-ss/sd-scripts/llms.txt
Use this file to discover all available pages before exploring further.
Architecture
SD 1.x and 2.x use the classic latent diffusion architecture:- UNet — the denoising backbone that operates on compressed latent representations.
- VAE — encodes images into latent space and decodes latents back to pixel space.
- CLIP text encoder — conditions generation on text prompts.
- SD 1.x uses OpenAI CLIP ViT-L/14.
- SD 2.x uses OpenCLIP ViT-H/14 with a 1024-dimensional embedding.
Supported versions
| Version | Default resolution | Notes |
|---|---|---|
| SD 1.x | 512 × 512 | Standard CLIP ViT-L/14 text encoder |
| SD 2.x | 768 × 768 | OpenCLIP ViT-H/14; supports v-parameterization |
SD 2.x models require
--v2 and, for v-prediction checkpoints, --v_parameterization. Omitting these flags when training against a v2 checkpoint produces incorrect results.Available training methods
| Method | Script | Notes |
|---|---|---|
| LoRA | train_network.py | Recommended starting point |
| DreamBooth fine-tuning | train_db.py | Full model or UNet-only |
| Native fine-tuning | fine_tune.py | Requires pre-cached latents |
| Textual Inversion | train_textual_inversion.py | Trains new token embeddings only |
| ControlNet-LLLite | train_network.py with control module | Lightweight ControlNet variant |
LoRA training
Usetrain_network.py with --network_module=networks.lora:
SD 2.x flags
When training against an SD 2.x checkpoint you must add the following flags:Textual Inversion
Textual Inversion trains new token embeddings without modifying the model weights. Usetrain_textual_inversion.py:
Key training parameters
| Parameter | SD 1.x recommendation | SD 2.x recommendation |
|---|---|---|
| Resolution | 512 px | 768 px |
--network_dim (LoRA rank) | 16–32 | 16–32 |
--mixed_precision | fp16 | fp16 |
--v2 | not required | required |
--v_parameterization | not required | required for v-pred models |
--clip_skip | 1 or 2 for community models | not used |
