2022-09-21 06:53:08 +00:00
|
|
|
---
|
|
|
|
title: Outpainting
|
|
|
|
---
|
|
|
|
|
|
|
|
# :octicons-paintbrush-16: Outpainting
|
|
|
|
|
refactor how postprocessors work
- similar call structures for outpainting, outcropping and face restoration modules
- added documentation for outcropping
- post-processing steps now leave a provenance chain (of sorts) in the sd-metadata field:
~~~
scripts/sd-metadata.py outputs/img-samples/curly.942491079.upscale.png
outputs/img-samples/curly.942491079.upscale.png:
{
"model": "stable diffusion",
"model_id": "stable-diffusion-1.4",
"model_hash": "fe4efff1e174c627256e44ec2991ba279b3816e364b49f9be2abc0b3ff3f8556",
"app_id": "lstein/stable-diffusion",
"app_version": "v1.15",
"image": {
"height": 512,
"width": 512,
"steps": 50,
"cfg_scale": 7.5,
"seed": 942491079,
"prompt": [
{
"prompt": "pretty curly-haired redhead woman",
"weight": 1.0
}
],
"postprocessing": [
{
"tool": "outcrop",
"dream_command": "!fix \"test-pictures/curly.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -c top 64 right 64"
},
{
"tool": "gfpgan",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.outcrop-02.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -G 0.8"
},
{
"tool": "upscale",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.gfpgan.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -U 4.0 0.75"
}
],
"sampler": "k_lms",
"variations": [],
"type": "txt2img"
}
}
~~~
2022-10-03 20:53:12 +00:00
|
|
|
## Outpainting and outcropping
|
2022-09-21 06:53:08 +00:00
|
|
|
|
refactor how postprocessors work
- similar call structures for outpainting, outcropping and face restoration modules
- added documentation for outcropping
- post-processing steps now leave a provenance chain (of sorts) in the sd-metadata field:
~~~
scripts/sd-metadata.py outputs/img-samples/curly.942491079.upscale.png
outputs/img-samples/curly.942491079.upscale.png:
{
"model": "stable diffusion",
"model_id": "stable-diffusion-1.4",
"model_hash": "fe4efff1e174c627256e44ec2991ba279b3816e364b49f9be2abc0b3ff3f8556",
"app_id": "lstein/stable-diffusion",
"app_version": "v1.15",
"image": {
"height": 512,
"width": 512,
"steps": 50,
"cfg_scale": 7.5,
"seed": 942491079,
"prompt": [
{
"prompt": "pretty curly-haired redhead woman",
"weight": 1.0
}
],
"postprocessing": [
{
"tool": "outcrop",
"dream_command": "!fix \"test-pictures/curly.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -c top 64 right 64"
},
{
"tool": "gfpgan",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.outcrop-02.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -G 0.8"
},
{
"tool": "upscale",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.gfpgan.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -U 4.0 0.75"
}
],
"sampler": "k_lms",
"variations": [],
"type": "txt2img"
}
}
~~~
2022-10-03 20:53:12 +00:00
|
|
|
Outpainting is a process by which the AI generates parts of the image
|
|
|
|
that are outside its original frame. It can be used to fix up images
|
|
|
|
in which the subject is off center, or when some detail (often the top
|
|
|
|
of someone's head!) is cut off.
|
2022-09-21 06:53:08 +00:00
|
|
|
|
refactor how postprocessors work
- similar call structures for outpainting, outcropping and face restoration modules
- added documentation for outcropping
- post-processing steps now leave a provenance chain (of sorts) in the sd-metadata field:
~~~
scripts/sd-metadata.py outputs/img-samples/curly.942491079.upscale.png
outputs/img-samples/curly.942491079.upscale.png:
{
"model": "stable diffusion",
"model_id": "stable-diffusion-1.4",
"model_hash": "fe4efff1e174c627256e44ec2991ba279b3816e364b49f9be2abc0b3ff3f8556",
"app_id": "lstein/stable-diffusion",
"app_version": "v1.15",
"image": {
"height": 512,
"width": 512,
"steps": 50,
"cfg_scale": 7.5,
"seed": 942491079,
"prompt": [
{
"prompt": "pretty curly-haired redhead woman",
"weight": 1.0
}
],
"postprocessing": [
{
"tool": "outcrop",
"dream_command": "!fix \"test-pictures/curly.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -c top 64 right 64"
},
{
"tool": "gfpgan",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.outcrop-02.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -G 0.8"
},
{
"tool": "upscale",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.gfpgan.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -U 4.0 0.75"
}
],
"sampler": "k_lms",
"variations": [],
"type": "txt2img"
}
}
~~~
2022-10-03 20:53:12 +00:00
|
|
|
InvokeAI supports two versions of outpainting, one called "outpaint"
|
|
|
|
and the other "outcrop." They work slightly differently and each has
|
|
|
|
its advantages and drawbacks.
|
2022-09-21 06:53:08 +00:00
|
|
|
|
refactor how postprocessors work
- similar call structures for outpainting, outcropping and face restoration modules
- added documentation for outcropping
- post-processing steps now leave a provenance chain (of sorts) in the sd-metadata field:
~~~
scripts/sd-metadata.py outputs/img-samples/curly.942491079.upscale.png
outputs/img-samples/curly.942491079.upscale.png:
{
"model": "stable diffusion",
"model_id": "stable-diffusion-1.4",
"model_hash": "fe4efff1e174c627256e44ec2991ba279b3816e364b49f9be2abc0b3ff3f8556",
"app_id": "lstein/stable-diffusion",
"app_version": "v1.15",
"image": {
"height": 512,
"width": 512,
"steps": 50,
"cfg_scale": 7.5,
"seed": 942491079,
"prompt": [
{
"prompt": "pretty curly-haired redhead woman",
"weight": 1.0
}
],
"postprocessing": [
{
"tool": "outcrop",
"dream_command": "!fix \"test-pictures/curly.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -c top 64 right 64"
},
{
"tool": "gfpgan",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.outcrop-02.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -G 0.8"
},
{
"tool": "upscale",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.gfpgan.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -U 4.0 0.75"
}
],
"sampler": "k_lms",
"variations": [],
"type": "txt2img"
}
}
~~~
2022-10-03 20:53:12 +00:00
|
|
|
### Outcrop
|
2022-09-21 06:53:08 +00:00
|
|
|
|
refactor how postprocessors work
- similar call structures for outpainting, outcropping and face restoration modules
- added documentation for outcropping
- post-processing steps now leave a provenance chain (of sorts) in the sd-metadata field:
~~~
scripts/sd-metadata.py outputs/img-samples/curly.942491079.upscale.png
outputs/img-samples/curly.942491079.upscale.png:
{
"model": "stable diffusion",
"model_id": "stable-diffusion-1.4",
"model_hash": "fe4efff1e174c627256e44ec2991ba279b3816e364b49f9be2abc0b3ff3f8556",
"app_id": "lstein/stable-diffusion",
"app_version": "v1.15",
"image": {
"height": 512,
"width": 512,
"steps": 50,
"cfg_scale": 7.5,
"seed": 942491079,
"prompt": [
{
"prompt": "pretty curly-haired redhead woman",
"weight": 1.0
}
],
"postprocessing": [
{
"tool": "outcrop",
"dream_command": "!fix \"test-pictures/curly.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -c top 64 right 64"
},
{
"tool": "gfpgan",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.outcrop-02.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -G 0.8"
},
{
"tool": "upscale",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.gfpgan.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -U 4.0 0.75"
}
],
"sampler": "k_lms",
"variations": [],
"type": "txt2img"
}
}
~~~
2022-10-03 20:53:12 +00:00
|
|
|
The `outcrop` extension allows you to extend the image in 64 pixel
|
|
|
|
increments in any dimension. You can apply the module to any image
|
|
|
|
previously-generated by InvokeAI. Note that it will **not** work with
|
|
|
|
arbitrary photographs or Stable Diffusion images created by other
|
|
|
|
implementations.
|
2022-09-21 06:53:08 +00:00
|
|
|
|
refactor how postprocessors work
- similar call structures for outpainting, outcropping and face restoration modules
- added documentation for outcropping
- post-processing steps now leave a provenance chain (of sorts) in the sd-metadata field:
~~~
scripts/sd-metadata.py outputs/img-samples/curly.942491079.upscale.png
outputs/img-samples/curly.942491079.upscale.png:
{
"model": "stable diffusion",
"model_id": "stable-diffusion-1.4",
"model_hash": "fe4efff1e174c627256e44ec2991ba279b3816e364b49f9be2abc0b3ff3f8556",
"app_id": "lstein/stable-diffusion",
"app_version": "v1.15",
"image": {
"height": 512,
"width": 512,
"steps": 50,
"cfg_scale": 7.5,
"seed": 942491079,
"prompt": [
{
"prompt": "pretty curly-haired redhead woman",
"weight": 1.0
}
],
"postprocessing": [
{
"tool": "outcrop",
"dream_command": "!fix \"test-pictures/curly.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -c top 64 right 64"
},
{
"tool": "gfpgan",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.outcrop-02.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -G 0.8"
},
{
"tool": "upscale",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.gfpgan.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -U 4.0 0.75"
}
],
"sampler": "k_lms",
"variations": [],
"type": "txt2img"
}
}
~~~
2022-10-03 20:53:12 +00:00
|
|
|
Consider this image:
|
2022-09-21 06:53:08 +00:00
|
|
|
|
refactor how postprocessors work
- similar call structures for outpainting, outcropping and face restoration modules
- added documentation for outcropping
- post-processing steps now leave a provenance chain (of sorts) in the sd-metadata field:
~~~
scripts/sd-metadata.py outputs/img-samples/curly.942491079.upscale.png
outputs/img-samples/curly.942491079.upscale.png:
{
"model": "stable diffusion",
"model_id": "stable-diffusion-1.4",
"model_hash": "fe4efff1e174c627256e44ec2991ba279b3816e364b49f9be2abc0b3ff3f8556",
"app_id": "lstein/stable-diffusion",
"app_version": "v1.15",
"image": {
"height": 512,
"width": 512,
"steps": 50,
"cfg_scale": 7.5,
"seed": 942491079,
"prompt": [
{
"prompt": "pretty curly-haired redhead woman",
"weight": 1.0
}
],
"postprocessing": [
{
"tool": "outcrop",
"dream_command": "!fix \"test-pictures/curly.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -c top 64 right 64"
},
{
"tool": "gfpgan",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.outcrop-02.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -G 0.8"
},
{
"tool": "upscale",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.gfpgan.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -U 4.0 0.75"
}
],
"sampler": "k_lms",
"variations": [],
"type": "txt2img"
}
}
~~~
2022-10-03 20:53:12 +00:00
|
|
|
![curly_woman](../assets/outpainting/curly.png)
|
|
|
|
|
|
|
|
Pretty nice, but it's annoying that the top of her head is cut
|
|
|
|
off. She's also a bit off center. Let's fix that!
|
2022-09-21 06:53:08 +00:00
|
|
|
|
|
|
|
~~~~
|
2022-10-08 13:32:06 +00:00
|
|
|
invoke> !fix images/curly.png --outcrop top 64 right 64
|
2022-09-21 06:53:08 +00:00
|
|
|
~~~~
|
|
|
|
|
refactor how postprocessors work
- similar call structures for outpainting, outcropping and face restoration modules
- added documentation for outcropping
- post-processing steps now leave a provenance chain (of sorts) in the sd-metadata field:
~~~
scripts/sd-metadata.py outputs/img-samples/curly.942491079.upscale.png
outputs/img-samples/curly.942491079.upscale.png:
{
"model": "stable diffusion",
"model_id": "stable-diffusion-1.4",
"model_hash": "fe4efff1e174c627256e44ec2991ba279b3816e364b49f9be2abc0b3ff3f8556",
"app_id": "lstein/stable-diffusion",
"app_version": "v1.15",
"image": {
"height": 512,
"width": 512,
"steps": 50,
"cfg_scale": 7.5,
"seed": 942491079,
"prompt": [
{
"prompt": "pretty curly-haired redhead woman",
"weight": 1.0
}
],
"postprocessing": [
{
"tool": "outcrop",
"dream_command": "!fix \"test-pictures/curly.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -c top 64 right 64"
},
{
"tool": "gfpgan",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.outcrop-02.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -G 0.8"
},
{
"tool": "upscale",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.gfpgan.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -U 4.0 0.75"
}
],
"sampler": "k_lms",
"variations": [],
"type": "txt2img"
}
}
~~~
2022-10-03 20:53:12 +00:00
|
|
|
This is saying to apply the `outcrop` extension by extending the top
|
|
|
|
of the image by 64 pixels, and the right of the image by the same
|
|
|
|
amount. You can use any combination of top|left|right|bottom, and
|
|
|
|
specify any number of pixels to extend. You can also abbreviate
|
|
|
|
`--outcrop` to `-c`.
|
2022-09-21 06:53:08 +00:00
|
|
|
|
refactor how postprocessors work
- similar call structures for outpainting, outcropping and face restoration modules
- added documentation for outcropping
- post-processing steps now leave a provenance chain (of sorts) in the sd-metadata field:
~~~
scripts/sd-metadata.py outputs/img-samples/curly.942491079.upscale.png
outputs/img-samples/curly.942491079.upscale.png:
{
"model": "stable diffusion",
"model_id": "stable-diffusion-1.4",
"model_hash": "fe4efff1e174c627256e44ec2991ba279b3816e364b49f9be2abc0b3ff3f8556",
"app_id": "lstein/stable-diffusion",
"app_version": "v1.15",
"image": {
"height": 512,
"width": 512,
"steps": 50,
"cfg_scale": 7.5,
"seed": 942491079,
"prompt": [
{
"prompt": "pretty curly-haired redhead woman",
"weight": 1.0
}
],
"postprocessing": [
{
"tool": "outcrop",
"dream_command": "!fix \"test-pictures/curly.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -c top 64 right 64"
},
{
"tool": "gfpgan",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.outcrop-02.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -G 0.8"
},
{
"tool": "upscale",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.gfpgan.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -U 4.0 0.75"
}
],
"sampler": "k_lms",
"variations": [],
"type": "txt2img"
}
}
~~~
2022-10-03 20:53:12 +00:00
|
|
|
The result looks like this:
|
2022-09-21 06:53:08 +00:00
|
|
|
|
refactor how postprocessors work
- similar call structures for outpainting, outcropping and face restoration modules
- added documentation for outcropping
- post-processing steps now leave a provenance chain (of sorts) in the sd-metadata field:
~~~
scripts/sd-metadata.py outputs/img-samples/curly.942491079.upscale.png
outputs/img-samples/curly.942491079.upscale.png:
{
"model": "stable diffusion",
"model_id": "stable-diffusion-1.4",
"model_hash": "fe4efff1e174c627256e44ec2991ba279b3816e364b49f9be2abc0b3ff3f8556",
"app_id": "lstein/stable-diffusion",
"app_version": "v1.15",
"image": {
"height": 512,
"width": 512,
"steps": 50,
"cfg_scale": 7.5,
"seed": 942491079,
"prompt": [
{
"prompt": "pretty curly-haired redhead woman",
"weight": 1.0
}
],
"postprocessing": [
{
"tool": "outcrop",
"dream_command": "!fix \"test-pictures/curly.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -c top 64 right 64"
},
{
"tool": "gfpgan",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.outcrop-02.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -G 0.8"
},
{
"tool": "upscale",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.gfpgan.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -U 4.0 0.75"
}
],
"sampler": "k_lms",
"variations": [],
"type": "txt2img"
}
}
~~~
2022-10-03 20:53:12 +00:00
|
|
|
![curly_woman_outcrop](../assets/outpainting/curly-outcrop.png)
|
2022-09-21 06:53:08 +00:00
|
|
|
|
refactor how postprocessors work
- similar call structures for outpainting, outcropping and face restoration modules
- added documentation for outcropping
- post-processing steps now leave a provenance chain (of sorts) in the sd-metadata field:
~~~
scripts/sd-metadata.py outputs/img-samples/curly.942491079.upscale.png
outputs/img-samples/curly.942491079.upscale.png:
{
"model": "stable diffusion",
"model_id": "stable-diffusion-1.4",
"model_hash": "fe4efff1e174c627256e44ec2991ba279b3816e364b49f9be2abc0b3ff3f8556",
"app_id": "lstein/stable-diffusion",
"app_version": "v1.15",
"image": {
"height": 512,
"width": 512,
"steps": 50,
"cfg_scale": 7.5,
"seed": 942491079,
"prompt": [
{
"prompt": "pretty curly-haired redhead woman",
"weight": 1.0
}
],
"postprocessing": [
{
"tool": "outcrop",
"dream_command": "!fix \"test-pictures/curly.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -c top 64 right 64"
},
{
"tool": "gfpgan",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.outcrop-02.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -G 0.8"
},
{
"tool": "upscale",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.gfpgan.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -U 4.0 0.75"
}
],
"sampler": "k_lms",
"variations": [],
"type": "txt2img"
}
}
~~~
2022-10-03 20:53:12 +00:00
|
|
|
The new image is actually slightly larger than the original (576x576,
|
|
|
|
because 64 pixels were added to the top and right sides.)
|
2022-09-21 06:53:08 +00:00
|
|
|
|
refactor how postprocessors work
- similar call structures for outpainting, outcropping and face restoration modules
- added documentation for outcropping
- post-processing steps now leave a provenance chain (of sorts) in the sd-metadata field:
~~~
scripts/sd-metadata.py outputs/img-samples/curly.942491079.upscale.png
outputs/img-samples/curly.942491079.upscale.png:
{
"model": "stable diffusion",
"model_id": "stable-diffusion-1.4",
"model_hash": "fe4efff1e174c627256e44ec2991ba279b3816e364b49f9be2abc0b3ff3f8556",
"app_id": "lstein/stable-diffusion",
"app_version": "v1.15",
"image": {
"height": 512,
"width": 512,
"steps": 50,
"cfg_scale": 7.5,
"seed": 942491079,
"prompt": [
{
"prompt": "pretty curly-haired redhead woman",
"weight": 1.0
}
],
"postprocessing": [
{
"tool": "outcrop",
"dream_command": "!fix \"test-pictures/curly.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -c top 64 right 64"
},
{
"tool": "gfpgan",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.outcrop-02.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -G 0.8"
},
{
"tool": "upscale",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.gfpgan.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -U 4.0 0.75"
}
],
"sampler": "k_lms",
"variations": [],
"type": "txt2img"
}
}
~~~
2022-10-03 20:53:12 +00:00
|
|
|
A number of caveats:
|
2022-09-21 06:53:08 +00:00
|
|
|
|
refactor how postprocessors work
- similar call structures for outpainting, outcropping and face restoration modules
- added documentation for outcropping
- post-processing steps now leave a provenance chain (of sorts) in the sd-metadata field:
~~~
scripts/sd-metadata.py outputs/img-samples/curly.942491079.upscale.png
outputs/img-samples/curly.942491079.upscale.png:
{
"model": "stable diffusion",
"model_id": "stable-diffusion-1.4",
"model_hash": "fe4efff1e174c627256e44ec2991ba279b3816e364b49f9be2abc0b3ff3f8556",
"app_id": "lstein/stable-diffusion",
"app_version": "v1.15",
"image": {
"height": 512,
"width": 512,
"steps": 50,
"cfg_scale": 7.5,
"seed": 942491079,
"prompt": [
{
"prompt": "pretty curly-haired redhead woman",
"weight": 1.0
}
],
"postprocessing": [
{
"tool": "outcrop",
"dream_command": "!fix \"test-pictures/curly.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -c top 64 right 64"
},
{
"tool": "gfpgan",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.outcrop-02.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -G 0.8"
},
{
"tool": "upscale",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.gfpgan.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -U 4.0 0.75"
}
],
"sampler": "k_lms",
"variations": [],
"type": "txt2img"
}
}
~~~
2022-10-03 20:53:12 +00:00
|
|
|
1. Although you can specify any pixel values, they will be rounded up
|
|
|
|
to the nearest multiple of 64. Smaller values are better. Larger
|
|
|
|
extensions are more likely to generate artefacts. However, if you wish
|
|
|
|
you can run the !fix command repeatedly to cautiously expand the
|
|
|
|
image.
|
2022-09-21 06:53:08 +00:00
|
|
|
|
refactor how postprocessors work
- similar call structures for outpainting, outcropping and face restoration modules
- added documentation for outcropping
- post-processing steps now leave a provenance chain (of sorts) in the sd-metadata field:
~~~
scripts/sd-metadata.py outputs/img-samples/curly.942491079.upscale.png
outputs/img-samples/curly.942491079.upscale.png:
{
"model": "stable diffusion",
"model_id": "stable-diffusion-1.4",
"model_hash": "fe4efff1e174c627256e44ec2991ba279b3816e364b49f9be2abc0b3ff3f8556",
"app_id": "lstein/stable-diffusion",
"app_version": "v1.15",
"image": {
"height": 512,
"width": 512,
"steps": 50,
"cfg_scale": 7.5,
"seed": 942491079,
"prompt": [
{
"prompt": "pretty curly-haired redhead woman",
"weight": 1.0
}
],
"postprocessing": [
{
"tool": "outcrop",
"dream_command": "!fix \"test-pictures/curly.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -c top 64 right 64"
},
{
"tool": "gfpgan",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.outcrop-02.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -G 0.8"
},
{
"tool": "upscale",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.gfpgan.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -U 4.0 0.75"
}
],
"sampler": "k_lms",
"variations": [],
"type": "txt2img"
}
}
~~~
2022-10-03 20:53:12 +00:00
|
|
|
2. The extension is stochastic, meaning that each time you run it
|
|
|
|
you'll get a slightly different result. You can run it repeatedly
|
|
|
|
until you get an image you like. Unfortunately `!fix` does not
|
|
|
|
currently respect the `-n` (`--iterations`) argument.
|
2022-09-21 06:53:08 +00:00
|
|
|
|
refactor how postprocessors work
- similar call structures for outpainting, outcropping and face restoration modules
- added documentation for outcropping
- post-processing steps now leave a provenance chain (of sorts) in the sd-metadata field:
~~~
scripts/sd-metadata.py outputs/img-samples/curly.942491079.upscale.png
outputs/img-samples/curly.942491079.upscale.png:
{
"model": "stable diffusion",
"model_id": "stable-diffusion-1.4",
"model_hash": "fe4efff1e174c627256e44ec2991ba279b3816e364b49f9be2abc0b3ff3f8556",
"app_id": "lstein/stable-diffusion",
"app_version": "v1.15",
"image": {
"height": 512,
"width": 512,
"steps": 50,
"cfg_scale": 7.5,
"seed": 942491079,
"prompt": [
{
"prompt": "pretty curly-haired redhead woman",
"weight": 1.0
}
],
"postprocessing": [
{
"tool": "outcrop",
"dream_command": "!fix \"test-pictures/curly.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -c top 64 right 64"
},
{
"tool": "gfpgan",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.outcrop-02.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -G 0.8"
},
{
"tool": "upscale",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.gfpgan.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -U 4.0 0.75"
}
],
"sampler": "k_lms",
"variations": [],
"type": "txt2img"
}
}
~~~
2022-10-03 20:53:12 +00:00
|
|
|
## Outpaint
|
2022-09-21 06:53:08 +00:00
|
|
|
|
refactor how postprocessors work
- similar call structures for outpainting, outcropping and face restoration modules
- added documentation for outcropping
- post-processing steps now leave a provenance chain (of sorts) in the sd-metadata field:
~~~
scripts/sd-metadata.py outputs/img-samples/curly.942491079.upscale.png
outputs/img-samples/curly.942491079.upscale.png:
{
"model": "stable diffusion",
"model_id": "stable-diffusion-1.4",
"model_hash": "fe4efff1e174c627256e44ec2991ba279b3816e364b49f9be2abc0b3ff3f8556",
"app_id": "lstein/stable-diffusion",
"app_version": "v1.15",
"image": {
"height": 512,
"width": 512,
"steps": 50,
"cfg_scale": 7.5,
"seed": 942491079,
"prompt": [
{
"prompt": "pretty curly-haired redhead woman",
"weight": 1.0
}
],
"postprocessing": [
{
"tool": "outcrop",
"dream_command": "!fix \"test-pictures/curly.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -c top 64 right 64"
},
{
"tool": "gfpgan",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.outcrop-02.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -G 0.8"
},
{
"tool": "upscale",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.gfpgan.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -U 4.0 0.75"
}
],
"sampler": "k_lms",
"variations": [],
"type": "txt2img"
}
}
~~~
2022-10-03 20:53:12 +00:00
|
|
|
The `outpaint` extension does the same thing, but with subtle
|
|
|
|
differences. Starting with the same image, here is how we would add an
|
|
|
|
additional 64 pixels to the top of the image:
|
2022-09-21 06:53:08 +00:00
|
|
|
|
refactor how postprocessors work
- similar call structures for outpainting, outcropping and face restoration modules
- added documentation for outcropping
- post-processing steps now leave a provenance chain (of sorts) in the sd-metadata field:
~~~
scripts/sd-metadata.py outputs/img-samples/curly.942491079.upscale.png
outputs/img-samples/curly.942491079.upscale.png:
{
"model": "stable diffusion",
"model_id": "stable-diffusion-1.4",
"model_hash": "fe4efff1e174c627256e44ec2991ba279b3816e364b49f9be2abc0b3ff3f8556",
"app_id": "lstein/stable-diffusion",
"app_version": "v1.15",
"image": {
"height": 512,
"width": 512,
"steps": 50,
"cfg_scale": 7.5,
"seed": 942491079,
"prompt": [
{
"prompt": "pretty curly-haired redhead woman",
"weight": 1.0
}
],
"postprocessing": [
{
"tool": "outcrop",
"dream_command": "!fix \"test-pictures/curly.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -c top 64 right 64"
},
{
"tool": "gfpgan",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.outcrop-02.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -G 0.8"
},
{
"tool": "upscale",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.gfpgan.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -U 4.0 0.75"
}
],
"sampler": "k_lms",
"variations": [],
"type": "txt2img"
}
}
~~~
2022-10-03 20:53:12 +00:00
|
|
|
~~~
|
2022-10-08 13:32:06 +00:00
|
|
|
invoke> !fix images/curly.png --out_direction top 64
|
refactor how postprocessors work
- similar call structures for outpainting, outcropping and face restoration modules
- added documentation for outcropping
- post-processing steps now leave a provenance chain (of sorts) in the sd-metadata field:
~~~
scripts/sd-metadata.py outputs/img-samples/curly.942491079.upscale.png
outputs/img-samples/curly.942491079.upscale.png:
{
"model": "stable diffusion",
"model_id": "stable-diffusion-1.4",
"model_hash": "fe4efff1e174c627256e44ec2991ba279b3816e364b49f9be2abc0b3ff3f8556",
"app_id": "lstein/stable-diffusion",
"app_version": "v1.15",
"image": {
"height": 512,
"width": 512,
"steps": 50,
"cfg_scale": 7.5,
"seed": 942491079,
"prompt": [
{
"prompt": "pretty curly-haired redhead woman",
"weight": 1.0
}
],
"postprocessing": [
{
"tool": "outcrop",
"dream_command": "!fix \"test-pictures/curly.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -c top 64 right 64"
},
{
"tool": "gfpgan",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.outcrop-02.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -G 0.8"
},
{
"tool": "upscale",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.gfpgan.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -U 4.0 0.75"
}
],
"sampler": "k_lms",
"variations": [],
"type": "txt2img"
}
}
~~~
2022-10-03 20:53:12 +00:00
|
|
|
~~~
|
2022-09-21 06:53:08 +00:00
|
|
|
|
2022-10-09 22:46:23 +00:00
|
|
|
(you can abbreviate `--out_direction` as `-D`.
|
2022-09-21 06:53:08 +00:00
|
|
|
|
refactor how postprocessors work
- similar call structures for outpainting, outcropping and face restoration modules
- added documentation for outcropping
- post-processing steps now leave a provenance chain (of sorts) in the sd-metadata field:
~~~
scripts/sd-metadata.py outputs/img-samples/curly.942491079.upscale.png
outputs/img-samples/curly.942491079.upscale.png:
{
"model": "stable diffusion",
"model_id": "stable-diffusion-1.4",
"model_hash": "fe4efff1e174c627256e44ec2991ba279b3816e364b49f9be2abc0b3ff3f8556",
"app_id": "lstein/stable-diffusion",
"app_version": "v1.15",
"image": {
"height": 512,
"width": 512,
"steps": 50,
"cfg_scale": 7.5,
"seed": 942491079,
"prompt": [
{
"prompt": "pretty curly-haired redhead woman",
"weight": 1.0
}
],
"postprocessing": [
{
"tool": "outcrop",
"dream_command": "!fix \"test-pictures/curly.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -c top 64 right 64"
},
{
"tool": "gfpgan",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.outcrop-02.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -G 0.8"
},
{
"tool": "upscale",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.gfpgan.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -U 4.0 0.75"
}
],
"sampler": "k_lms",
"variations": [],
"type": "txt2img"
}
}
~~~
2022-10-03 20:53:12 +00:00
|
|
|
The result is shown here:
|
2022-09-21 06:53:08 +00:00
|
|
|
|
refactor how postprocessors work
- similar call structures for outpainting, outcropping and face restoration modules
- added documentation for outcropping
- post-processing steps now leave a provenance chain (of sorts) in the sd-metadata field:
~~~
scripts/sd-metadata.py outputs/img-samples/curly.942491079.upscale.png
outputs/img-samples/curly.942491079.upscale.png:
{
"model": "stable diffusion",
"model_id": "stable-diffusion-1.4",
"model_hash": "fe4efff1e174c627256e44ec2991ba279b3816e364b49f9be2abc0b3ff3f8556",
"app_id": "lstein/stable-diffusion",
"app_version": "v1.15",
"image": {
"height": 512,
"width": 512,
"steps": 50,
"cfg_scale": 7.5,
"seed": 942491079,
"prompt": [
{
"prompt": "pretty curly-haired redhead woman",
"weight": 1.0
}
],
"postprocessing": [
{
"tool": "outcrop",
"dream_command": "!fix \"test-pictures/curly.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -c top 64 right 64"
},
{
"tool": "gfpgan",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.outcrop-02.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -G 0.8"
},
{
"tool": "upscale",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.gfpgan.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -U 4.0 0.75"
}
],
"sampler": "k_lms",
"variations": [],
"type": "txt2img"
}
}
~~~
2022-10-03 20:53:12 +00:00
|
|
|
![curly_woman_outpaint](../assets/outpainting/curly-outpaint.png)
|
2022-09-21 06:53:08 +00:00
|
|
|
|
refactor how postprocessors work
- similar call structures for outpainting, outcropping and face restoration modules
- added documentation for outcropping
- post-processing steps now leave a provenance chain (of sorts) in the sd-metadata field:
~~~
scripts/sd-metadata.py outputs/img-samples/curly.942491079.upscale.png
outputs/img-samples/curly.942491079.upscale.png:
{
"model": "stable diffusion",
"model_id": "stable-diffusion-1.4",
"model_hash": "fe4efff1e174c627256e44ec2991ba279b3816e364b49f9be2abc0b3ff3f8556",
"app_id": "lstein/stable-diffusion",
"app_version": "v1.15",
"image": {
"height": 512,
"width": 512,
"steps": 50,
"cfg_scale": 7.5,
"seed": 942491079,
"prompt": [
{
"prompt": "pretty curly-haired redhead woman",
"weight": 1.0
}
],
"postprocessing": [
{
"tool": "outcrop",
"dream_command": "!fix \"test-pictures/curly.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -c top 64 right 64"
},
{
"tool": "gfpgan",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.outcrop-02.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -G 0.8"
},
{
"tool": "upscale",
"dream_command": "!fix \"outputs/img-samples/curly.942491079.gfpgan.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -U 4.0 0.75"
}
],
"sampler": "k_lms",
"variations": [],
"type": "txt2img"
}
}
~~~
2022-10-03 20:53:12 +00:00
|
|
|
Although the effect is similar, there are significant differences from
|
|
|
|
outcropping:
|
|
|
|
|
|
|
|
1. You can only specify one direction to extend at a time.
|
|
|
|
2. The image is **not** resized. Instead, the image is shifted by the specified
|
|
|
|
number of pixels. If you look carefully, you'll see that less of the lady's
|
|
|
|
torso is visible in the image.
|
|
|
|
3. Because the image dimensions remain the same, there's no rounding
|
|
|
|
to multiples of 64.
|
|
|
|
4. Attempting to outpaint larger areas will frequently give rise to ugly
|
|
|
|
ghosting effects.
|
|
|
|
5. For best results, try increasing the step number.
|
|
|
|
6. If you don't specify a pixel value in -D, it will default to half
|
|
|
|
of the whole image, which is likely not what you want.
|
|
|
|
|
|
|
|
Neither `outpaint` nor `outcrop` are perfect, but we continue to tune
|
|
|
|
and improve them. If one doesn't work, try the other. You may also
|
|
|
|
wish to experiment with other `img2img` arguments, such as `-C`, `-f`
|
|
|
|
and `-s`.
|
2022-09-21 06:53:08 +00:00
|
|
|
|