diff options
author | random-thoughtss <116161560+random-thoughtss@users.noreply.github.com> | 2022-11-03 22:55:54 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-03 22:55:54 +0000 |
commit | 243253ff4a8ae944ba142abe9c1e78a92dd14ebe (patch) | |
tree | c40402e18a29ca9a9b167a2f9e47dab39dce0943 /modules/img2img.py | |
parent | d9e4e4d7a09d4aee8ce249a3c8e91ce165b10fa5 (diff) | |
parent | 20a860b525cb7a319a42994f75a94bbca9a54d89 (diff) | |
download | stable-diffusion-webui-gfx803-243253ff4a8ae944ba142abe9c1e78a92dd14ebe.tar.gz stable-diffusion-webui-gfx803-243253ff4a8ae944ba142abe9c1e78a92dd14ebe.tar.bz2 stable-diffusion-webui-gfx803-243253ff4a8ae944ba142abe9c1e78a92dd14ebe.zip |
Merge branch 'AUTOMATIC1111:master' into master
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()
|