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
977eda19
Commit
977eda19
authored
Jan 11, 2024
by
comfyanonymous
Browse files
Don't round noise mask.
parent
10f2609f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
1 deletion
+0
-1
comfy/sample.py
comfy/sample.py
+0
-1
No files found.
comfy/sample.py
View file @
977eda19
...
@@ -28,7 +28,6 @@ def prepare_noise(latent_image, seed, noise_inds=None):
...
@@ -28,7 +28,6 @@ def prepare_noise(latent_image, seed, noise_inds=None):
def
prepare_mask
(
noise_mask
,
shape
,
device
):
def
prepare_mask
(
noise_mask
,
shape
,
device
):
"""ensures noise mask is of proper dimensions"""
"""ensures noise mask is of proper dimensions"""
noise_mask
=
torch
.
nn
.
functional
.
interpolate
(
noise_mask
.
reshape
((
-
1
,
1
,
noise_mask
.
shape
[
-
2
],
noise_mask
.
shape
[
-
1
])),
size
=
(
shape
[
2
],
shape
[
3
]),
mode
=
"bilinear"
)
noise_mask
=
torch
.
nn
.
functional
.
interpolate
(
noise_mask
.
reshape
((
-
1
,
1
,
noise_mask
.
shape
[
-
2
],
noise_mask
.
shape
[
-
1
])),
size
=
(
shape
[
2
],
shape
[
3
]),
mode
=
"bilinear"
)
noise_mask
=
noise_mask
.
round
()
noise_mask
=
torch
.
cat
([
noise_mask
]
*
shape
[
1
],
dim
=
1
)
noise_mask
=
torch
.
cat
([
noise_mask
]
*
shape
[
1
],
dim
=
1
)
noise_mask
=
comfy
.
utils
.
repeat_to_batch_size
(
noise_mask
,
shape
[
0
])
noise_mask
=
comfy
.
utils
.
repeat_to_batch_size
(
noise_mask
,
shape
[
0
])
noise_mask
=
noise_mask
.
to
(
device
)
noise_mask
=
noise_mask
.
to
(
device
)
...
...
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