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
1d36dfb9
"docs/source/en/vscode:/vscode.git/clone" did not exist on "f4a44b7707d9f481f4188155443279a85ba9e67d"
Commit
1d36dfb9
authored
Sep 26, 2023
by
comfyanonymous
Browse files
GrowMask now works with mask batches.
parent
d76d71de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
comfy_extras/nodes_mask.py
comfy_extras/nodes_mask.py
+13
-9
No files found.
comfy_extras/nodes_mask.py
View file @
1d36dfb9
...
@@ -327,15 +327,19 @@ class GrowMask:
...
@@ -327,15 +327,19 @@ class GrowMask:
kernel
=
np
.
array
([[
c
,
1
,
c
],
kernel
=
np
.
array
([[
c
,
1
,
c
],
[
1
,
1
,
1
],
[
1
,
1
,
1
],
[
c
,
1
,
c
]])
[
c
,
1
,
c
]])
output
=
mask
.
numpy
().
copy
()
mask
=
mask
.
reshape
((
-
1
,
mask
.
shape
[
-
2
],
mask
.
shape
[
-
1
]))
while
expand
<
0
:
out
=
[]
output
=
scipy
.
ndimage
.
grey_erosion
(
output
,
footprint
=
kernel
)
for
m
in
mask
:
expand
+=
1
output
=
m
.
numpy
()
while
expand
>
0
:
while
expand
<
0
:
output
=
scipy
.
ndimage
.
grey_dilation
(
output
,
footprint
=
kernel
)
output
=
scipy
.
ndimage
.
grey_erosion
(
output
,
footprint
=
kernel
)
expand
-=
1
expand
+=
1
output
=
torch
.
from_numpy
(
output
)
while
expand
>
0
:
return
(
output
,)
output
=
scipy
.
ndimage
.
grey_dilation
(
output
,
footprint
=
kernel
)
expand
-=
1
output
=
torch
.
from_numpy
(
output
)
out
.
append
(
output
)
return
(
torch
.
cat
(
out
,
dim
=
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