pipe.unet.set_attn_processor(AttnAddedKVProcessor2_0())
```  
3. Offload the model to the CPU with [`~KandinskyPriorPipeline.enable_model_cpu_offload`] to avoid out-of-memory errors:  
```diff
from diffusers import DiffusionPipeline
import torch