Skip to content

OneTrainer Guide: Train FLUX, Qwen and SDXL LoRAs Locally (2026)

8–12 minutes
Woman in a living room holding a tablet with a ONETRAINER card, hook train your own LoRA

OneTrainer is a free, open-source app for training your own image models at home. With it you can teach FLUX, Qwen Image, Z-Image, SDXL or Stable Diffusion 1.5 a new character, product, art style or face, using a LoRA, an embedding or a full fine-tune, all from a desktop window on your own GPU.

This guide covers what OneTrainer supports, how to install it on Windows or Linux, how to prepare a dataset with captions, which preset to pick, the settings that matter most, how to sample and back up during training, and how to fix common errors.

It also explains when to choose OneTrainer over AI Toolkit or Kohya.

It follows the official OneTrainer README and Quick Start Guide on GitHub as of November 2026.

TL;DR

  • What: a one-stop GUI and CLI trainer for diffusion models: LoRA, embeddings and full fine-tuning.
  • Models: FLUX.1, Flux.2 Dev and Klein, Qwen Image, Z-Image, Ernie Image, Chroma, SD 1.5 to 3.5, SDXL, Stable Cascade, PixArt, Sana, Hunyuan Video and more.
  • Install: git clone https://github.com/Nerogar/OneTrainer.git, then run install.bat or install.sh. Needs Python 3.11.1 up to (not including) 3.14.
  • Start: start-ui.bat or start-ui.sh, pick a preset, add a concept folder, press Start.
  • Captions: a .txt file per image with the same name, or use the built-in BLIP, BLIP2 or WD-1.4 auto captioner.
  • Use your LoRA: load the saved output file in ComfyUI, Forge or SwarmUI. Backups are only for resuming training.

What OneTrainer Can Do

Area What it supports
Image models Ernie Image, Z-Image, Qwen Image, FLUX.1, Flux.2 Dev and Klein, Chroma, Stable Diffusion 1.5, 2.0, 2.1, 3.0, 3.5, SDXL, Wuerstchen v2, Stable Cascade, PixArt-Alpha, PixArt-Sigma, Sana
Video models Hunyuan Video
Training types Full fine-tuning, LoRA, embeddings
Model formats Diffusers folders and ckpt/safetensors checkpoints
Dataset tools Auto captions (BLIP, BLIP2, WD-1.4), masks (ClipSeg, Rembg)
Quality features Aspect ratio bucketing, multi-resolution training, EMA, noise scheduler rescaling, masked training
Workflow Built-in sampling, TensorBoard, automatic backups, model converter

Inpainting models are supported too, and you can train on several prompts per image.

OneTrainer vs AI Toolkit vs Kohya

Point OneTrainer AI Toolkit Kohya SS
Interface Desktop GUI plus CLI Web UI plus YAML configs Web GUI over sd-scripts
Strength All-in-one: captioning, masks, sampling and conversion in one app Popular for FLUX, Qwen and video LoRAs Huge community and many tutorials
Training types LoRA, embeddings, full fine-tune Mainly LoRA LoRA, DreamBooth, fine-tune
Best for People who want one tool and lots of control Quick modern LoRAs Classic SD 1.5 and SDXL workflows

We cover the others in our AI Toolkit LoRA guide. If you prefer a launcher that installs OneTrainer and other tools for you, Stability Matrix can do that; see our Stability Matrix guide.

What You Need

  • Python 3.11.1 or newer, but older than 3.14. Windows users can get it from python.org.
  • Git to clone the repository.
  • An NVIDIA GPU is the usual choice. VRAM needs depend heavily on the model: SD 1.5 LoRAs fit small cards, while FLUX and Qwen Image LoRAs want much more. Start from a preset made for your VRAM if one exists.
  • Disk space for the base model, the cache and backups. Backups contain full training state and can be large.
  • A small, clean dataset of images (see below).

Install OneTrainer

Automatic install (recommended)

  1. Open a terminal and run git clone https://github.com/Nerogar/OneTrainer.git
  2. On Windows, double-click install.bat. On Linux or Mac, run ./install.sh.
  3. Wait for it to create a virtual environment and install the requirements.
  4. Start the app with start-ui.bat (Windows) or ./start-ui.sh (Linux/Mac).

Manual install

git clone https://github.com/Nerogar/OneTrainer.git
cd OneTrainer
python -m venv venv
# Windows
venv\scripts\activate
# Linux / Mac: activate venv for your shell, e.g.
source venv/bin/activate
pip install -r requirements.txt

On Ubuntu you may need sudo apt-get install libgl1. Alpine, Arch and Xubuntu can be missing tkinter: install py3-tk on Alpine or tk on Arch.

Prepare Your Dataset

Good data matters more than any setting. For a character or product LoRA, 15 to 40 sharp, varied images is a common starting point; styles often use more.

  1. Put your images in one folder. No manual resizing is needed; OneTrainer resizes to your training resolution.
  2. Add a caption for each image. Either create image1.txt next to image1.jpg with the prompt, or rename each image to its prompt.
  3. Use a unique trigger word in every caption, such as mychar woman, so you can call the concept later.
  4. Describe what changes between images (clothes, background, pose) and leave out what should be “learned” as part of the concept.
  5. Or let the built-in tools do it: open the caption tool (caption_ui.py or the Tools menu) and auto-caption with BLIP, BLIP2 or WD-1.4, then edit by hand.

Only train on images you have the rights to use, and never train on real people without their consent.

Train Your First LoRA Step by Step

  1. Pick a preset at the top of the window that matches your model and method, for example a LoRA preset for SDXL or FLUX. Presets fill in sensible defaults.
  2. Choose a workspace: an empty folder for this run. It will hold backups, samples and TensorBoard logs.
  3. Choose a cache folder. Caching saves intermediate data so later epochs and runs go faster.
  4. Set the base model on the model tab: a .safetensors or .ckpt file, a diffusers folder, a Hugging Face repo name or a previous backup. Also set the model type.
  5. Set the output: a file name, format and data type. Float16 makes smaller files with a small quality cost.
  6. Add a concept on the concepts tab, click it, set the image folder and the prompt source (.txt files, filenames or one text file of prompts).
  7. Add a few sample prompts on the sampling tab, using your trigger word.
  8. Press Start Training and watch the progress, samples and loss.

Settings That Matter Most

Setting What it does Tip
Learning rate How fast the model learns Too high breaks the model; keep the preset value at first
Epochs How many times each image is trained on More epochs on small datasets risk overfitting
Batch size Images per step Higher generalises better but needs more VRAM
Accumulation steps Simulates a bigger batch Use when VRAM limits batch size; slower
Resolution Training size Comma-separate several values to train them together
Train data type Mixed precision for the forward pass float16 is much faster with only a small quality loss; not every GPU supports every type
Train text encoder / UNet Which parts learn Usually leave both on
Aspect ratio bucketing Mixes different image shapes Keep on for varied datasets
EMA Keeps a smoothed copy of weights Can store EMA on the CPU to save VRAM

If you change any data-related setting, clear the cache folder or pick a new one so old cached data is not reused.

Masked Training and Augmentation

Masked training tells the model to learn only part of each image, for example the subject and not the background. Add a black-and-white mask for each image named like image1-masklabel.png, where white means “learn this”. OneTrainer can make the masks for you with ClipSeg or Rembg.

Augmentation applies random changes such as rotation, brightness, contrast or saturation to add variety. If latent caching is on, raise the concept’s “Image Variations” setting, or only one augmented version gets cached.

Sampling, TensorBoard and Backups

  • Sampling: your sample prompts render at set intervals. Results show in TensorBoard and are saved in the workspace. This is the best way to spot over-training early.
  • TensorBoard: enable it, then click the TensorBoard button at the bottom to see loss curves and samples in your browser.
  • Backups: set regular backups on the backup tab and optionally one at the end. To resume, select the backup folder as your base model.

Important: backups are for continuing training only. They will not load in Forge, SwarmUI or similar tools. Use the saved output model, or convert a backup with the model converter.

Use Your Trained LoRA

  1. Copy the output .safetensors file into your UI’s LoRA folder, for example ComfyUI/models/loras/.
  2. Load the same base model you trained on.
  3. Add a LoRA loader and include your trigger word in the prompt.
  4. Start with a LoRA strength around 0.7 to 1.0 and adjust.

New to ComfyUI? Our ComfyUI out of memory fix helps if big models like FLUX will not fit when you test your LoRA.

CLI Mode

Everything is also available as scripts in the scripts folder. Run them inside the OneTrainer venv:

Script Purpose
train.py The main training script
create_train_files.py Creates the config files needed for CLI-only training
generate_captions.py Auto-captions a dataset
generate_masks.py Auto-creates masks
sample.py Generates images from any model
convert_model.py Converts between model formats
calculate_loss.py Calculates the loss of every image, useful to find bad samples

Run any script with -h to see its options, for example python scripts/train.py -h. A common pattern is to build a config in the GUI, save it, then run it headless on a server.

Update OneTrainer

  • Automatic: run update.bat or update.sh.
  • Manual: cd OneTrainer, git pull, activate the venv, then pip install -r requirements.txt --force-reinstall.

New model support lands often, so update before starting a big run.

Troubleshooting

Problem Fix
Install fails on Python version Use Python 3.11.1 to 3.13; 3.14 is not supported yet
libGL error on Ubuntu sudo apt-get install libgl1
GUI will not open on Linux Install tkinter (py3-tk on Alpine, tk on Arch)
CUDA out of memory Use a lower-VRAM preset, lower batch size and resolution, use accumulation steps, keep EMA on the CPU
Samples look burnt or identical Over-training: lower the learning rate or epochs, add more varied images
LoRA has no effect Use the trigger word, load the matching base model, raise strength
Changed data but results did not Clear the cache folder
Backup will not load in Forge or SwarmUI Backups are for resuming only; use the output file or convert it
Reproducible crash Run update first, then create a debug report (export_debug.bat or ./run-cmd.sh generate_debug_report) for a GitHub issue

FAQ

Is OneTrainer free?

Yes. It is open source on GitHub and runs on your own hardware.

Can OneTrainer train FLUX LoRAs?

Yes. FLUX.1, Flux.2 Dev and Flux.2 Klein are listed as supported, along with Qwen Image, Z-Image and Chroma.

Does OneTrainer work on Mac?

The install and start scripts support Mac and Linux, but training speed and VRAM depend on your hardware. NVIDIA GPUs are the common choice.

How many images do I need for a LoRA?

Often 15 to 40 good, varied images for a subject. Quality and variety matter more than quantity.

Can it caption my images automatically?

Yes, with BLIP, BLIP2 or WD-1.4. Always review the captions and add your trigger word.

Can I train video models?

Hunyuan Video is listed among the supported models.

What is the difference between a backup and a save?

A backup holds the full training state to resume a run. A save is the finished model or LoRA you use in image apps.

Sources

Free weekly email

Get new AI guides every week

One short weekly email with our newest local AI, ComfyUI and AI tool guides. No spam, no pop-ups, just the good stuff.

Free. Unsubscribe anytime in one click. We only use your email to send this newsletter. See our privacy policy.

Woman in a living room holding a tablet with a ONETRAINER card, hook train your own LoRA