# OneTrainer

> A GUI and CLI for fine-tuning diffusion models, LoRAs and embeddings

- Category: Training & Fine-Tuning / Fine-Tuning Frameworks
- Language: Python
- Licence: AGPL-3.0
- Repository: https://github.com/Nerogar/OneTrainer
- Canonical page: https://ai-tldr.dev/tools/onetrainer/

## In short

OneTrainer is a desktop trainer for diffusion models. It sits in the Fine-Tuning Frameworks category of the Training & Fine-Tuning tools and is open-source, written in Python and licensed AGPL-3.0. To get started: check the Python version.

## Overview

OneTrainer is a desktop trainer for diffusion models. Where most fine-tuning stacks are a collection of scripts and YAML, OneTrainer puts the whole loop behind a GUI — pick a model, point it at a dataset, choose a training method, watch samples appear as it runs — with a command-line mode for the same configuration when you want it scripted or headless.

It covers a wide model list rather than one family: Ernie Image, Z-Image, Qwen Image, FLUX.1, Flux.2 Dev and Klein, Chroma, Stable Diffusion 1.5, 2.0, 2.1, 3.0 and 3.5, SDXL, Würstchen-v2, Stable Cascade, PixArt-Alpha, PixArt-Sigma, Sana, Hunyuan Video and inpainting models, in both diffusers and ckpt formats. Three training methods are supported — full fine-tuning, LoRA and embeddings — and the trainer can train its own EMA model, optionally keeping EMA weights in CPU memory to cut VRAM use.

The surrounding tooling is the reason people reach for it. Masked training focuses the loss on parts of a sample; aspect-ratio bucketing and multi-resolution training let one run cover several shapes and sizes at once; image augmentation applies random rotation, brightness, contrast and saturation to widen a small dataset; automatic backups capture everything needed to resume a run. Dataset tooling captions images with BLIP, BLIP2 or WD-1.4 and builds masks with ClipSeg or Rembg, a model-conversion UI moves between formats, and TensorBoard integration tracks progress. OneTrainer runs on Windows, Linux and macOS under Python 3.10–3.13 and is licensed AGPL-3.0.

## What it does

- Full fine-tuning, LoRA and embedding training in one application, driven by a GUI or a CLI
- Broad model support — FLUX.1 and Flux.2, Qwen Image, Ernie Image, Z-Image, Chroma, SD 1.5/2.x/3.x, SDXL, Stable Cascade, PixArt, Sana, Hunyuan Video and inpainting models
- Masked training, aspect-ratio bucketing and multi-resolution training in the same run
- Dataset tooling: automatic captioning with BLIP, BLIP2 or WD-1.4 and mask creation with ClipSeg or Rembg
- EMA training with the option to keep EMA weights in CPU memory to reduce VRAM
- Automatic backups that capture enough state to resume training seamlessly, plus TensorBoard tracking and an in-app sampling UI

## Getting started

OneTrainer is installed from the repository rather than from a package index. The install scripts set up a virtual environment for you; the manual path is there when you want control over it.

1. Check the Python version

   OneTrainer requires Python >= 3.10 and < 3.14.

```bash
python --version
```

2. Clone and run the installer

   On Windows, double-click or execute install.bat. On Linux and macOS, execute install.sh.

```bash
git clone https://github.com/Nerogar/OneTrainer.git
cd OneTrainer
./install.sh   # Windows: install.bat
```

3. Or install manually

   Create a virtual environment yourself and install the requirements. On Ubuntu you may also need libGL; Alpine and Arch may be missing tkinter.

```bash
git clone https://github.com/Nerogar/OneTrainer.git
cd OneTrainer
python -m venv venv
source venv/bin/activate   # Windows: venv\scripts\activate
pip install -r requirements.txt
```

4. Keep it up to date

   Run update.bat or update.sh, or pull and force-reinstall the requirements inside the venv.

```bash
cd OneTrainer
git pull
source venv/bin/activate
pip install -r requirements.txt --force-reinstall
```

5. Learn the workflow

   OneTrainer runs in two modes — the GUI and a CLI for finer control. The repository's Quick Start Guide (docs/QuickStartGuide.md) and Overview (docs/Overview.md) cover a first run; the project wiki holds the longer tutorials.

## When to use it

- Train a character, style or product LoRA for FLUX, Qwen Image or SDXL without assembling a script pipeline
- Full fine-tune a diffusion checkpoint with EMA and automatic backups on a single workstation GPU
- Prepare a raw image folder for training — caption it with BLIP or WD-1.4 and generate masks with ClipSeg or Rembg — inside the same tool
- Train one dataset across several aspect ratios and resolutions at once instead of bucketing it by hand
