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] source_portion = source[:visible_height, :visible_width]
destination_portion = destination[top:bottom, left:right] destination_portion = destination[top:bottom, left:right]
match operation: if operation == "multiply":
case "multiply": output[top:bottom, left:right] = destination_portion * source_portion
output[top:bottom, left:right] = destination_portion * source_portion elif operation == "add":
case "add": output[top:bottom, left:right] = destination_portion + source_portion
output[top:bottom, left:right] = destination_portion + source_portion elif operation == "subtract":
case "subtract": output[top:bottom, left:right] = destination_portion - source_portion
output[top:bottom, left:right] = destination_portion - source_portion
output = torch.clamp(output, 0.0, 1.0) output = torch.clamp(output, 0.0, 1.0)