Don't attempt mask restoration when there is no mask given (#1186)

This commit is contained in:
Chris Heald 2022-09-16 13:56:09 -07:00 committed by GitHub
parent b856a91ec8
commit d22cf56395
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -291,7 +291,7 @@ def img2img(prompt: str = '', init_info: any = None, init_info_mask: any = None,
correction_target,
channel_axis=2
), cv2.COLOR_LAB2RGB).astype("uint8"))
if mask_restore is True:
if mask_restore is True and init_mask is not None:
color_mask = init_mask.filter(ImageFilter.GaussianBlur(mask_blur_strength))
color_mask = color_mask.convert('L')
source_image = input_image.convert('RGB')