How to Outpaint Stable Diffusion

Are you trying to extend an image in Stable Diffusion? Learn how to do it with ease through the steps below.
How to Outpaint Stable Diffusion

The img2img model of Stable Diffusion is capable of performing various modifications to an image apart from generating a new image through a reference image. In this guide, we will present a demonstration of how to extend an image through the outpaint capability of Stable Diffusion.

Outpaint in Stable Diffusion

  1. Begin by loading Stable Diffusion WebUI on your device to get started. Once loaded, navigate to the img2img and click on it.
img2img tab
  1. Now scroll down a bit until you find the Generation tab and click on img2img from its associated options. Next, look for the Click to Upload and click on it to add the image to Stable Diffusion.
Upload image
  1. After the image is added, scroll down even more until you find the Script and set it to Poor man’s outpainting.
Select script as poor mans outpainting
  1. With the script set, adjust the dimensions according to your requirements. Also, set the Resize mode to Crop and resize. While we suggest the rest to defaults, you can experiment with the Sampling methods if you’re aware.
Change the Resize mode and Dimensions
  1. Once everything is set, the last step is to set the Outpainting direction and Masked content type according to your outpainting requirements. Also, you can set the slider under Pixels to expand to expand the image to specific pixels.
Select the direction and masked content type

Quick Tip: You can set all outpainting directions to all sides, and Stable Diffusion extends the image based on the pixels set.

  1. After you have set the options as suggested or according to your requirements, fill in the positive and negative prompts that describe the uploaded image. Next, click on the Generate button, and you will find the outpainting tool at work, with the result previewed to the right.
Outpainting in action

Here is the result before and after extending the image using the outpainting tool on Stable Diffusion:

Comparison of before and after

Wrapping Up

Congratulations on learning how to use Outpaint on Stable Diffusion!

While the outpaint tool works well, it tends to struggle when the image is complex and generates undesirable results, like in the demonstration. However, you can get reliable results by setting the options right, adding a clear and accurate image, and experimenting with options like CFG scale, sampling methods, and masked content type.

How To Use img2img Stable Diffusion

How to Inpaint Stable Diffusion

How To Use Stable Diffusion for NSFW

What Is ControlNet Stable Diffusion

What Is Clip Skip Stable Diffusion


We will be happy to hear your thoughts

Leave a reply

Enable registration in settings - general