-
Notifications
You must be signed in to change notification settings - Fork 7
Inpainting
You can use the inpainting tab to perform an img2img-like operation in the selected area, with the difference you're able to mask those parts you want to change while leaving the rest of the image intact. Inpainting is better for this than img2img because, while you can select the area to apply img2img to, inpainting also takes into account the context in the selection. For inpaining to work:
- Select an area of the canvas to become the input image.
- Create a new layer (name doesn't matter).
- Paint in black the mask over the area you want to inpaint, pretty much like in Automatic1111. To achieve mask blur, you can use blurry brushes or apply a blur filter to the layer.
- Configure the parameters on the inpaint tab. You can also check invert mask to inpaint the area that is not masked.
- Run inpaint.
The current selected layer will be used as the mask. Krita will automatically generate a group layer with a transparency mask matching the masked area in it. Once you get the inpainted image, you can leave this mask as is to only show the inpainted area or flatten the layer if necessary.
Under the hood, inpainting will VAE encode the selected area, then apply a mask noise in it. This as long as denoise is < 1 and mode is set to preserve. If latent noise mode is selected instead, it will generate a workflow using VAE Encode for Inpainting
node, meaning that a whole new image will be generated from random noise in the masked area. Other than that, it behaves exactly like https://github.com/JasonS09/comfy_sd_krita_plugin/wiki/Basic-usage-(txt2img-and-img2img)#txt2img-tab does.