To use bitsandbytes, make sure you have the following libraries installed:  
```bash
pip install diffusers transformers accelerate bitsandbytes -U
```  
Now you can quantize a model by passing a [`BitsAndBytesConfig`] to [`~ModelMixin.from_pretrained`]. This works for any model in any modality, as long as it supports loading with [Accelerate](https://hf.co/docs/accelerate/index) and contains `torch.nn.Linear` layers.  
<hfoptions id="bnb">
<hfoption id="8-bit">