mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Fix error when init_mask=None and invert_mask=True
In the event where no `init_mask` is given and `invert_mask` is set to True, the script will raise the following error: ```bash AttributeError: 'NoneType' object has no attribute 'mode' ``` The new implementation will only run inversion when both variables are valid.
This commit is contained in:
parent
0bc4ed14cd
commit
d2026d0509
@ -757,7 +757,7 @@ class Generate:
|
||||
elif text_mask:
|
||||
init_mask = self._txt2mask(image, text_mask, width, height, fit=fit)
|
||||
|
||||
if invert_mask:
|
||||
if init_mask and invert_mask:
|
||||
init_mask = ImageOps.invert(init_mask)
|
||||
|
||||
return init_image,init_mask
|
||||
|
Loading…
Reference in New Issue
Block a user