quantization_config = TorchAoConfig("int8wo")
transformer = FluxTransformer2DModel.from_pretrained(
"black-forest-labs/Flux.1-Dev",
subfolder="transformer",
quantization_config=quantization_config,
torch_dtype=torch.bfloat16,
)
transformer.save_pretrained("/path/to/flux_int8wo", safe_serialization=False)
```  
To load a serialized quantized model, use the [`~ModelMixin.from_pretrained`] method.  
```python
import torch
from diffusers import FluxPipeline, FluxTransformer2DModel