Installation
Last updated
Last updated
Install π Diffusers for whichever deep learning library youβre working with.
π Diffusers is tested on Python 3.7+, PyTorch 1.7.0+ and Flax. Follow the installation instructions below for the deep learning library you are using:
installation instructions.
installation instructions.
You should install π Diffusers in a . If youβre unfamiliar with Python virtual environments, take a look at this . A virtual environment makes it easier to manage different projects and avoid compatibility issues between dependencies.
Start by creating a virtual environment in your project directory:
Copied
Activate the virtual environment:
Copied
π Diffusers also relies on the π Transformers library, and you can install both with the following command:
PytorchHide Pytorch contentCopied
JAXHide JAX contentCopied
Before installing π Diffusers from source, make sure you have torch
and π Accelerate installed.
To install π Accelerate:
Copied
Install π Diffusers from source with the following command:
Copied
You will need an editable install if youβd like to:
Use the main
version of the source code.
Contribute to π Diffusers and need to test changes in the code.
Clone the repository and install π Diffusers with the following commands:
Copied
PytorchHide Pytorch contentCopied
JAXHide JAX contentCopied
These commands will link the folder you cloned the repository to and your Python library paths. Python will now look inside the folder you cloned to in addition to the normal library paths. For example, if your Python packages are typically installed in ~/anaconda3/envs/main/lib/python3.7/site-packages/
, Python will also search the ~/diffusers/
folder you cloned to.
You must keep the diffusers
folder if you want to keep using the library.
Now you can easily update your clone to the latest version of π Diffusers with the following command:
Copied
Your Python environment will find the main
version of π Diffusers on the next run.
Our library gathers telemetry information during from_pretrained()
requests. This data includes the version of Diffusers and PyTorch/Flax, the requested model or pipeline class, and the path to a pre-trained checkpoint if it is hosted on the Hub. This usage data helps us debug issues and prioritize new features. Telemetry is only sent when loading models and pipelines from the BOINC AI Hub, and is not collected during local usage.
We understand that not everyone wants to share additional information, and we respect your privacy, so you can disable telemetry collection by setting the DISABLE_TELEMETRY
environment variable from your terminal:
On Linux/MacOS:
Copied
On Windows:
Copied
For torch
installation, refer to the torch
guide.
This command installs the bleeding edge main
version rather than the latest stable
version. The main
version is useful for staying up-to-date with the latest developments. For instance, if a bug has been fixed since the last official release but a new release hasnβt been rolled out yet. However, this means the main
version may not always be stable. We strive to keep the main
version operational, and most issues are usually resolved within a few hours or a day. If you run into a problem, please open an , so we can fix it even sooner!