Diffusers documentation
xFormers
Get started
Inference
Using diffusion pipelines
Adapters and personalization
Optimize and scale
Basic performance
Inference
Community methods
Quantization
Hardware-specific acceleration
Serving and scaling
Modular Diffusers
Train and fine-tune
Resources
Contribute
API
You are viewing main version, which requires installation from source. If you'd like
regular pip install, checkout the latest stable version (v0.40.0).
xFormers
We recommend xFormers for both inference and training. In our tests, the optimizations performed in the attention blocks allow for both faster speed and reduced memory consumption.
Install xFormers from pip:
pip install xformers
The xFormers
pippackage requires the latest version of PyTorch. If you need to use a previous version of PyTorch, then we recommend installing xFormers from the source.
After xFormers is installed, you can use it with set_attention_backend() as shown in the Attention backends guide.
Update on GitHubAccording to this issue, xFormers
v0.0.16cannot be used for training (fine-tune or DreamBooth) in some GPUs. If you observe this problem, please install a development version as indicated in the issue comments.