Skip to content

Commit 94d64b8

Browse files
Fix gradient mask values range (#6688)
## Summary Gradient mask node outputs mask tensor with values in range [-1, 1], which unexpected range for mask. It handled in denoise node the way it translates to [0, 2] mask, which looks even more wrongly) From discussion with @dunkeroni I understand him as he thought that negative values will be treated same as 0, so clamping values not change intended node logic. ## Related Issues / Discussions #6643 ## QA Instructions \- ## Merge Plan \- ## Checklist - [x] _The PR has a short but descriptive title, suitable for a changelog_ - [ ] _Tests added / updated (if applicable)_ - [ ] _Documentation added / updated (if applicable)_
2 parents 66547b9 + fa3c0c8 commit 94d64b8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

invokeai/app/invocations/create_gradient_mask.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class GradientMaskOutput(BaseInvocationOutput):
3939
title="Create Gradient Mask",
4040
tags=["mask", "denoise"],
4141
category="latents",
42-
version="1.1.0",
42+
version="1.2.0",
4343
)
4444
class CreateGradientMaskInvocation(BaseInvocation):
4545
"""Creates mask for denoising model run."""
@@ -93,6 +93,7 @@ def invoke(self, context: InvocationContext) -> GradientMaskOutput:
9393

9494
# redistribute blur so that the original edges are 0 and blur outwards to 1
9595
blur_tensor = (blur_tensor - 0.5) * 2
96+
blur_tensor[blur_tensor < 0] = 0.0
9697

9798
threshold = 1 - self.minimum_denoise
9899

0 commit comments

Comments
 (0)