Fix for older python.
from: https://github.com/comfyanonymous/ComfyUI/discussions/476
This commit is contained in:
parent
2525fcd342
commit
476d543fe8
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue