source_prompt = "a bowl of fruits"
target_prompt = "a basket of pears"
mask_image = pipeline.generate_mask(
image=raw_image,
source_prompt=source_prompt,
target_prompt=target_prompt,
)
Image.fromarray((mask_image.squeeze()*255).astype("uint8"), "L").resize((768, 768))
```  
Next, create the inverted latents and pass it a caption describing the image:  
```py
inv_latents = pipeline.invert(prompt=source_prompt, image=raw_image).latents
```