How to Make a Stable Diffusion LoRA: Local kohya vs. Online Training, Step by Step
Have a GPU? Use kohya. No GPU? Train online. Datasets, base models and a parameter map in one guide.
Pick a routeDatasetBase modelLocal kohyaOnlineFAQ
QUICK ANSWER
A Stable Diffusion LoRA is made by training an SD 1.5 or SDXL base model on 15–30 images of the same subject.
There are two ways to do it: train on your own computer with kohya (sd-scripts), or use an online service that needs no GPU. Dataset prep is the same either way. The difference is whether you handle the setup and parameters yourself.
ROUTE A · LOCAL
Local training (kohya)
Needs an NVIDIA GPU and a Python setup. You choose every parameter, and the result is a LoRA file on your computer.
ROUTE B · ONLINE
Online training (PixAI)
Runs in your browser with nothing to install. Basic training takes about 50 minutes, you can pick SDXL, SD 1.5 or Tsubaki base models, and you generate with the result right on PixAI.
Pick a route: local or online training
If you have a capable NVIDIA GPU and want to tune every parameter, go local. No GPU, or you just want your first LoRA done, go online. Here's how the two compare.
| Local (kohya / sd-scripts) | Online (PixAI) | |
|---|---|---|
| Hardware | An NVIDIA GPU with enough VRAM, plus disk space | Any computer or phone with a browser |
| Setup | Install Python, sd-scripts and their dependencies | Nothing to install |
| Cost | Your hardware and electricity, no credits | Credits per training run, shown next to the Start training button. Verifying your email gives you one free run |
| Parameters you can change | Almost everything, including epochs, repeats and per-module learning rates | Basic training sets them for you. Advanced training lets you set Steps, learning rate, Rank, Alpha and Batch size |
| Result | A .safetensors file on your computer that you can load into WebUI and similar tools | Generate with it directly on PixAI. Creators choose whether their SDXL / SD 1.5 LoRAs can be downloaded; Tsubaki (DiT) LoRAs can't be downloaded |
| Best for | People who want full control and don't mind fixing their setup | First-time LoRA makers and anyone without a GPU |
Same for both routes: prepare your dataset
Most of what makes a LoRA good is decided before training starts. Whatever tool you use, the rule is the same: keep the subject identical in every image and vary everything else.
- How many images: 15–30 is typical for a character LoRA. PixAI takes 10 to 100 images per run.
- Resolution: at least 512×512, ideally 768–1024 px square for SDXL. The model can't learn detail that isn't in the source.
- One subject per image: once a second person is in frame, the model can't tell whose features are whose.
- Remove clutter: watermarks, text and speech bubbles get learned too.
- Vary angles, poses and backgrounds: if every image is front-facing on the same background, the LoRA locks those in as well.


CAPTION RULE
Whatever you write in the captions is something you can change later with your prompt. Whatever you leave out gets learned into the LoRA.
For a character LoRA, leave out fixed features like hair and eye color, but describe outfits, poses and backgrounds. In kohya, captions go in a .txt file with the same name as each image. PixAI's Basic training writes captions automatically, and Advanced training lets you edit each one.
Trigger words work the same on both routes: use a word the model doesn't already know, such as mika_oc, rather than the character's real name or common appearance terms. More in the LoRA trigger words guide.
Choose a base model: SD 1.5, SDXL or DiT
A LoRA only works on the architecture it was trained on. An SD 1.5 LoRA does nothing on SDXL, and the other way around. So decide first: train on the base model you'll actually generate with.
| Architecture | Example base models | Good for | Watch out for |
|---|---|---|---|
| SD 1.5 | Community SD 1.5 models | Older projects, weaker hardware | Not compatible with SDXL LoRAs |
| SDXL | Illustrious, NoobAI XL, Haruka v2, Hoshino v2 | The current mainstream for Stable Diffusion anime art | LoRAs carry over better within one family, such as Illustrious |
| DiT (PixAI) | Tsubaki.3, Tsubaki.2, Tsubaki | Multiple characters in one image, natural-language prompts | Not a Stable Diffusion architecture. Tsubaki.2 and Tsubaki.3 LoRAs don't work on each other either |
If you want to use the LoRA in the Stable Diffusion ecosystem, pick SDXL or SD 1.5. If you'll generate on PixAI, the trainer recommends Tsubaki.3 (DiT.3); see the DiT LoRA training guide.
Route A: train locally with kohya (sd-scripts)
kohya's sd-scripts is the most common tool for training LoRAs locally, and kohya_ss gives it a graphical interface. The process breaks down into five steps. Install steps, commands and parameter names change between versions, so follow the official sd-scripts documentation for the details.
- Install sd-scripts: set up Python and your NVIDIA GPU driver, then install sd-scripts (or kohya_ss) following the official instructions.
- Organize folders and captions: put your images in a training folder, each with a .txt caption file of the same name. The number at the front of the folder name (for example
10_mika) sets how many times each image repeats per epoch. - Choose the base model: point it at an SD 1.5 or SDXL checkpoint. SDXL uses its own training script.
- Set parameters: mainly
network_dim(Rank),network_alpha,learning_rate, epochs ormax_train_steps, and batch size. - Train and test: training outputs a .safetensors file. Drop it into the LoRA folder of WebUI or a similar tool and generate test images with your trigger words.
The usual sticking point with local training is the environment: Python versions, CUDA versions, running out of VRAM. Training time also varies a lot with your GPU and settings. If setup is eating your day, make your first LoRA online and come back to it later.
Route B: train online with PixAI (no GPU needed)
PixAI trains on its servers, so you don't need to keep the page open. Choose Basic training for your first LoRA; it takes about 50 minutes. The example below uses an SDXL base model.

- Open the training page and choose Basic training: open the Train LoRA page and pick Basic training for your first run.
- Pick a category: Character, Art style, Outfit, or Something else (animals, poses, backgrounds and so on).
- Add images: upload from your device, pick from your generation history, or import from a past training. 10 to 100 images, PNG, JPG or WebP.
- Name it, set trigger words, choose the base model: enter a LoRA name and trigger words (no minimum length, up to 256 characters), then switch to the SDXL or SD 1.5 tab under Base model. You can't change the base model once training starts.
- Check the credits and click Start training: the cost is shown next to the button. When it finishes, publish a version from Training tasks.


Test it before you share it
Add your LoRA in the Style tab of the generator and start Strength at 0.7. You don't need to switch base models; PixAI picks the one the LoRA was trained on. Run these two first, with your own trigger words:
mika_oc, black bob hair, red hairclip, brown eyes, upper body, looking at viewer, simple background
mika_oc, black bob hair, red hairclip, brown eyes, yellow raincoat, standing in the rain, full body
The first checks whether it looks like your subject. The second checks whether the outfit can change. If the dataset's outfit keeps coming back, the LoRA has locked it in: vary the outfit in the next version and describe it in the captions. For tuning Strength, see the LoRA weight settings guide.
For kohya users: Advanced training parameters
To set parameters yourself, switch to Advanced training (about 2–6 hours). It supports Tsubaki.3 and Tsubaki.2 only, and measures training by total Steps, with no epochs or repeats. Here's how the settings line up:
| In PixAI | kohya parameter | Default / options |
|---|---|---|
| Training Steps | max_train_steps | 325; 50–800 |
| Learning rate | learning_rate / unet_lr | 6e-4; 5e-5–1e-3, one learning rate for the whole network |
| Detail capacity (Rank) | network_dim | 64; 8 / 16 / 32 / 64 |
| Alpha | network_alpha | Half your Rank; half, equal or double |
| Update smoothing (Batch size) | batch_size | 2; 1 / 2 / 4 |
How to set each one, and what it costs, is in the PixAI LoRA Advanced training guide.
Stable Diffusion LoRA FAQ
How many images do I need for a LoRA?
Usually 15–30 for a character LoRA and 20–40 for a style LoRA. Quality beats quantity: 20 clear, varied images do better than 100 blurry or repetitive ones. PixAI's trainer takes 10 to 100 images per run.
Can I make a LoRA without a GPU?
Yes. An online training service means you don't need your own graphics card. PixAI runs training on its servers, and you can do the whole thing in a browser.
Do SD 1.5 and SDXL LoRAs work on each other?
No. A LoRA only works on base models with the same architecture. Within SDXL, LoRAs carry over better inside one family (such as Illustrious), but results aren't guaranteed to match the original base model.
Can I download my LoRA and use it in WebUI?
If you trained locally with kohya, the result is already a .safetensors file on your computer. On PixAI, you choose whether LoRAs trained on SDXL or SD 1.5 base models can be downloaded. LoRAs trained on Tsubaki.3 or Tsubaki.2 can't be downloaded and only work on PixAI.
How long does training take?
On PixAI, Basic training takes about 50 minutes and Advanced training about 2–6 hours, not counting time in the queue. Local training depends heavily on your GPU and settings.
How much does online training cost?
Each run costs credits, which vary by base model and are shown before you click Start training. On the training screen on October 28, 2026, SDXL cost 25,000 credits (discounted from 75,000) and Tsubaki.3 cost 100,000. Verifying your email gives you one free run, and memberships include 3–10 free runs a month. Retraining a new version on the same dataset is discounted in Basic training.
What to read next
- PixAI LoRA training guide: every step with screenshots, plus how to make style, pose and outfit LoRAs.
- What is a LoRA?: start here if LoRAs and base models still blur together.
- How to use LoRAs: loading, stacking and adjusting the strength of the LoRA you made.
