OneTrainer  by Nerogar

Stable Diffusion training suite

Created 2 years ago
2,484 stars

Top 18.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

3 days ago

Responsiveness

1 day

Pull Requests (30d)
40
Issues (30d)
40
Star History
60 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Wing Lian Wing Lian(Founder of Axolotl AI), and
10 more.

open_flamingo by mlfoundations

0.1%
4k
Open-source framework for training large multimodal models
Created 2 years ago
Updated 1 year ago
Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Jeff Hammerbacher Jeff Hammerbacher(Cofounder of Cloudera), and
5 more.

ai-toolkit by ostris

0.9%
6k
Training toolkit for finetuning diffusion models
Created 2 years ago
Updated 14 hours ago
Feedback? Help us improve.