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
172984db
"vscode:/vscode.git/clone" did not exist on "577b8a2783c2ba9cf4ebbb3c36ea024a6175ef95"
Commit
172984db
authored
Dec 16, 2023
by
comfyanonymous
Browse files
Fix SAG not working on certain resolutions.
parent
6596654d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
comfy_extras/nodes_sag.py
comfy_extras/nodes_sag.py
+1
-1
No files found.
comfy_extras/nodes_sag.py
View file @
172984db
...
@@ -58,7 +58,7 @@ def create_blur_map(x0, attn, sigma=3.0, threshold=1.0):
...
@@ -58,7 +58,7 @@ def create_blur_map(x0, attn, sigma=3.0, threshold=1.0):
attn
=
attn
.
reshape
(
b
,
-
1
,
hw1
,
hw2
)
attn
=
attn
.
reshape
(
b
,
-
1
,
hw1
,
hw2
)
# Global Average Pool
# Global Average Pool
mask
=
attn
.
mean
(
1
,
keepdim
=
False
).
sum
(
1
,
keepdim
=
False
)
>
threshold
mask
=
attn
.
mean
(
1
,
keepdim
=
False
).
sum
(
1
,
keepdim
=
False
)
>
threshold
ratio
=
round
(
math
.
sqrt
(
lh
*
lw
/
hw1
))
ratio
=
math
.
ceil
(
math
.
sqrt
(
lh
*
lw
/
hw1
))
mid_shape
=
[
math
.
ceil
(
lh
/
ratio
),
math
.
ceil
(
lw
/
ratio
)]
mid_shape
=
[
math
.
ceil
(
lh
/
ratio
),
math
.
ceil
(
lw
/
ratio
)]
# Reshape
# Reshape
...
...
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