mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-04-13 11:53:31 +00:00
Fix alpha channel mismatch on destination in ImageCompositeMasked
This commit is contained in:
parent
0b4584c741
commit
548457bac4
@ -89,6 +89,9 @@ class ImageCompositeMasked:
|
||||
def composite(self, destination, source, x, y, resize_source, mask = None):
|
||||
if destination.shape[-1] < source.shape[-1]:
|
||||
source = source[...,:destination.shape[-1]]
|
||||
elif destination.shape[-1] > source.shape[-1]:
|
||||
destination = torch.nn.functional.pad(destination, (0, 1))
|
||||
destination[..., -1] = source[..., -1]
|
||||
destination = destination.clone().movedim(-1, 1)
|
||||
output = composite(destination, source.movedim(-1, 1), x, y, mask, 1, resize_source).movedim(1, -1)
|
||||
return (output,)
|
||||
|
Loading…
Reference in New Issue
Block a user