Instructions to use kandinsky-community/kandinsky-2-2-decoder-inpaint with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use kandinsky-community/kandinsky-2-2-decoder-inpaint with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("kandinsky-community/kandinsky-2-2-decoder-inpaint", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Minimum mask size and shape
Is there a minimum mask size required for the inpainting model? I have noticed that I need to create a very huge mask for an inpainting object to be successfully generated. When using a smaller (or more appropriate) mask size, the model just returns the very same image without any inpainting. I tried using rectangular mask shapes and square shapes but got the same result. I am using a guidance scale of 6.
Here is an example of my input, mask, and the output below:
Prompt: “a clock on the wall”
Using extremely large masks does generate inpainted objects but causes the objects in the original image to be morphed. Not sure what I’m doing wrong with the masks, any help will be much appreciated.


