Before writing code, we strongly advise you to search through the existing PRs or
issues to make sure that nobody is already working on the same thing. If you are
unsure, it is always a good idea to open an issue to get some feedback.  
You will need basic `git` proficiency to be able to contribute to
🧨 Diffusers. `git` is not the easiest tool to use but it has the greatest
manual. Type `git --help` in a shell and enjoy. If you prefer books, [Pro
Git](https://git-scm.com/book/en/v2) is a very good reference.  
Follow these steps to start contributing ([supported Python versions](https://github.com/huggingface/diffusers/blob/83bc6c94eaeb6f7704a2a428931cf2d9ad973ae9/setup.py#L270)):  
1. Fork the [repository](https://github.com/huggingface/diffusers) by
clicking on the 'Fork' button on the repository's page. This creates a copy of the code
under your GitHub user account.  
2. Clone your fork to your local disk, and add the base repository as a remote:  
```bash
$ git clone git@github.com:<your GitHub handle>/diffusers.git
$ cd diffusers
$ git remote add upstream https://github.com/huggingface/diffusers.git
```  
3. Create a new branch to hold your development changes:  
```bash
$ git checkout -b a-descriptive-name-for-my-changes
```  
**Do not** work on the `main` branch.  
4. Set up a development environment by running the following command in a virtual environment:  
```bash
$ pip install -e ".[dev]"
```  
If you have already cloned the repo, you might need to `git pull` to get the most recent changes in the
library.  
5. Develop the features on your branch.  
As you work on the features, you should make sure that the test suite
passes. You should run the tests impacted by your changes like this:  
```bash
$ pytest tests/<TEST_TO_RUN>.py
```  
Before you run the tests, please make sure you install the dependencies required for testing. You can do so
with this command:  
```bash
$ pip install -e ".[test]"
```  
You can also run the full test suite with the following command, but it takes
a beefy machine to produce a result in a decent amount of time now that
Diffusers has grown a lot. Here is the command for it:  
```bash
$ make test
```  
🧨 Diffusers relies on `black` and `isort` to format its source code
consistently. After you make changes, apply automatic style corrections and code verifications
that can't be automated in one go with:  
```bash
$ make style
```  
🧨 Diffusers also uses `ruff` and a few custom scripts to check for coding mistakes. Quality
control runs in CI, however, you can also run the same checks with:  
```bash
$ make quality
```  
Once you're happy with your changes, add changed files using `git add` and
make a commit with `git commit` to record your changes locally:  
```bash
$ git add modified_file.py
$ git commit -m "A descriptive message about your changes."
```  
It is a good idea to sync your copy of the code with the original
repository regularly. This way you can quickly account for changes:  
```bash
$ git pull upstream main
```  
Push the changes to your account using:  
```bash
$ git push -u origin a-descriptive-name-for-my-changes
```  
6. Once you are satisfied, go to the
webpage of your fork on GitHub. Click on 'Pull request' to send your changes
to the project maintainers for review.  
7. It's OK if maintainers ask you for changes. It happens to core contributors
too! So everyone can see the changes in the Pull request, work in your local
branch and push the changes to your fork. They will automatically appear in
the pull request.
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/conceptual/contribution.md