diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-08-24 10:42:21 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-08-24 10:42:21 +0000 |
commit | 852baf422ad86e406e0fa999c2f340bfd6a272d2 (patch) | |
tree | ef0fa270272caa4fda929b181087ba30225d0496 /webui.py | |
parent | ca0d7981a058158175166afe20e3a60bb081a964 (diff) | |
download | stable-diffusion-webui-gfx803-852baf422ad86e406e0fa999c2f340bfd6a272d2.tar.gz stable-diffusion-webui-gfx803-852baf422ad86e406e0fa999c2f340bfd6a272d2.tar.bz2 stable-diffusion-webui-gfx803-852baf422ad86e406e0fa999c2f340bfd6a272d2.zip |
gfpgan dir for the guide's directory names
fix a bug in image resizing
Diffstat (limited to 'webui.py')
-rw-r--r-- | webui.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -45,7 +45,7 @@ parser.add_argument("--n_rows", type=int, default=-1, help="rows in the grid; us parser.add_argument("--config", type=str, default="configs/stable-diffusion/v1-inference.yaml", help="path to config which constructs model",)
parser.add_argument("--ckpt", type=str, default="models/ldm/stable-diffusion-v1/model.ckpt", help="path to checkpoint of model",)
parser.add_argument("--precision", type=str, help="evaluate at this precision", choices=["full", "autocast"], default="autocast")
-parser.add_argument("--gfpgan-dir", type=str, help="GFPGAN directory", default='./GFPGAN')
+parser.add_argument("--gfpgan-dir", type=str, help="GFPGAN directory", default=('./src/gfpgan' if os.path.exists('./src/gfpgan') else './GFPGAN')) # i disagree with where you're putting it but since all guidefags are doing it this way, there you go
parser.add_argument("--no-verify-input", action='store_true', help="do not verify input to check if it's too long")
parser.add_argument("--no-half", action='store_true', help="do not switch the model to 16-bit floats")
parser.add_argument("--no-progressbar-hiding", action='store_true', help="do not hide progressbar in gradio UI (we hide it because it slows down ML if you have hardware accleration in browser)")
@@ -269,7 +269,7 @@ def resize_image(resize_mode, im, width, height): fill_height = height // 2 - src_h // 2
res.paste(resized.resize((width, fill_height), box=(0, 0, width, 0)), box=(0, 0))
res.paste(resized.resize((width, fill_height), box=(0, resized.height, width, resized.height)), box=(0, fill_height + src_h))
- else:
+ elif ratio > src_ratio:
fill_width = width // 2 - src_w // 2
res.paste(resized.resize((fill_width, height), box=(0, 0, 0, height)), box=(0, 0))
res.paste(resized.resize((fill_width, height), box=(resized.width, 0, resized.width, height)), box=(fill_width + src_w, 0))
|