
Stable Diffusion is one of the top AI text-to-image generating tools available online. Developed by Stability.ai, the software is a revolutionary image translator. It uses a latent diffusion model to render some of the fastest pictures based on text prompts.
Among its many features, outpainting is one of the most exciting ones to use. It helps expand an existing image in one or more directions based on text descriptions, sampling methods, and resolution settings. And unlike purely AI-generated images, the outpainting feature gives artists and casual Stable Diffusion users more control over the final product.
Creating Your Image Using Prompts
Before you tackle outpainting in Stable Diffusion, you must generate a picture. Here’s how you use the Automatic1111 GUI interface to create a new image.
- Go to the txt2img tab.
- Type the words that describe your image in the prompt text box.
- Type words describing graphic elements you don’t want to see in the negative prompt text box.
- Set the sampling steps at around 50-55, depending on your graphic card’s capabilities.
- Use whatever sampling method you want and set the width and height of the image.
- Check the “Restore Faces” option if you’re generating people in the image.
- Adjust the “Batch Count” slider if you want to render more than one image.
- Set the seed to “-1” unless you have a specific image seed in mind that you want to recreate.
- Click the “Generate” button.
Note that the words you type in the prompt text box are highly important. If you want specific strokes, styles, colors, and other effects, you must mention them in that section.
The default Stable Diffusion image generator will render something with a photographic feel unless instructed otherwise.
Using the Outpaint Feature in Stable Diffusion
Once you render an image, you can start expanding on it or outpainting it. Select the image you like the most from your batch and click the “Send to img2img” button.
Follow the next steps to configure Stable Diffusion for outpainting.
- Go to the img2img tab in the Automatic1111 GUI interface.
- Scroll down until you see the “Script” dropdown menu and select “Outpainting mk2.”
- Choose the outpainting direction by checking the “Left,” “Right,” “Up,” or “Down” boxes.
- Describe the visual elements of the outpainting in the prompt text box at the top of the UI.
- Check the “Just Resize” option.
- Set the sampling steps between 80 and 100 using the slider.
- Adjust the number of pixels, which you can often max out for the highest image quality.
- Click the “Generate” button.
The Best Way to Configure the Outpaint Process
One of the biggest problems with outpainting in Stable Diffusion and other AI-enabled text-to-image software is overloading the AI. For example, expanding a picture in more than one direction can yield mixed results.
In addition, if only one side turns out good, you won’t be able to keep it and redo the outpainting in the other directions. Instead, you must start from scratch. That means you may not be able to recreate that one side that looked perfect.
Here’s what you want to do to get the best outpainting results in Stable Diffusion.
Expand to the Left
- Load your picture in the img2img tab.
- Describe the visual elements you want in the outpainting.
- Add negative prompts if needed.
- Choose the “Left” outpainting direction and uncheck the other three options.
- Click “Generate” until you’re happy with the result.
- Drag the image from the right UI pane to the img2img tab.
Expand to the Right
- Describe the visual elements you want and don’t want in the prompt fields.
- Add negative prompts if you want the AI to omit specifics.
- Choose the “Right” outpainting direction and uncheck the previous one.
- Hit “Generate” until you get something great.
- Drag the image to the img2img tab or hit the “Send to img2img” button.
Expand Upward
- Add new visual elements for the image.
- Add negative prompts if needed.
- Select the “Up” outpainting direction and uncheck the last one.
- Hit “Generate” until you like the result.
- Drag and drop the final image back into the img2img tab.
Expand Down
- Type your final description before generating a downward expansion.
- Use some negative prompts, preferably to prevent overlapping with the original image.
- Select “Down” as the outpainting direction and uncheck everything else.
- Click the “Generate” button until satisfied with the results.
Another great benefit of expanding your image in one direction at a time is that you can better describe the imagery.
For example, say your starting image had the following prompt: “kids playing in the yard.” You could add “dog playing in the yard” on one side and “cat playing in the yard” on the other side. The AI will have a much higher chance of getting things right and rendering realistic animals in the final image.
In the same example, you can type “blue sky and birds” in the prompt and have the AI fill outwards above the original image instead of getting chunks of the sky in all directions.
What You Need to Master When Outpainting in Stable Diffusion
Stable Diffusion doesn’t come cheap. But since it’s Open AI software, you can run it on your own machine to avoid paying a fee per generation. Note that you’ll probably need a decent graphics card with around 8 GB of VRAM and a good CPU to avoid super slow rendering times.
Now it’s a matter of installing the Automatic1111 GUI web UI.
How to Install Stable Diffusion Automatic1111 Web UI on Windows
- First, install Python 3.11.1, as Stable Diffusion relies heavily on Python coding.
- Download and install the appropriate 32-bit or 64-bit Git standalone installer depending on your CPU.
- Run “git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git” to get the correct repository.
- Download the Stable Diffusion model checkpoint labeled “model.ckpt” from here.
- Add “model.ckpt” in the “models” directory.
- Double-click the “webui-user.bat” executable file.
- Generate a picture and experiment with the outpainting, inpainting, and other features.
How to Install Stable Diffusion Automatic1111 Web UI on Linux
Installing the Automatic1111 Web UI on a Linux machine is slightly different but pretty straightforward. Here are the steps you must follow.
Red Hat Linux
- Type “
sudo dnf install wget git python3
” in the terminal. - Install the UI by running “
bash <(wget –q0-https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui.sh)
.”
Debian Linux
- Type “
sudo apt install wget git python3 python3-venv
” and run it in the terminal. - Install the UI with the following command “
bash <(wget –q0-https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui.sh)
.”
Arch Linux
- Type “
sudo P –S wget git python3
” in the terminal. - Run “
bash <(wget –q0- https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui.sh)
” in the terminal.
How to Install Stable Diffusion Automatic1111 Web UI on Apple Silicon
The commands for installing Automatic1111 Web UI on an Apple Silicon machine are different than other operating systems.
- Start the Terminal app.
- Execute “
$ cd ~/Documents/
” - Run “
$ curl https://raw.githubusercontent.com/dylancl/stable-diffusion-webui-mps/master/setup_mac.sh -0 setup_mac.sh
” - Execute “
$ chmod +x setup_mac.sh
” - Run “
./setup_mac.sh
” - Follow the next instructions presented in the terminal interface.
You can run the Automatic1111 UI by running “./run webui_mac.sh
” in the terminal. Whenever you run it, it will start with the latest updates made to the repository.
What to Do After Outpainting an Image
As great as the Stable Diffusion AI is, it’s far from perfect. Overloading it with information and lengthy descriptions can render some less-than-exciting pictures. Likewise, vague descriptions can expand the image without adding enough relevant visual elements.
Once you’re done outpainting, you have two options. You can save the image and edit it further in your favorite image editor. But another way to get more use out of Stable Diffusion is to switch to inpainting.
Select your image in the right pane and click the “Send to Inpaint” button. The UI will switch to a new type of editing feature. It’s a great method for filling in the blanks in certain parts of the image.
- Select a brush size and mask a part of the image where you want to add something.
- Describe the inpainting elements.
- Deselect the “Outpainting mk2” script.
- Click “Generate” until satisfied with the result.
A Much-Needed Feature Is Finally Here
Although Stable Diffusion launched in August 2022, the outpainting feature didn’t really exist at first. At least its earliest iteration wasn’t spectacular. But in a short amount of time, Stable Diffusion’s outpainting has surpassed the capabilities of its inpainting feature.
The software can generate stunning images. And with 75-word descriptive texts and a separate field for negative prompts, the AI’s accuracy is astounding.
Now we want to hear from you. What is your experience with Stable Diffusion or similar software so far? Can you usually render satisfying images, or does it take too much time? Tell us about your Stable Diffusion experiences and outpainting tips in the comments section below.