Skip to content

Commit 7bd8581

Browse files
authored
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.
1 parent 99d728b commit 7bd8581

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/img2img.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ def img2img(mode: int, prompt: str, negative_prompt: str, prompt_style: str, pro
8080
mask = None
8181

8282
# Use the EXIF orientation of photos taken by smartphones.
83-
image = ImageOps.exif_transpose(image)
83+
if image is not None:
84+
image = ImageOps.exif_transpose(image)
8485

8586
assert 0. <= denoising_strength <= 1., 'can only work with strength in [0.0, 1.0]'
8687

0 commit comments

Comments
 (0)