Inpainting
Last updated
Last updated
Inpainting refers to the task of using AI to replace specific parts of an image, while keeping the rest of the image the same. For example, given this image generated using Realistic Vision and this mask (the shaded part of the mask refers to the part of the original image I want to replace):
I can use Auto 1111 SDK's Inpainting feature to make the woman's hair color something different. For example, green:
Inpainting with Auto 1111 SDK doesn't actually require a different pipeline object. You can use the same pipeline object that you used to generate the image to inpaint the image. However, for better results, it is recommended that you use a dedicated inpainting model, which you can find on Civit AI: https://civitai.com/. In this example, I will be using the dreamshaper v8 inpainting pipeline: https://civitai.com/models/4384?modelVersionId=131004. Here's how you can inpaint:
Initialize your pipeline. To download the model, you can use Auto 1111 SDK's Civit AI model downloader.
Open the image and mask photos as Image objects
Inpaint.
The resulting image will depend heavily on your prompt and negative prompt. In this example, my original prompt and negative prompt were:
For the inpainting parameters, I simply added ((green hair)) to the prompt. The double brackets indicates Auto 1111 SDK to use prompt attention, which you can read more about on our github repository.
Currently, Auto 1111 SDK supports the following parameters (and the corresponding default values):