aboutsummaryrefslogtreecommitdiff
path: root/modules/img2img.py
diff options
context:
space:
mode:
authorBilly Cao <aliencaocao@gmail.com>2022-11-06 16:33:08 +0800
committerGitHub <noreply@github.com>2022-11-06 16:33:08 +0800
commitc13e234444e98d112e9fe99d518c834edeb79471 (patch)
tree8dfa10582dccb75685b4dd3ee28d1d48c0a6f595 /modules/img2img.py
parent55ca04095845b41bf66333b3b7343e3ea0babed1 (diff)
parent5302e2cdd4c8f039a68e900d739285d15d99d200 (diff)
Merge branch 'master' into enable-override-hypernet
Diffstat (limited to 'modules/img2img.py')
-rw-r--r--modules/img2img.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/img2img.py b/modules/img2img.py
index 35c5df9b..be9f3653 100644
--- a/modules/img2img.py
+++ b/modules/img2img.py
@@ -81,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]'
@@ -137,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()