Fix for older python.

from: https://github.com/comfyanonymous/ComfyUI/discussions/476
This commit is contained in:
comfyanonymous 2023-04-15 10:56:15 -04:00
parent 2525fcd342
commit 476d543fe8
1 changed files with 6 additions and 7 deletions

View File

@ -187,13 +187,12 @@ class MaskComposite:
source_portion = source[:visible_height, :visible_width]
destination_portion = destination[top:bottom, left:right]
match operation:
case "multiply":
output[top:bottom, left:right] = destination_portion * source_portion
case "add":
output[top:bottom, left:right] = destination_portion + source_portion
case "subtract":
output[top:bottom, left:right] = destination_portion - source_portion
if operation == "multiply":
output[top:bottom, left:right] = destination_portion * source_portion
elif operation == "add":
output[top:bottom, left:right] = destination_portion + source_portion
elif operation == "subtract":
output[top:bottom, left:right] = destination_portion - source_portion
output = torch.clamp(output, 0.0, 1.0)