OneTrainer is a one-stop solution for all your Diffusion training needs.
3,202
stars
1,621
commits
Python
primary language
Sep 7, 2026
updated
OneTrainer is a one-stop solution for all your Diffusion training needs.

[!NOTE] Explore our 📚 wiki for essential tips and tutorials after installing. Start here!. For command-line usage, see the CLI Mode section.
[!IMPORTANT] Installing OneTrainer requires Python >=3.10 and <3.14. You can download Python at https://www.python.org/downloads/windows/. Then follow the below steps.
git clone https://github.com/Nerogar/OneTrainer.gitinstall.batinstall.shgit clone https://github.com/Nerogar/OneTrainer.gitcd OneTrainerpython -m venv venvvenv\scripts\activatepip install -r requirements.txt[!Tip] Some Linux distributions are missing required packages for instance: On Ubuntu you must install
libGL:sudo apt-get update sudo apt-get install libgl1Additionally it's been reported Alpine, Arch and Xubuntu Linux may be missing
tkinter. Install it viaapk add py3-tkfor Alpine andsudo pacman -S tkfor Arch.
update.bat or update.shcd OneTrainergit pullvenv/scripts/activatepip install -r requirements.txt --force-reinstallOneTrainer can be used in two primary modes: a graphical user interface (GUI) and a command-line interface (CLI) for finer control.
For a technically focused quick start, see the Quick Start Guide and for a broader overview, see the Overview documentation. Otherwise visit our wiki!
start-ui.batstart-ui.sh and the GUI will pop up.If you need more control or a headless approach OT also supports the command-line interface. All commands need to be run inside the active venv created during installation.
All functionality is split into different scripts located in the scripts directory. This currently includes:
train.py The central training scripttrain_ui.py A UI for trainingcaption_ui.py A UI for manual or automatic captioning and mask creation for masked trainingconvert_model_ui.py A UI for model conversionsconvert_model.py A utility to convert between different model formatssample.py A utility to sample any modelcreate_train_files.py A utility to create files needed when training only from the CLIgenerate_captions.py A utility to automatically create captions for your datasetgenerate_masks.py A utility to automatically create masks for your datasetcalculate_loss.py A utility to calculate the training loss of every image in your datasetTo learn more about the different parameters, execute <script-name> -h. For example python scripts\train.py -h
If you are on Mac or Linux, you can also read the launch script documentation for detailed information about how to run OneTrainer and its various scripts on your system.
For general troubleshooting or questions, ask in Discussions, check the Wiki or join our Discord.
If you encounter a reproducible error you first must run update.bat or update.sh and confirm the issue is still able to be reproduced. Then export anonymized debug information to help us solve an issue you are facing and upload it as part of your Github Issues submission.
export_debug.bat./run-cmd.sh generate_debug_reportThese will both create a debug_report.log.
[!WARNING] We require this file for GitHub issues going forward. Failure to provide it or not manually providing the necessary info will lead to the issue being closed in most circumstances
Contributions are always welcome in any form. For new functionality please open a Github discussion or join our discord so that we can align and avoid duplicated work. You can find more information about contributing here.
Before you start looking at the code, I recommend reading about the project structure here. For in depth discussions, you should consider joining the Discord server.
You also NEED to install the required developer dependencies for your current user and enable the Git commit hooks, via the following commands (works on all platforms; Windows, Linux and Mac):
[!IMPORTANT] Be sure to run those commands without activating your venv or Conda environment, since pre-commit is supposed to be installed outside any environment.
cd OneTrainer
pip install -r requirements-dev.txt
pre-commit install
Now all of your commits will automatically be verified for common errors and code style issues, so that code reviewers can focus on the architecture of your changes without wasting time on style/formatting issues, thus greatly improving the chances that your pull request will be accepted quickly and effortlessly.
(top 30 of 57)
Python
98.6%
OneTrainer is a one-stop solution for all your Diffusion training needs.
3,202
stars
1,621
commits
Python
primary language
Sep 7, 2026
updated
OneTrainer is a one-stop solution for all your Diffusion training needs.

[!NOTE] Explore our 📚 wiki for essential tips and tutorials after installing. Start here!. For command-line usage, see the CLI Mode section.
[!IMPORTANT] Installing OneTrainer requires Python >=3.10 and <3.14. You can download Python at https://www.python.org/downloads/windows/. Then follow the below steps.
git clone https://github.com/Nerogar/OneTrainer.gitinstall.batinstall.shgit clone https://github.com/Nerogar/OneTrainer.gitcd OneTrainerpython -m venv venvvenv\scripts\activatepip install -r requirements.txt[!Tip] Some Linux distributions are missing required packages for instance: On Ubuntu you must install
libGL:sudo apt-get update sudo apt-get install libgl1Additionally it's been reported Alpine, Arch and Xubuntu Linux may be missing
tkinter. Install it viaapk add py3-tkfor Alpine andsudo pacman -S tkfor Arch.
update.bat or update.shcd OneTrainergit pullvenv/scripts/activatepip install -r requirements.txt --force-reinstallOneTrainer can be used in two primary modes: a graphical user interface (GUI) and a command-line interface (CLI) for finer control.
For a technically focused quick start, see the Quick Start Guide and for a broader overview, see the Overview documentation. Otherwise visit our wiki!
start-ui.batstart-ui.sh and the GUI will pop up.If you need more control or a headless approach OT also supports the command-line interface. All commands need to be run inside the active venv created during installation.
All functionality is split into different scripts located in the scripts directory. This currently includes:
train.py The central training scripttrain_ui.py A UI for trainingcaption_ui.py A UI for manual or automatic captioning and mask creation for masked trainingconvert_model_ui.py A UI for model conversionsconvert_model.py A utility to convert between different model formatssample.py A utility to sample any modelcreate_train_files.py A utility to create files needed when training only from the CLIgenerate_captions.py A utility to automatically create captions for your datasetgenerate_masks.py A utility to automatically create masks for your datasetcalculate_loss.py A utility to calculate the training loss of every image in your datasetTo learn more about the different parameters, execute <script-name> -h. For example python scripts\train.py -h
If you are on Mac or Linux, you can also read the launch script documentation for detailed information about how to run OneTrainer and its various scripts on your system.
For general troubleshooting or questions, ask in Discussions, check the Wiki or join our Discord.
If you encounter a reproducible error you first must run update.bat or update.sh and confirm the issue is still able to be reproduced. Then export anonymized debug information to help us solve an issue you are facing and upload it as part of your Github Issues submission.
export_debug.bat./run-cmd.sh generate_debug_reportThese will both create a debug_report.log.
[!WARNING] We require this file for GitHub issues going forward. Failure to provide it or not manually providing the necessary info will lead to the issue being closed in most circumstances
Contributions are always welcome in any form. For new functionality please open a Github discussion or join our discord so that we can align and avoid duplicated work. You can find more information about contributing here.
Before you start looking at the code, I recommend reading about the project structure here. For in depth discussions, you should consider joining the Discord server.
You also NEED to install the required developer dependencies for your current user and enable the Git commit hooks, via the following commands (works on all platforms; Windows, Linux and Mac):
[!IMPORTANT] Be sure to run those commands without activating your venv or Conda environment, since pre-commit is supposed to be installed outside any environment.
cd OneTrainer
pip install -r requirements-dev.txt
pre-commit install
Now all of your commits will automatically be verified for common errors and code style issues, so that code reviewers can focus on the architecture of your changes without wasting time on style/formatting issues, thus greatly improving the chances that your pull request will be accepted quickly and effortlessly.
(top 30 of 57)
Python
98.6%