diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2022-11-06 08:27:54 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-06 08:27:54 +0000 |
commit | 07d1bd426722b4c53b38ff682c5aab53177d8530 (patch) | |
tree | 4fdad803a4536cec2bd3e622c5f4cfb980f04550 /modules/img2img.py | |
parent | 3f3d14afd5abd07d3843370dc1c28be299dbdbab (diff) | |
parent | 6e4de5b4422dfc0d45063b2c8c78b19f00321615 (diff) | |
download | stable-diffusion-webui-gfx803-07d1bd426722b4c53b38ff682c5aab53177d8530.tar.gz stable-diffusion-webui-gfx803-07d1bd426722b4c53b38ff682c5aab53177d8530.tar.bz2 stable-diffusion-webui-gfx803-07d1bd426722b4c53b38ff682c5aab53177d8530.zip |
Merge branch 'master' into roy.add_simple_interrogate_api
Diffstat (limited to 'modules/img2img.py')
-rw-r--r-- | modules/img2img.py | 6 |
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()
|