```  
Generate the embeddings with the prior pipeline:  
```py
prompt = "a hat"
prior_output = prior_pipeline(prompt)
```  
Now pass the initial image, mask, and prompt and embeddings to the pipeline to generate an image:  
<hfoptions id="inpaint">
<hfoption id="Kandinsky 2.1">  
```py
output_image = pipeline(prompt, image=init_image, mask_image=mask, **prior_output, height=768, width=768, num_inference_steps=150).images[0]
mask = Image.fromarray((mask*255).astype('uint8'), 'L')