# OneTrainer

> Open-source GUI and CLI tool for training and fine-tuning diffusion image models with LoRA, embeddings, and full fine-tuning.

OneTrainer is an open-source application for training diffusion models, hosted on GitHub by Nerogar. It offers both a graphical interface and command-line scripts for fine-tuning, LoRA training, and embedding training across many image and video diffusion model families.

## What It Is

OneTrainer is a diffusion training toolkit written in Python. Users prepare an image dataset, configure a training run in the GUI or through CLI scripts, and produce fine-tuned models, LoRAs, or embeddings. It reads and writes diffusers and ckpt model formats. The README describes it as a one-stop solution for diffusion training needs.

## Training Capabilities

The README lists support for models including FLUX.1, Flux.2, Qwen Image, Z-Image, Chroma, Stable Diffusion 1.5 through 3.5, SDXL, PixArt, Sana, Stable Cascade, Würstchen-v2, and Hunyuan Video, plus inpainting models. Training options include masked training, aspect ratio bucketing, multi-resolution training, EMA models (optionally kept in CPU memory to reduce VRAM use), noise scheduler rescaling, multiple prompts per image, and image augmentation. Automatic backups store everything needed to resume training, and TensorBoard integration tracks progress.

## Dataset and Model Tooling

Built-in tools can caption datasets automatically with BLIP, BLIP2, and WD-1.4, and generate masks with ClipSeg or Rembg. A model conversion UI converts between formats, and a sampling UI lets users generate samples during training without switching applications. CLI scripts cover training, captioning, mask generation, model conversion, sampling, and per-image loss calculation.

## Setup Path

Installation requires Python 3.10 or later but earlier than 3.14. Users clone the repository and run the install script (install.bat on Windows, install.sh on Linux and Mac) or set up a virtual environment manually. The GUI starts with start-ui.bat or start-ui.sh, and update scripts are provided. A wiki, Discord server, and GitHub Discussions support users. The project is licensed under AGPL-3.0.

## Features
- Full fine-tuning, LoRA, and embedding training
- Support for many diffusion models including FLUX, Stable Diffusion, SDXL, Qwen Image, and Hunyuan Video
- Masked training
- Automatic training backups with resume
- Image augmentation
- TensorBoard integration
- Aspect ratio bucketing and multi-resolution training
- EMA model training
- Automatic captioning with BLIP, BLIP2, and WD-1.4
- Mask generation with ClipSeg and Rembg
- Model format conversion UI
- Sampling UI during training
- GUI and CLI modes

## Integrations
TensorBoard, Hugging Face diffusers, BLIP, BLIP2, WD-1.4, ClipSeg, Rembg

## Platforms
WINDOWS, MACOS, LINUX, API, CLI

## Pricing
Open Source

## Links
- Website: https://github.com/Nerogar/OneTrainer
- Documentation: https://github.com/Nerogar/OneTrainer/wiki
- Repository: https://github.com/Nerogar/OneTrainer
- EveryDev.ai: https://www.everydev.ai/tools/onetrainer
