aboutsummaryrefslogtreecommitdiff
path: root/modules/img2img.py
diff options
context:
space:
mode:
authorrandom-thoughtss <116161560+random-thoughtss@users.noreply.github.com>2022-11-03 15:55:54 -0700
committerGitHub <noreply@github.com>2022-11-03 15:55:54 -0700
commit243253ff4a8ae944ba142abe9c1e78a92dd14ebe (patch)
treec40402e18a29ca9a9b167a2f9e47dab39dce0943 /modules/img2img.py
parentd9e4e4d7a09d4aee8ce249a3c8e91ce165b10fa5 (diff)
parent20a860b525cb7a319a42994f75a94bbca9a54d89 (diff)
Merge branch 'AUTOMATIC1111:master' into master
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()