If you have PyTorch >= 2.0 installed, you should not expect a speed-up for inference when enabling `xformers`.  
</Tip>  
To use Flash Attention, install the following:  
- PyTorch > 1.12
- CUDA available
- [xFormers](xformers)  
Then call [`~ModelMixin.enable_xformers_memory_efficient_attention`] on the pipeline:  
```python
from diffusers import DiffusionPipeline
import torch