Make sure you can successfully run the latest versions of the example scripts by installing the library from source in a new virtual environment:  
```bash
git clone https://github.com/huggingface/diffusers
cd diffusers
pip install .
```  
Then navigate to the folder of the training script (for example, [DreamBooth](https://github.com/huggingface/diffusers/tree/main/examples/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.  
```bash
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:  
- using PyTorch 2.0 or higher to automatically use [scaled dot product attention](../optimization/torch2.0#scaled-dot-product-attention) during training (you don't need to make any changes to the training code)
- installing [xFormers](../optimization/xformers) to enable memory-efficient attention
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/training/overview.md