This commit is contained in:
Saquib Alam 2023-08-08 20:55:17 +05:30 committed by GitHub
parent ee6c3b3587
commit 56a5ddd842
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1439,19 +1439,19 @@ class ImageAlphaComposite:
def INPUT_TYPES(s): def INPUT_TYPES(s):
return {"required": { "image1": ("IMAGE",), return {"required": { "image1": ("IMAGE",),
"mask1": ("MASK",), "mask1": ("MASK",),
"image2": ("IMAGE",), "image2": ("IMAGE",)),
"mask2": ("MASK", {"default": None}),
} }
} }
CATEGORY = "image" CATEGORY = "image"
RETURN_TYPES = ("IMAGE", "MASK") RETURN_TYPES = ("IMAGE",)
FUNCTION = "alpha_composite" FUNCTION = "alpha_composite"
def alpha_composite(self, image1, mask1, image2, mask2): def alpha_composite(self, image1, mask1, image2):
mask1 = mask1.repeat((1, 1, 1, 3))
print(image1.size(), mask1.size()) print(image1.size(), mask1.size())
image = image1 * mask1 image = image1 * mask1
return (image, mask1) return (image,)
class ImageScaleBy: class ImageScaleBy:
upscale_methods = ["nearest-exact", "bilinear", "area", "bicubic"] upscale_methods = ["nearest-exact", "bilinear", "area", "bicubic"]