Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Fix for older python.

comfyanonymous476d543fe80b
diff --git a/comfy_extras/nodes_mask.py b/comfy_extras/nodes_mask.py
index 4dfb0b93e..131cd6a9f 100644
--- a/comfy_extras/nodes_mask.py
+++ b/comfy_extras/nodes_mask.py
@@ -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)