Skip to content

Commit d22cf56

Browse files
authored
Don't attempt mask restoration when there is no mask given (#1186)
1 parent b856a91 commit d22cf56

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/img2img.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def sample(init_data, x, conditioning, unconditional_conditioning, sampler_name)
291291
correction_target,
292292
channel_axis=2
293293
), cv2.COLOR_LAB2RGB).astype("uint8"))
294-
if mask_restore is True:
294+
if mask_restore is True and init_mask is not None:
295295
color_mask = init_mask.filter(ImageFilter.GaussianBlur(mask_blur_strength))
296296
color_mask = color_mask.convert('L')
297297
source_image = input_image.convert('RGB')

0 commit comments

Comments
 (0)