aboutsummaryrefslogtreecommitdiff
path: root/modules/img2img.py
diff options
context:
space:
mode:
authorBilly Cao <aliencaocao@gmail.com>2022-11-03 13:08:26 +0800
committerGitHub <noreply@github.com>2022-11-03 13:08:26 +0800
commit688aa2c9c1ce6cf65c43b6113411a185e294412b (patch)
tree32514b496717c3375988e180d51daa608b045e60 /modules/img2img.py
parentfb1374791bf4b4c9b49de5378f29b12fdabcac97 (diff)
parentd98eacea40c7a40227f36dbea9cf92f90489310b (diff)
Merge branch 'AUTOMATIC1111:master' into fix_nowebui_arg
Diffstat (limited to 'modules/img2img.py')
-rw-r--r--modules/img2img.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/img2img.py b/modules/img2img.py
index efda26e1..be9f3653 100644
--- a/modules/img2img.py
+++ b/modules/img2img.py
@@ -55,6 +55,7 @@ def process_batch(p, input_dir, output_dir, args):
filename = f"{left}-{n}{right}"
if not save_normally:
+ os.makedirs(output_dir, exist_ok=True)
processed_image.save(os.path.join(output_dir, filename))
@@ -80,7 +81,8 @@ def img2img(mode: int, prompt: str, negative_prompt: str, prompt_style: str, pro
mask = None
# Use the EXIF orientation of photos taken by smartphones.
- image = ImageOps.exif_transpose(image)
+ if image is not None:
+ image = ImageOps.exif_transpose(image)
assert 0. <= denoising_strength <= 1., 'can only work with strength in [0.0, 1.0]'
@@ -136,6 +138,8 @@ def img2img(mode: int, prompt: str, negative_prompt: str, prompt_style: str, pro
if processed is None:
processed = process_images(p)
+ p.close()
+
shared.total_tqdm.clear()
generation_info_js = processed.js()