OneTrainer  by Nerogar

Stable Diffusion training suite

created 2 years ago
2,395 stars

Top 19.7% on sourcepulse

GitHubView on GitHub
Project Summary

OneTrainer is a comprehensive solution for training Stable Diffusion models, catering to researchers and power users. It simplifies complex training workflows by offering a unified interface and extensive feature set for fine-tuning various diffusion models, including support for multiple training methods and advanced dataset handling.

How It Works

OneTrainer supports a wide array of Stable Diffusion model architectures (e.g., SDXL, Stable Cascade, PixArt) and formats (diffusers, ckpt). It implements advanced training techniques such as LoRA, full fine-tuning, and masked training, alongside features like automatic backups, image augmentation, and aspect ratio bucketing. The inclusion of noise scheduler rescaling and EMA model training, with optional CPU offloading for EMA weights, aims to optimize VRAM usage and training stability.

Quick Start & Requirements

  • Installation: Clone the repository and run install.bat (Windows) or install.sh (Unix). Manual installation involves creating a virtual environment and running pip install -r requirements.txt.
  • Prerequisites: Python >=3.10 and <3.13. On some Linux distributions, libgl1 (Ubuntu) or tk (Alpine/Arch) may be required.
  • Usage: Launch via start-ui.bat/start-ui.sh for GUI mode or use Python scripts (e.g., scripts/train.py) for CLI mode.
  • Documentation: Explore the wiki for tips and tutorials.

Highlighted Details

  • Supports 14+ Stable Diffusion model architectures and multiple training methods (Full fine-tuning, LoRA, embeddings).
  • Features automatic dataset captioning (BLIP, WD-1.4) and mask creation (ClipSeg, Rembg).
  • Includes TensorBoard integration, multiple prompts per image, and noise scheduler rescaling.
  • Offers aspect ratio bucketing and multi-resolution training for flexible dataset handling.

Maintenance & Community

  • Active development with community contributions encouraged via GitHub Discussions and Pull Requests.
  • Discord server available for in-depth discussions and troubleshooting.
  • Debug information export utility provided for issue reporting.

Licensing & Compatibility

  • The repository does not explicitly state a license in the README.

Limitations & Caveats

  • The README does not specify a license, which may impact commercial use or integration into closed-source projects.
  • Some Linux distributions require manual installation of additional packages (libgl1, tk).
Health Check
Last commit

5 days ago

Responsiveness

1 day

Pull Requests (30d)
12
Issues (30d)
12
Star History
215 stars in the last 90 days

Explore Similar Projects

Starred by Max Howell Max Howell(Author of Homebrew) and Patrick von Platen Patrick von Platen(Core Contributor to Hugging Face Transformers and Diffusers).

kohya_ss by bmaltais

0.3%
11k
GUI for Stable Diffusion training scripts
created 2 years ago
updated 1 week ago
Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Jeff Hammerbacher Jeff Hammerbacher(Cofounder of Cloudera), and
10 more.

open-r1 by huggingface

0.2%
25k
SDK for reproducing DeepSeek-R1
created 6 months ago
updated 4 days ago
Feedback? Help us improve.