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
b02bcced
Commit
b02bcced
authored
May 23, 2024
by
comfyanonymous
Browse files
Fix FreeU not working when shape is tensor.
parent
6507a9c7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
comfy_extras/nodes_freelunch.py
comfy_extras/nodes_freelunch.py
+2
-2
No files found.
comfy_extras/nodes_freelunch.py
View file @
b02bcced
...
...
@@ -42,7 +42,7 @@ class FreeU:
on_cpu_devices
=
{}
def
output_block_patch
(
h
,
hsp
,
transformer_options
):
scale
=
scale_dict
.
get
(
h
.
shape
[
1
],
None
)
scale
=
scale_dict
.
get
(
int
(
h
.
shape
[
1
]
)
,
None
)
if
scale
is
not
None
:
h
[:,:
h
.
shape
[
1
]
//
2
]
=
h
[:,:
h
.
shape
[
1
]
//
2
]
*
scale
[
0
]
if
hsp
.
device
not
in
on_cpu_devices
:
...
...
@@ -81,7 +81,7 @@ class FreeU_V2:
on_cpu_devices
=
{}
def
output_block_patch
(
h
,
hsp
,
transformer_options
):
scale
=
scale_dict
.
get
(
h
.
shape
[
1
],
None
)
scale
=
scale_dict
.
get
(
int
(
h
.
shape
[
1
]
)
,
None
)
if
scale
is
not
None
:
hidden_mean
=
h
.
mean
(
1
).
unsqueeze
(
1
)
B
=
hidden_mean
.
shape
[
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