π€ Diffusers provides a collection of training scripts for you to train your own diffusion models. You can find all of our training scripts in diffusers/examples.
Each training script is:
requirements.txt
file.Our current collection of training scripts include:
Training | SDXL-support | LoRA-support | Flax-support |
---|---|---|---|
unconditional image generation | |||
text-to-image | π | π | π |
textual inversion | π | ||
DreamBooth | π | π | π |
ControlNet | π | π | |
InstructPix2Pix | π | ||
Custom Diffusion | |||
T2I-Adapters | π | ||
Kandinsky 2.2 | π | ||
Wuerstchen | π |
These examples are actively maintained, so please feel free to open an issue if they arenβt working as expected. If you feel like another training example should be included, youβre more than welcome to start a Feature Request to discuss your feature idea with us and whether it meets our criteria of being self-contained, easy-to-tweak, beginner-friendly, and single-purpose.
Make sure you can successfully run the latest versions of the example scripts by installing the library from source in a new virtual environment:
git clone https://github.com/huggingface/diffusers
cd diffusers
pip install .
Then navigate to the folder of the training script (for example, DreamBooth) and install the requirements.txt
file. Some training scripts have a specific requirement file for SDXL, LoRA or Flax. If youβre using one of these scripts, make sure you install its corresponding requirements file.
cd examples/dreambooth
pip install -r requirements.txt
# to train SDXL with DreamBooth
pip install -r requirements_sdxl.txt
To speedup training and reduce memory-usage, we recommend: