High Definition Workflow for Stable Diffusion
A Basic Overview of Creating High Resolution AI-Assisted Images
Generate a basic
resolution composition
(it can be also img2img
from your photo)
Enlarge using Extras in SD (or any
other method)
768 x 512
1536 x 1024
Load in SDA. Now find important area and export it
as a slice using Export & Lock.
Load the slice in SD and use
inpainting to fix areras of
interest. Now send back to
SDA to assemble it.
Repeat.
The high-resolution workflow will begin with generating a composition at its base size (512), then progressively getting larger.
1536 x 1024
512 x 512
1536 x 1024
This way you can repeat the process of enlarging and refining, getting progressively more fine detail and resolution while you always work only on a
base resolution in the Stable Diffusion.
Detailed Step by Step
Create concept:
The first step is to generate a base concept in Stable Diffusion without looking too closely at the
details. For me, I want a young woman in a very messy library, sitting at a table and typing on a
computer or typewriter (I'm still undecided about which). Such a concept image can be entirely
generated from a prompt, or using img2img and a photo reference or 3D rendering... anything that
helps to capture the exact concept. In this case, the dimensions were 512x745.
(The image can be further refined through inpainting if necessary.)
Upsacale 2x:
Once the concept image is what we wanted, we need to resize it 2x.
This can be done in multiple ways, but Automatic1111 has a tab Extras where we can send
the image and scale it 2x using various Upscalers.
It is important to note that all the basic parts of the image should be already there where we
want them (such as windows, tables, the young woman sitting, bookshelves). It would be
much harder to add them at a higher resolution.
The result, in our case, will be an upsized image 1028 x 1490. This is our base image that we
will refine.
In Stable Diffusion
If we look closely at the detail of this resized base image, it is the typical AI-
generated horror. With so many details, everything is pretty chaotic when
looking up close.
The upscaled images from the Extras tab are saved in my case to
F:\outputs\extras-images
In SDA
Now it's time to start using the SDA split and merge tools.
To do so, I need to open this 1028 x 1490 resized image in SDA - or simply drag it to the
application.
The interface has a left and a right side.
The left side is for slicing the image, and the right side is for merging the SD-processed
slices back together.
First let's set up where SDA will save the slices. It doesn't
matter what the folder is, as long as you know where it is :)
At any moment you can open the Slice Folder from the
menu Tools:
On the left side we have Slicing tools. The base slice is 512 x 512 squares, which is what most Stable Diffusion models work
best with.
Remember, we are going to use the SD inpainting tool, so even if your model was trained on images of 768x768 pixels the
512 x 512 slices will still work well. You can also use other sizes like 1024 x 1024.
You can also use the Rotating slice which you can rotate in any direction, allowing to align your image with the way SD
thinks it should be.
There is also the Zooming slice that will first enlarge the slice and then shrink it back when importing.
Once you click any of the Slicer buttons, the appropriately sized rectangle will appear on top of the image.
This is the slicer - a window that will be exported, so position it to the area you want to work with.
Now it's time to export the slice. Just hit the Export and Lock button and the
slice will be saved in the Slice folder as specified earlier.
… and the rectangle will be Locked in place. In this state, it is waiting for us to return the changed slice so it
can be merged back.
The slice has been exported, but also if you have Tools-Auto Send to Clipboard set to ON - it was sent the
image to the clipboard.
Back in Stable Diffusion
We can either drag the file from the Slice Folder to the img2img inpaint window or in Automatic1111 we can
actually just paste it - when in inpaint tab, just press Ctrl+V.
Now we can work on this slice the usual way - mask part of the image, describe it and generate.
Remember to set: Resize mode to Crop and resize and Inpaint area to Only masked
Improve the slice using inpaint and when you are done, it's time to send the latest generated image
back to SDA. In my case I have SD set up so all inpainted images are saved in a date subfolder under
F:\outputs\img2img-images
(Don't forget to sort the folder by date).
Back in SDA
To get the slice back to SDA we can of course drag the latest
generated image over to the main window. But a faster method is
to setup the Quick Import.
All Quick import needs to know is the img2img folder. In my case it
is F:\outputs\img2img-images\2024-02-11 because I have it setup
so the images are saved in a subfolder by day to keep them
organized. This is set in SD Settings, Saving to a directory.
In such a case, I can also set up Img2img root. The purpose of this setting is to find the subfolder where the last file was saved and fill it in above the Quick
Import Img2Img folder.
So every day I use SDA, I don't have to browse for different subfolders, just click on the Find Most Recent subfolder and the latest path will be set in the
Img2Img folder (regardless of how it is named). If you don't use subfolders, then all you need to do is to fill the Img2Img folder (for example, C:\Stable-
Diffusion\outputs\img2img-images) above the Quick Import button and ignore the Img2Img root.
Merge Mode:
Once we click the Quick Import or drag and drop the processed slice from
img2img-images the slice will be merged with the base image and a blue frame will
appear around the entire image.
This signals we are in the Merge mode.
Merge mode is a mode where we can still adjust the blending of the new slice
before we Apply it. In most cases, nothing needs to be done; just press the yellow
Apply Merge button. But in case you want to adjust the blending mask or the edge
mask, this is the time to do it.
Before we hit Apply Merge, we can brush over the
blending mask. On the preview image the white
indicates where the NEW image will be fully visible and
black where it will be transparent and so the OLD
image from the background will be visible. This way
you can fix some discrepancies if you want to. This is
also a time when we can bail out and Cancel Merge.
After we hit the Apply Merge button, the merge will be concluded and
the composition image will be changed. This is where you repeat the
process with a different area of the image.
When the image is as good as it gets given this resolution (our base is currently at 1028 x 1490 pixels), we can graduate to the next higher level.
Save Image:
When you hit Save, the image will be saved to the same folder where the base originally came from. Since we
dragged the background from F:\outputs\extras-images (see the top of this guide), this is where the new image
will be also saved. SDA will always make a new name, every time you hit the Save button.
Repeat:
This is where it starts to feel familiar. Now we have a 1028 x 1490 pixel file with much more
refined details.
And you can probably guess what follows next - Yes, resize this new image 2X again.
So in Stable Diffusion Extras, we can drag in this newly saved file and do the same thing
again. Scale 2x using an Upscaler of our choice.
This will give us a 2056 x 2980 pixels file that we will then drag back to SDA and set as our
new background image. (Or just open it in File Open)
Since now the background is larger, the 512 x 512 slice will look smaller. And this way, we
can improve the details and then resize the image again and again...
This is the basic principle of how you can create an incredibly detailed image with thousands of pixels of resolution.
Tips
Before you load the slice into Stable Diffusion, you can add or remove things in Photoshop or another editor (for example, paint a crude hat on top
of the person's head and then use inpainting to turn it into a real hat). In my case, I can paste or draw a typewriter instead of a computer, then use
a prompt with the typewriter to correct the slice.
Crudely pasting an image of typewriter
After Impainting
In SDA you can zoom under cursor to see details at 1:1 resolution.
When in Magnify mode, wherever you click the slicing rectangle
will be placed around that area you see zoomed in.
Also, magnify works great in Merge mode when you are
painting a mask and you want to see the exact 1:1 result.
Sign up to receive Mediachance newsletter featuring new
announcements and special offers.