[InstructPix2Pix](https://hf.co/papers/2211.09800) is a Stable Diffusion model trained to edit images from human-provided instructions. For example, your prompt can be "turn the clouds rainy" and the model will edit the input image accordingly. This model is conditioned on the text prompt (or editing instruction) and the input image.  
This guide will explore the [train_instruct_pix2pix.py](https://github.com/huggingface/diffusers/blob/main/examples/instruct_pix2pix/train_instruct_pix2pix.py) training script to help you become familiar with it, and how you can adapt it for your own use case.  
Before running the script, make sure you install the library from source:  
```bash
git clone https://github.com/huggingface/diffusers
cd diffusers
pip install .
```  
Then navigate to the example folder containing the training script and install the required dependencies for the script you're using:  
```bash
cd examples/instruct_pix2pix
pip install -r requirements.txt
```  
<Tip>  
🤗 Accelerate is a library for helping you train on multiple GPUs/TPUs or with mixed-precision. It'll automatically configure your training setup based on your hardware and environment. Take a look at the 🤗 Accelerate [Quick tour](https://huggingface.co/docs/accelerate/quicktour) to learn more.  
</Tip>  
Initialize an 🤗 Accelerate environment:  
```bash
accelerate config
```  
To setup a default 🤗 Accelerate environment without choosing any configurations:  
```bash
accelerate config default
```  
Or if your environment doesn't support an interactive shell, like a notebook, you can use:  
```py
from accelerate.utils import write_basic_config

write_basic_config()
```  
Lastly, if you want to train a model on your own dataset, take a look at the [Create a dataset for training](create_dataset) guide to learn how to create a dataset that works with the training script.  
<Tip>  
The following sections highlight parts of the training script that are important for understanding how to modify it, but it doesn't cover every aspect of the script in detail. If you're interested in learning more, feel free to read through the [script](https://github.com/huggingface/diffusers/blob/main/examples/instruct_pix2pix/train_instruct_pix2pix.py) and let us know if you have any questions or concerns.  
</Tip>
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/training/instructpix2pix.md