Kandinsky is unique because it requires a prior pipeline to generate the mappings, and a second pipeline to decode the latents into an image. Optimization efforts should be focused on the second pipeline because that is where the bulk of the computation is done. Here are some tips to improve Kandinsky during inference.  
1. Enable [xFormers](../optimization/xformers) if you're using PyTorch < 2.0:  
```diff
from diffusers import DiffusionPipeline
import torch