Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
f3ac938b
Commit
f3ac938b
authored
May 28, 2023
by
comfyanonymous
Browse files
Round the mask values for bitwise operations.
parent
ad81fd68
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
comfy_extras/nodes_mask.py
comfy_extras/nodes_mask.py
+3
-3
No files found.
comfy_extras/nodes_mask.py
View file @
f3ac938b
...
...
@@ -194,11 +194,11 @@ class MaskComposite:
elif
operation
==
"subtract"
:
output
[
top
:
bottom
,
left
:
right
]
=
destination_portion
-
source_portion
elif
operation
==
"and"
:
output
[
top
:
bottom
,
left
:
right
]
=
torch
.
bitwise_and
(
destination_portion
.
bool
(),
source_portion
.
bool
()).
float
()
output
[
top
:
bottom
,
left
:
right
]
=
torch
.
bitwise_and
(
destination_portion
.
round
().
bool
(),
source_portion
.
round
().
bool
()).
float
()
elif
operation
==
"or"
:
output
[
top
:
bottom
,
left
:
right
]
=
torch
.
bitwise_or
(
destination_portion
.
bool
(),
source_portion
.
bool
()).
float
()
output
[
top
:
bottom
,
left
:
right
]
=
torch
.
bitwise_or
(
destination_portion
.
round
().
bool
(),
source_portion
.
round
().
bool
()).
float
()
elif
operation
==
"xor"
:
output
[
top
:
bottom
,
left
:
right
]
=
torch
.
bitwise_xor
(
destination_portion
.
bool
(),
source_portion
.
bool
()).
float
()
output
[
top
:
bottom
,
left
:
right
]
=
torch
.
bitwise_xor
(
destination_portion
.
round
().
bool
(),
source_portion
.
round
().
bool
()).
float
()
output
=
torch
.
clamp
(
output
,
0.0
,
1.0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment