Train LoRAs on Limited Hardware
Free Colab paths, AMD ROCm setups, and VRAM guidance for LoRA training.
On this page
- TL;DR
- What does "limited hardware" mean for LoRA training?
- Can I train a LoRA for free on Google Colab?
- Did anyone validate training LoRAs on AMD GPUs?
- What VRAM tiers exist and what can each train?
- What settings should I pick for my hardware tier?
- How many steps should I train for?
- Common errors and fixes
- Frequently asked questions
- Sources
Training a LoRA on limited hardware means choosing between three paths: cloud for raw power with time caps, AMD for permanence with setup cost, or local with control bounded strictly by VRAM. This guide maps what each tier realistically supports.
TL;DR
- Free Colab: Use cloud GPUs for a few hours. Use the LoRA dataset guide to prepare data, then train at zero cost.
- AMD ROCm: Train locally on RX 6800 XT and above. Uninstall bitsandbytes and xformers first — the scripts won't launch otherwise.
- Local VRAM tiers: 6 GB for SD1.5 at 512×512. 12 GB unlocks SDXL. 24 GB gives full freedom. Enable
--gradient_checkpointingand mixed precision.
What does "limited hardware" mean for LoRA training?
Hardware is limited when VRAM — not compute time — is the binding constraint. The kohya-ss documentation notes that SDXL LoRA training "requires a lot of VRAM" and that "even with 24GB VRAM, you might run out of memory depending on settings" (source). What feels "limited" depends on the base model: SD1.5 trains at 512×512, while SDXL defaults to 1024×1024. For detailed step-by-step instructions, see the kohya-ss training workflow.
Can I train a LoRA for free on Google Colab?
Google Colab gives free access to cloud GPUs (~20 hours/week, community-reported). Use two notebooks: the dataset guide to scrape images and curate tags, then the XL Trainer notebook for kohya-ss training. A community user reported ~10 hours total end-to-end for an SDXL LoRA, with most time spent in dataset prep (source). Colab Pro A100 runs individual training in under 30 minutes. Save every epoch on the free tier — disconnects happen under idle pressure. Use --lowram when RAM is below VRAM.
Did anyone validate training LoRAs on AMD GPUs?
One AMD setup uses Derrian's LoRA Easy Training Scripts on Ubuntu 24.02 with ROCm 6.2 and Python 3.10.14. The author reports a high-quality LoRA in ~40 minutes on an RX 6900XT (70 images, 8 epochs, CAME optimizer) (source). This is competitive with mid-range cloud GPUs, though setup took significantly longer.
Critical: uninstall bitsandbytes and xformers before training. If either is present, the scripts won't launch (source). The CAME optimizer lives in custom_scheduler/LoraEasyCustomOptimizer/came.py (source). Install Python 3.10.14 via pyenv (Ubuntu 24.02 ships 3.12). Use PyTorch with ROCm index: pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.1 (source).
What VRAM tiers exist and what can each train?
The kohya-ss docs don't publish a VRAM-vs-batch-size table, but confirmed parameters from community reports give this:
| VRAM | Model | Resolution | Batch size | Required flags | Source |
|---|---|---|---|---|---|
| 6 GB | SD1.5 | 512×512 | 1–2 | --gradient_checkpointing, --sdpa | kohya-ss |
| 8–12 GB | SD1.5 / SDXL | 512–768 | 2–4 | --cache_latents, --mixed_precision bf16 | kohya-ss |
| 16–24 GB | SDXL | 768–1024 | 4–8 | --cache_text_encoder_outputs, --mixed_precision bf16 | kohya-ss |
Each memory-saving flag has a cost: --gradient_checkpointing reduces VRAM at the expense of slower training. --cache_latents disables image augmentations. --cache_text_encoder_outputs eliminates text encoder computation and requires --network_train_unet_only to keep training valid. Every setting is a resource trade-off, not a free optimization.
What settings should I pick for my hardware tier?
Core training parameters follow the same logic across paths. The table consolidates recommended values:
| Parameter | SD1.5 | SDXL | Why it matters | Source |
|---|---|---|---|---|
| Resolution | 512 | 1024 | Higher resolution increases VRAM linearly; use native resolution unless you have headroom | kohya-ss |
| network_dim | 8–32 | 16–64 | Higher dim adds expressiveness but also file size | community |
| network_alpha | dim/2 | dim/2 | Controls learning-rate scaling. kohya-ss docs recommend half of dim as default | kohya-ss |
| unet_lr | 1e-4 to 5e-4 | 1e-4 to 5e-4 | Higher values train faster but risk artifacts | community |
| text_encoder_lr | 2e-5 to 1e-4 | 1e-5 to 2e-5 | Should be half to one-fifth of the unet learning rate | community |
| lr_scheduler | constant / cosine | constant / cosine | constant is simplest; cosine_with_restarts adds periodic resets some trainers prefer | kohya-ss |
| batch_size | 1–2 | 4–8 | Limited by VRAM. Increase gradient_accumulation_steps for larger effective batch size | kohya-ss |
| epochs | 8–10 | 6–8 | Fewer repeats and more epochs give finer control. Save every epoch to compare checkpoints | community |
When VRAM is tight, AdamW8bit is the most common optimizer. Prodigy auto-adjusts the learning rate (set around 1.0) but cannot be combined with LoRA+. Adafactor is described as "even more memory-efficient" but requires more careful configuration.
How many steps should I train for?
Community-tested workflows converge on 250–1000 total steps. The formula:
(images × repeats × epochs) ÷ batch_size = total steps
Examples for SDXL: 10 images × 10 repeats × 10 epochs ÷ 2 batch = 500 steps. 100 images × 1 repeat × 10 epochs ÷ 4 batch = 250 steps. SD1.5 usually needs roughly double the repeats to reach comparable step counts (source).
Fewer steps under-train; the LoRA produces no visible effect. Too many steps risk distortion. Styles may need more epochs at lower learning rates than characters. Save every epoch, then pick the best checkpoint by eye.
Common errors and fixes
| Symptom | Cause | Fix |
|---|---|---|
| Training never starts on AMD | bitsandbytes or xformers in venv | pip uninstall xformers bitsandbytes before training |
| Generated images distorted | Learning rate too high or too many repeats | Lower unet_lr to 1e-4, reduce repeats, compare earlier checkpoints |
| LoRA has no visible effect | Under-trained — LR too low or insufficient steps | Increase unet_lr toward 5e-4, or add more epochs |
| NaN loss | Mixed precision issue or LR spike | With fp16, add --no_half_vae for SDXL. With Prodigy, add safeguard_warmup=True |
| Works with one exact prompt only | Overfit from small dataset or poor tagging | Expand dataset with varied poses/angles/backgrounds; reduce verbose tag pruning |
| Colab session disconnects | Idle timeout or resource reclaim | Save every epoch. Use --lowram if RAM < VRAM |
For systematic diagnosis beyond this table, see the LoRA training debugging workflow and optimizer comparison guide.
Frequently asked questions
How much VRAM do I need to train a LoRA locally? 6 GB is the minimum for SD1.5 at 512×512 with batch size 1 and gradient checkpointing. For SDXL at 1024×1024, budget 12–24 GB depending on batch size and whether you cache latents and text encoder outputs (source).
Can I train LoRAs on an AMD GPU without cloud compute? Yes. Derrian's scripts on ROCm 6.2 with Ubuntu 24.02 validate on RX 6800 XT and above. One user reports ~40 minutes per LoRA on an RX 6900XT (70 images, 8 epochs). Setup requires Python 3.10.14 and uninstalling bitsandbytes/xformers (source).
How many images do I need for a character LoRA? 5 images produce a usable but limited result. 20–50 images with varied poses, angles, and clothing generalize significantly better. Include at least two examples of each pose, angle, and background you want the model to reproduce (source).
What is the difference between undertrained, overtrained, and overfit LoRAs? Undertrained LoRAs ignore the learned concept — typically from a learning rate that is too low or too few steps. Overtrained LoRAs generate distorted artifacts — from a learning rate that is too high. Overfit LoRAs work with only very specific prompts and refuse to generalize — usually from a dataset that is too small or poorly tagged (source).
Should I use LoRA or LoCon for my first run? LoRA works for most cases. LoCon adds more learning layers and may benefit artstyle training specifically. For characters and general-purpose use, start with LoRA (source).
Does network_dim need to be large for good results? No. Higher dim increases capacity but also file size without guaranteed quality improvement. Dim 16 with alpha 8 produces an ~18 MB file and is a widely used baseline (source, kohya-ss).
Why is SDXL training so much more demanding on VRAM? SDXL's larger U-Net architecture and dual text encoders consume substantially more memory than SD1.5. The kohya-ss docs recommend gradient checkpointing, latent caching, and mixed precision specifically to manage this (source).
Sources
| What it covers | URL |
|---|---|
| Full LoRA training guide (dataset, settings, testing) | https://civitai.com/articles/4 |
| AMD ROCm 6.2 setup for Derrian's training scripts | https://civitai.com/articles/4332 |
| Colab workflow settings for SDXL LoRA | https://civitai.com/articles/6182 |
| kohya-ss LoRA training script documentation | https://github.com/kohya-ss/sd-scripts/blob/main/docs/train_network.md |
| SDXL-specific training documentation | https://github.com/kohya-ss/sd-scripts/blob/main/docs/sdxl_train_network.md |
| Advanced training options (caching, optimizers, VRAM) | https://github.com/kohya-ss/sd-scripts/blob/main/docs/train_network_advanced.md |
| PyTorch official installation (ROCm platform support) | https://pytorch.org/get-started/locally/ |
| Derrian's backend repo (CAME optimizer) | https://github.com/derrian-distro/LoRA_Easy_Training_scripts_Backend |
| kohya_ss GUI (Colab integration) | https://github.com/bmaltais/kohya_ss |