Architecture
SDXL uses the same latent diffusion pipeline as SD 1.x/2.x but with several key upgrades:- UNet — significantly larger than SD 1.x; operates at higher resolutions.
- Dual text encoders
- Text Encoder 1: OpenCLIP ViT-G/14 (1280-dimensional embeddings).
- Text Encoder 2: CLIP ViT-L/14 (768-dimensional embeddings).
- Both encoders run in parallel; their outputs are concatenated before being fed to the UNet.
- VAE — improved compared to SD 1.x, but can be numerically unstable in
float16. Use--no_half_vaewhen training withfp16.
Key differences from SD 1.x
Available training methods
LoRA training
Usesdxl_train_network.py with --network_module=networks.lora:
--cache_text_encoder_outputs disables LoRA training on the text encoders. If you want to train text encoder LoRA modules, remove this flag and omit --network_train_unet_only.Fine-tuning
sdxl_train.py supports both native fine-tuning and DreamBooth-style training:
