Skip to content

Commit

Permalink
fix mask format
Browse files Browse the repository at this point in the history
  • Loading branch information
light-and-ray committed Feb 14, 2024
1 parent 6c363db commit aa8e033
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lama_cleaner_masked_content/inpaint.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ def convertIntoCNMaskedImageFromat(image, mask):
except ImportError as e:
raise Exception("Controlnet is not installed for 'Lama Cleaner'")

color = g_cn_HWC3(np.asarray(image))
alpha = g_cn_HWC3(np.asarray(mask))[:, :, 0:1]
color = g_cn_HWC3(np.asarray(image).astype(np.uint8))
alpha = g_cn_HWC3(np.asarray(mask.convert('L')).astype(np.uint8))[:, :, 0:1]
image = np.concatenate([color, alpha], axis=2)
return image

Expand Down

0 comments on commit aa8e033

Please sign in to comment.