diff --git a/comfy_extras/nodes_mask.py b/comfy_extras/nodes_mask.py index 4dfb0b93e4d..131cd6a9f3d 100644 --- a/comfy_extras/nodes_mask.py +++ b/comfy_extras/nodes_mask.py @@ -187,13 +187,12 @@ def combine(self, destination, source, x, y, operation): 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)