-
-
Notifications
You must be signed in to change notification settings - Fork 410
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Move assets * Add graphics to README * Add setup docs * Revert test code * Add to setup * Add texture projection instructions * Document inpaint/outpaint * Update upscaling and history docs * Update option docs * Update render pass docs * Bump version to 0.0.9
- Loading branch information
1 parent
f352cca
commit 395141a
Showing
43 changed files
with
281 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,24 @@ | ||
# AI Upscaling | ||
Real-ESRGAN is built-in to the addon to upscale any generated image 2-4x the original size. | ||
Use the Stable Diffusion upscaler to increase images 4x in size while retaining detail. You can guide the upscaler with a text prompt. | ||
|
||
> You must setup the Real-ESRGAN weights separately from the Stable Diffusion weights before upscaling. The *AI Upscaling* panel contains instructions for downloading them. | ||
> Upscaling uses the model `stabilityai/stable-diffusion-4x-upscaler`. This model will automatically be downloaded when the operator is first run. | ||
1. Open the image to upscale an *Image Editor* space | ||
Use the AI Upscaling panel to access this tool. | ||
|
||
1. Open the image to upscale in an *Image Editor* space | ||
2. Expand the *AI Upscaling* panel, located in the *Dream* sidebar tab | ||
3. Choose a target size and click *Upscale* | ||
3. Type a prompt to subtly influence the generation. | ||
4. Optionally configure the tile size, blend, and other advanced options. | ||
|
||
![](assets/ai_upscaling/panel.png) | ||
|
||
The upscaled image will be opened in the *Image Editor*. The image will be named `Source Image Name (Upscaled)`. | ||
|
||
## Tile Size | ||
Due to the large VRAM consumption of the `stabilityai/stable-diffusion-4x-upscaler` model, the input image is split into tiles with each tile being upscaled independently, then stitched back together. | ||
|
||
> Some GPUs will require Full Precision to be enabled. | ||
The default tile size is 128x128, which will result in an image of size 512x512. These 512x512 images are stitched back together to form the final image. | ||
|
||
![A screenshot of the AI Upscaling panel set to 2 times target size and full precision enabled](../readme_assets/upscaling.png) | ||
You can increase or decrease the tile size depending on your GPU's capabilities. | ||
|
||
The upscaled image will be opened in the *Image Editor*. The image will be named `Source Image Name (Upscaled)`. | ||
The *Blend* parameter controls how much overlap is included in the tiles to help reduce visible seams. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Inpaint/Outpaint | ||
|
||
This guide shows how to use both [inpainting](#inpainting) and [outpainting](#outpainting). | ||
|
||
> For both inpainting and outpainting you *must* use a model fine-tuned for inpainting, such as `stabilityai/stable-diffusion-2-inpainting`. Follow the instructions to [download a model](setup.md#download-a-model). | ||
# Inpainting | ||
Inpainting refers to filling in or replacing parts of an image. It can also be used to [make existing textures seamless](#making-textures-seamless). | ||
|
||
The quickest way to inpaint is with the *Mark Inpaint Area* brush. | ||
|
||
1. Use the *Mark Inpaint Area* brush to remove the edges of the image | ||
2. Enter a prompt for what should fill the erased area | ||
3. Enable *Source Image*, select the *Open Image* source and the *Inpaint* action | ||
4. Choose the *Alpha Channel* mask source | ||
5. Click *Generate* | ||
|
||
![](assets/inpaint_outpaint/inpaint.png) | ||
|
||
## Making Textures Seamless | ||
Inpainting can also be used to make an existing texture seamless. | ||
|
||
1. Use the *Mark Inpaint Area* brush to remove the edges of the image | ||
2. Enter a prompt that describes the texture, and check *Seamless* | ||
3. Enable *Source Image*, select the *Open Image* source and the *Inpaint* action | ||
4. Click *Generate* | ||
|
||
![](assets/inpaint_outpaint/seamless_inpaint.png) | ||
|
||
# Outpainting | ||
Outpainting refers to extending an image beyond its original size. Use an inpainting model such as `stabilityai/stable-diffusion-2-inpainting` for outpainting as well. | ||
|
||
1. Select an image to outpaint and open it in an Image Editor | ||
2. Choose a size, this is how large the outpaint will be | ||
3. Enable *Source Image*, select the *Open Image* source and the *Outpaint* action | ||
4. Set the origin of the outpaint. See [Choosing an Origin](#choosing-an-origin) for more info. | ||
|
||
### Choosing an Origin | ||
The top left corner of the image is (0, 0), with the bottom right corner being the (width, height). | ||
|
||
You should always include overlap or the outpaint will be completely unrelated to the original. The add-on will warn you if you do not include any. | ||
|
||
Take the image below for example. We want to outpaint the bottom right side. Let's figure out the correct origin. | ||
|
||
Here's what we know: | ||
1. We know our image is 512x960. You can find this in the sidebar on the *Image* tab. | ||
2. We set the size of the outpaint to 512x512 in the *Dream* tab | ||
|
||
With this information we can calculate: | ||
1. The X origin will be the width of the image minus some overlap. The width is 512px, and we want 64px of overlap. So the X origin will be set to `512 - 64` or `448`. | ||
2. The Y origin will be the height of the image minus the height of the outpaint size. The height of the image is 960px, and the height of the outpaint is 512px. So the Y origin will be set to `960 - 512` or `448`. | ||
|
||
> Tip: You can enter math expressions into any Blender input field. | ||
![](assets/inpaint_outpaint/outpaint_origin.png) | ||
|
||
After selecting this origin, we can outpaint the bottom right side. | ||
|
||
![](assets/inpaint_outpaint/outpaint.gif) | ||
|
||
Here are other values we could have used for other parts of the image: | ||
|
||
* Bottom Left: `(-512 + 64, 512 - 64)` or `(-448, 448)` | ||
* Top Right: `(512 - 64, 0)` or `(448, 0)` | ||
* Top Left: `(-512 + 64, 0)` or `(-448, 0)` | ||
* Top: `(0, 0)` | ||
* Bottom: `(0, 512 - 64)` or `(0, 448)` |
Oops, something went wrong.