+ refiner.enable_model_cpu_offload()
```  
2. Use `torch.compile` for ~20% speed-up (you need `torch>=2.0`):  
```diff
+ base.unet = torch.compile(base.unet, mode="reduce-overhead", fullgraph=True)
+ refiner.unet = torch.compile(refiner.unet, mode="reduce-overhead", fullgraph=True)
```  
3. Enable [xFormers](../optimization/xformers) to run SDXL if `torch<2.0`:  
```diff
+ base.enable_xformers_memory_efficient_attention()
+ refiner.enable_xformers_memory_efficient_attention()
```