aboutsummaryrefslogtreecommitdiff
path: root/modules/img2img.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-01-28 17:31:39 +0300
committerGitHub <noreply@github.com>2023-01-28 17:31:39 +0300
commitcd7e8fb42b447efa77319aa8931cf5f5e65c418e (patch)
tree177e7be7cef0b9ef5499272e8d08c87c716a52e2 /modules/img2img.py
parentb7d2af8c7fa48d6eef7517a6fbc63a3507c638d4 (diff)
parent1421e959600e0e9a2435e48373a551237bbab814 (diff)
Merge pull request #7319 from Thurion/img2img_batch_fix
Fix error when using img2img batch without masks
Diffstat (limited to 'modules/img2img.py')
-rw-r--r--modules/img2img.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/img2img.py b/modules/img2img.py
index fe9447c7..3ecb6146 100644
--- a/modules/img2img.py
+++ b/modules/img2img.py
@@ -21,8 +21,10 @@ def process_batch(p, input_dir, output_dir, inpaint_mask_dir, args):
images = shared.listfiles(input_dir)
- inpaint_masks = shared.listfiles(inpaint_mask_dir)
- is_inpaint_batch = inpaint_mask_dir and len(inpaint_masks) > 0
+ is_inpaint_batch = False
+ if inpaint_mask_dir:
+ inpaint_masks = shared.listfiles(inpaint_mask_dir)
+ is_inpaint_batch = len(inpaint_masks) > 0
if is_inpaint_batch:
print(f"\nInpaint batch is enabled. {len(inpaint_masks)} masks found.")