aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorSihan Wang <31711261+shwang95@users.noreply.github.com>2022-10-26 20:32:55 +0800
committerGitHub <noreply@github.com>2022-10-26 20:32:55 +0800
commit7bd8581e461623932ffbd5762ee931ee51f798db (patch)
tree7f7a52e653d5326b7a958ed172f61a334063ea68 /modules
parent99d728b5b18829c8a6b7b2d69c9b9327dd257896 (diff)
Fix error caused by EXIF transpose when using custom scripts
Some custom scripts read image directly and no need to select image in UI, this will cause error.
Diffstat (limited to 'modules')
-rw-r--r--modules/img2img.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/img2img.py b/modules/img2img.py
index 9c0cf23e..86a19f37 100644
--- a/modules/img2img.py
+++ b/modules/img2img.py
@@ -80,7 +80,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]'