Skip to content

Inpaint Outpaint

fszontagh edited this page Dec 29, 2024 · 1 revision

These features available from version 0.2.4


Inpainting and Outpainting is available in the img2img tab. The image is preferred to be a generated image, but works with external images too if the image is resized to compatible resolutions.

Best models for in/outpainting

SD1.x: https://huggingface.co/webui/stable-diffusion-inpainting/blob/main/sd-v1-5-inpainting.safetensors

SDXL: https://huggingface.co/alexgenovese/checkpoint/blob/021e192bd744c48a85f8ae1832662e77beb9aac7/sdxl-inpainting-1.0.safetensors

Of course, you can use another models too, but the images may will be inconsistent.

Inpaint / Outpaint colors

  • white - the allowed area to modify the original image
  • black - the forbidden area, SD will not modify the black parts of the mask on the original image
  • grey - the grey areas is the part of the initial image, where there is no "drawed" image content on the initial image. The mask image need to overlap these regions with white

Inpainting

Image inpainting is means to mark one or more place on the image. This image parts will be modified under the diffusion. Eg. an allowed area where the AI allowed to work knowing the other parts of the image.

In the GUI, after loading the base image, you can select three brush shape (circle, rectangle or triangle): image

Outpaintig

How can you load a generated image?

On the queue list in the Jobs & Images tab, you can select a generated image, right click on it, and select "Send image to img2img". This will load the image into the paint area on the img2img tab.

Alternate, you can use the file selector on the bottom of img2img tab:

image

This will open any image file without checking the source image resoulutions.

If the loaded image is larger than a normal SD image resolutions, you can resize it in the paintig area using the image resize button on the top:

image

Original sd.cpp PR #511

Clone this wiki locally