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]
|
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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue