pipeline = AutoPipelineForImage2Image.from_pipe(pipeline_t2i, enable_pag=True)
```  
It is also very easy to directly switch from a text-to-image pipeline to PAG enabled image-to-image pipeline  
```py
pipeline_pag = AutoPipelineForText2Image.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16)
pipeline = AutoPipelineForImage2Image.from_pipe(pipeline_t2i, enable_pag=True)
```