ArtificialGuyBR

Home / Blog / Training LoRAs

SDXL LoRA Training Guide: Lessons from 10 Released Models

Expert SDXL LoRA training guide covering dataset choice, caption style, and hyperparameters from 10 photorealistic model creators.

9 sources cited Training LoRAs

SDXL LoRA Training Guide: Lessons from 10 Released Models

This SDXL LoRA training guide synthesizes lessons from ten creators who published photorealistic LoRAs on Civitai. SDXL LoRAs offer higher quality than SD1.5 but are less forgiving — dataset choice, caption style, and hyperparameters matter more.

TL;DR

SDXL LoRA Training Guide: Core Principles

SDXL was trained on 1024×1024 images with two text encoders: CLIP ViT-L/14 and OpenCLIP ViT-bigG/14. This gives better prompt alignment than SD1.5 but makes LoRAs more sensitive to data quality, caption precision, and hyperparameters.

SD1.5's smaller capacity tolerated sloppier data but produced less detail. SDXL LoRAs demand more attention but deliver superior results when trained correctly. For architectural background, see our SDXL architecture explained guide.

Choosing Your Training Dataset

Resolution Requirements

SDXL's native resolution is 1024×1024. Training images should match or exceed this.

Dataset Size and Diversity

Small datasets (<30 images) produce "leaky weights" where undesired attributes combine. Two independent creators report 30 images as their minimum for photorealistic likeness models.

One creator's documented results with 30 images:

Consensus:

Regularization Images for Likeness Training

Regularization images prevent "language drift" — losing general class knowledge. Technique from DreamBooth paper (Ruiz et al., 2022) arXiv:2208.12242.

FFHQ provides 70,000 diverse 1024×1024 faces — ideal for photorealistic likeness. Dataset includes diversity in age, ethnicity, and background.

git clone https://github.com/NVlabs/ffhq-dataset
cd ffhq-dataset
python download_ffhq.py -i

Caption FFHQ images using the same method as your primary dataset.

Generating Accurate Captions

Why Tag-Based Captioning Matters for SDXL

Tag-based captioning aligns with SDXL's internal representation because LAION-B uses comma-separated tags alongside natural language. BLIP generates free-form descriptions; WD14 taggers produce the comma-separated format.

During LoRA training, tag-based captions give explicit concept control and reduce hallucinations. Most SDXL LoRA creators prefer tag-based approaches for consistency.

ViT-g-14-laion2B-s34B-b88K via CLIP Interrogator:

One source identifies this CLIP model as aligned with SDXL's pretraining text encoder. The clip-interrogator-ext extension for Stable Diffusion WebUI provides batch captioning. On ≤24GB VRAM, unload SD checkpoint to RAM first. Use "fast" mode — manual review rarely needed.

WD14 SmilingWolf Models:

Two confirmed models on Hugging Face support ratings, characters, general tags:

ModelDownloadsNotes
wd-v1-4-convnextv2-tagger-v2239ConvNextV2
wd-convnext-tagger-v3955timm-compatible, ONNX

Tagger v3 trained on Danbooru images. One creator runs all three SmilingWolf models simultaneously and uses Kohya-ss's "Append TAGs" to avoid duplicates.

Sample Prompts During Training

Using identical prompts to captions saves time and diagnoses data issues. One source recommends:

Training Hyperparameters

Learning Rates

One source reports wide range by LoRA type:

Pose/Concept (0.0012): Higher LR for abstract concepts/styles; train <2,000 steps Likeness (2e-6): Lower LR for subjects; train >1,500 steps

Text Encoder & UNET: Set both LRs equal to chosen LR for balanced adaptation.

Optimizer and Scheduler

One source finds Constant Scheduler + AdamW8Bit most consistent. Constant maintains fixed LR; AdamW8Bit is memory-efficient, faster on consumer hardware.

Network Configuration

Network rank determines capacity. One source's recommendations:

LoRA TypeNetwork RankAlpha
Likeness256, 128, 641
Style/Concept16, 321

Alpha=1 across all configs.

Settings Quick Reference

SettingPose/ConceptLikenessSource
Learning rate0.00122e-6Civitai 3701
Network rank16 or 3264, 128, 256Civitai 3701
Network alpha11Civitai 3701
OptimizerAdamW8BitAdamW8BitCivitai 3701
SchedulerConstantConstantCivitai 3701
TE/UNET LR syncYesYesCivitai 3701
Sample resolution768×1024 max768×1024 maxCivitai 3701
Epoch sweet spotVaries5Civitai 9205
Dataset size30 min, 50+ rec.30 min, 50+ rec.Civitai 3701, 9205

SDXL to SD1.5 Porting

Downscale training data by 50%, apply SD1.5 settings. Lower quality than native SDXL but easier — useful for older hardware/faster generation. See our SDXL to SD1.5 migration guide.

Common Errors and Fixes

VRAM Management

Problem: Captioners slow/crash Fix: WebUI Settings → Actions → "Unload SD Checkpoint to RAM" before captioning (≤24GB VRAM)

Sample Prompt Mismatch

Problem: Samples don't match training images Fix: Manually verify 2–4 captions; adjust dataset

Overfitting/Overtraining

Problem: Only exact training examples generated Fix: More FFHQ regularization, fewer repeats, stop at epoch 3–4

Resolution Swapping

Problem: Training stalls at high sample resolution Fix: Cap samples at 768×1024; monitor VRAM

FAQ

What learning rate for SDXL LoRA training?

Pose/concept: 0.0012, <2,000 steps. Likeness: 2e-6, >1,500 steps. TE/UNET LR = chosen LR.

How many images for photorealistic SDXL LoRA?

Minimum 30 diverse. Best: 50+. Portraits need more diversity; style/concept work with fewer.

BLIP or WD14 tagger for SDXL captioning?

WD14 taggers produce comma-separated tags matching SDXL's training format. SmilingWolf models widely used. CLIP Interrogator with ViT-g-14-laion2B-s34B-b88K is alternative.

Best optimizer for SDXL LoRA training?

Constant Scheduler + AdamW8Bit — most commonly recommended among sources.

How to prevent overtraining?

Monitor sample quality. Likeness: stop at epoch 5 per one source. Degradation → restart with fewer repeats/lower LR. FFHQ regularization helps.

What resolution for SDXL training images?

Minimum 1024×1024. Smallest dimension = 1024px, preserve aspect ratio (portrait ~1024×1536px, landscape ~1536×1024px).

Regularization needed for style/concept LoRAs?

One source: helpful for likeness, "much less necessary for other categories."

Sources

SourceContribution
Civitai 3701jiwenji's 10-model retrospective — LR, rank, scheduler, FFHQ, porting
Civitai 9205Unshackled_AI guide — dataset, WD14 captioning, epoch 5, RTX 4090 timing
FFHQ dataset70,000 1024×1024 faces, download script -i flag
clip-interrogator-extWebUI extension for CLIP Interrogator
LoRA InspectorInspect LoRA weights and training params
Booru Dataset Tag ManagerTag editor for training datasets
wd-v1-4-convnextv2-tagger-v2WD14 tagger — ratings, characters, general tags
wd-convnext-tagger-v3WD14 tagger v3 — timm-compatible, ONNX
Kohya-ss/sd-scriptsSDXL LoRA training script repo