Skip to content

Commit

Permalink
Fix for older python.
Browse files Browse the repository at this point in the history
from: #476
  • Loading branch information
comfyanonymous committed Apr 15, 2023
1 parent 2525fcd commit 476d543
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions comfy_extras/nodes_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 476d543

Please sign in to comment.