This commit is contained in:
Saquib Alam 2023-08-08 21:01:30 +05:30 committed by GitHub
parent fd61a28a9c
commit fcd94aa043
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1438,7 +1438,7 @@ class ImageAlphaComposite:
@classmethod @classmethod
def INPUT_TYPES(s): def INPUT_TYPES(s):
return {"required": { "image1": ("IMAGE",), return {"required": { "image1": ("IMAGE",),
"mask1": ("MASK",), "mask": ("MASK",),
"image2": ("IMAGE",) "image2": ("IMAGE",)
} }
} }
@ -1447,8 +1447,12 @@ class ImageAlphaComposite:
RETURN_TYPES = ("IMAGE",) RETURN_TYPES = ("IMAGE",)
FUNCTION = "alpha_composite" FUNCTION = "alpha_composite"
def alpha_composite(self, image1, mask1, image2): def alpha_composite(self, image1, mask, image2):
mask1 = mask1.repeat((1, 1, 1, 3)) mask1 = torch.ones_like(image1)
mask1[0, :, :, 0] = mask
mask1[0, :, :, 1] = mask
mask1[0, :, :, 2] = mask
print(image1.size(), mask1.size()) print(image1.size(), mask1.size())
image = image1 * mask1 image = image1 * mask1
return (image,) return (image,)