mage.fromarray((mask*255).astype('uint8'), 'L')
make_image_grid([init_image, mask, output_image], rows=1, cols=3)   You can also use the end-to-end KandinskyInpaintCombinedPipeline and KandinskyV22InpaintCombinedPipeline to call the prior and decoder pipelines together under the hood. Use the AutoPipelineForInpainting for this: Kandinsky 2.1 Kandinsky 2.2    Copied import torch
import numpy as np
from PIL import Image
from diffusers import Auto