mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Prevent indexing error for mode RGB
I have not explicitly tested mode P
This commit is contained in:
parent
e4a212dfca
commit
c2fab45a6e
@ -965,6 +965,8 @@ class Generate:
|
||||
# Obtain the mask from the transparency channel
|
||||
if mask_image.mode == 'L':
|
||||
mask = mask_image
|
||||
elif mask_image.mode in ('RGB', 'P'):
|
||||
mask = mask_image.convert('L')
|
||||
else:
|
||||
# Obtain the mask from the transparency channel
|
||||
mask = Image.new(mode="L", size=mask_image.size, color=255)
|
||||
|
Loading…
Reference in New Issue
Block a user