We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c3a6a6f commit e6a512aCopy full SHA for e6a512a
invokeai/app/invocations/mask.py
@@ -138,8 +138,7 @@ def invoke(self, context: InvocationContext) -> ImageOutput:
138
# Ensure that the mask is binary.
139
if mask.dtype != torch.bool:
140
mask = mask > 0.5
141
- mask_np = mask.float().cpu().detach().numpy() * 255
142
- mask_np = mask_np.astype(np.uint8)
+ mask_np = (mask.float() * 255).byte().cpu().numpy()
143
144
mask_pil = Image.fromarray(mask_np, mode="L")
145
image_dto = context.images.save(image=mask_pil)
0 commit comments