diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-09-07 16:22:45 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-09-07 16:22:45 +0000 |
commit | 795d49aa24846425e0c0ef3caf068d097dc39cbc (patch) | |
tree | 8a7495b74df843e2dc72525c38ba2830644925a3 | |
parent | e92d4cf7476f1897fce376916dfb40755ea7920f (diff) | |
download | stable-diffusion-webui-gfx803-795d49aa24846425e0c0ef3caf068d097dc39cbc.tar.gz stable-diffusion-webui-gfx803-795d49aa24846425e0c0ef3caf068d097dc39cbc.tar.bz2 stable-diffusion-webui-gfx803-795d49aa24846425e0c0ef3caf068d097dc39cbc.zip |
MAde poor man's outpainting do less extra useless work.
-rw-r--r-- | scripts/poor_mans_outpainting.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/poor_mans_outpainting.py b/scripts/poor_mans_outpainting.py index a549fde3..c029c67f 100644 --- a/scripts/poor_mans_outpainting.py +++ b/scripts/poor_mans_outpainting.py @@ -47,11 +47,14 @@ class Script(scripts.Script): if left > 0:
left = left * (target_w - init_img.width) // (left + right)
- right = target_w - init_img.width - left
+ if right > 0:
+ right = target_w - init_img.width - left
if up > 0:
up = up * (target_h - init_img.height) // (up + down)
- down = target_h - init_img.height - up
+
+ if down > 0:
+ down = target_h - init_img.height - up
img = Image.new("RGB", (target_w, target_h))
img.paste(init_img, (left, up))
|