aboutsummaryrefslogtreecommitdiff
path: root/modules/img2img.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-04-29 17:02:14 +0300
committerGitHub <noreply@github.com>2023-04-29 17:02:14 +0300
commit3894609b52cb21d8974387bf6bb4b734e3296b4a (patch)
treec17a740c559e6dfc7d86dcfad07675522d315037 /modules/img2img.py
parent9a4e650800adc444c07a48572a958a71c2144c15 (diff)
parent17cce456133bf22c83cb379c0179e8b0daaa21e4 (diff)
Merge branch 'dev' into master
Diffstat (limited to 'modules/img2img.py')
-rw-r--r--modules/img2img.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/img2img.py b/modules/img2img.py
index 953ac5d2..603912ea 100644
--- a/modules/img2img.py
+++ b/modules/img2img.py
@@ -4,7 +4,7 @@ import sys
import traceback
import numpy as np
-from PIL import Image, ImageOps, ImageFilter, ImageEnhance, ImageChops
+from PIL import Image, ImageOps, ImageFilter, ImageEnhance, ImageChops, UnidentifiedImageError
from modules import devices, sd_samplers
from modules.generation_parameters_copypaste import create_override_settings_dict
@@ -46,7 +46,10 @@ def process_batch(p, input_dir, output_dir, inpaint_mask_dir, args):
if state.interrupted:
break
- img = Image.open(image)
+ try:
+ img = Image.open(image)
+ except UnidentifiedImageError:
+ continue
# Use the EXIF orientation of photos taken by smartphones.
img = ImageOps.exif_transpose(img)
p.init_images = [img] * p.batch_size
@@ -151,7 +154,7 @@ def img2img(id_task: str, mode: int, prompt: str, negative_prompt: str, prompt_s
override_settings=override_settings,
)
- p.scripts = modules.scripts.scripts_txt2img
+ p.scripts = modules.scripts.scripts_img2img
p.script_args = args
if shared.cmd_opts.enable_console_prompts: