For users that wish to make use of Docker or another container orchestration platform, see this document first.
- Clone the repository and install the dependencies:
git clone https://github.com/bghira/SimpleTuner --branch release
python -m venv .venv
pip3 install -U poetry pipThe experience of training a model may be disappointing on Apple hardware due to the lack of memory-efficient attention - things require more VRAM here.
You will require a minimum of 24G of total memory for an SDXL LoRA at a batch size of 1.
To install the Apple-specific requirements:
poetry install --no-root -C install/appleThe first command you'll run will install most of the dependencies:
poetry install --no-rootYou will possibly need to install some Linux-specific dependencies (Ubuntu is used here):
⚠️ This command can break certain container deployments. If it does, you'll have to redeploy the container.
apt -y install nvidia-cuda-dev nvidia-cuda-toolkitIf you get an error about missing cudNN library, you will want to install torch manually (replace 118 with your CUDA version if not using 11.8):
pip3 install xformers torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu118 --forceAlternatively, Pytorch Nightly may be used (currently Torch 2.3) with Xformers 0.0.23.post1+cu118 (note that this includes torchtriton now):
pip3 install --pre torch torchvision torchaudio torchtriton --extra-index-url https://download.pytorch.org/whl/nightly/cu118 --force
pip3 install --pre git+https://github.com/facebookresearch/xformers.git@main#egg=xformersIf the egg install for Xformers does not work, try including xformers on the first line, and run only that:
pip3 install --pre xformers torch torchvision torchaudio torchtriton --extra-index-url https://download.pytorch.org/whl/nightly/cu118 --forceDue to xformers not supporting the ROCm platform, memory requirements for training will likely be higher than otherwise stated.
To install the ROCm-specific requirements:
poetry install --no-root -C install/rocm- Copy
config/config.env.exampletoconfig/config.envand then fill in the details.
For both training scripts, any missing values from your user config will fallback to the defaults.
- If you are using
--report_to='wandb'(the default), the following will help you report your statistics:
wandb loginFollow the instructions that are printed, to locate your API key and configure it.
Once that is done, any of your training sessions and validation data will be available on Weights & Biases.
- Launch the
train.shscript, probably by redirecting the output to a log file:
bash train.sh > /path/to/training-$(date +%s).log 2>&1
⚠️ At this point, the commands will work, but further configuration is required. See the tutorial for more information.
To run unit tests to ensure that installation has completed successfully, execute the command poetry run python -m unittest discover tests/.