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
d4edd9bf
"...composable_kernel_onnx.git" did not exist on "e2313c9eca16d1ef503ea4e3ae1ebc437dca2e9f"
Commit
d4edd9bf
authored
Jan 11, 2024
by
comfyanonymous
Browse files
Fix hypertile issue with high depths.
parent
977eda19
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
comfy_extras/nodes_hypertile.py
comfy_extras/nodes_hypertile.py
+8
-8
No files found.
comfy_extras/nodes_hypertile.py
View file @
d4edd9bf
...
@@ -37,24 +37,24 @@ class HyperTile:
...
@@ -37,24 +37,24 @@ class HyperTile:
def
patch
(
self
,
model
,
tile_size
,
swap_size
,
max_depth
,
scale_depth
):
def
patch
(
self
,
model
,
tile_size
,
swap_size
,
max_depth
,
scale_depth
):
model_channels
=
model
.
model
.
model_config
.
unet_config
[
"model_channels"
]
model_channels
=
model
.
model
.
model_config
.
unet_config
[
"model_channels"
]
apply_to
=
set
()
temp
=
model_channels
for
x
in
range
(
max_depth
+
1
):
apply_to
.
add
(
temp
)
temp
*=
2
latent_tile_size
=
max
(
32
,
tile_size
)
//
8
latent_tile_size
=
max
(
32
,
tile_size
)
//
8
self
.
temp
=
None
self
.
temp
=
None
def
hypertile_in
(
q
,
k
,
v
,
extra_options
):
def
hypertile_in
(
q
,
k
,
v
,
extra_options
):
if
q
.
shape
[
-
1
]
in
apply_to
:
model_chans
=
q
.
shape
[
-
2
]
orig_shape
=
extra_options
[
'original_shape'
]
apply_to
=
[]
for
i
in
range
(
max_depth
+
1
):
apply_to
.
append
((
orig_shape
[
-
2
]
/
(
2
**
i
))
*
(
orig_shape
[
-
1
]
/
(
2
**
i
)))
if
model_chans
in
apply_to
:
shape
=
extra_options
[
"original_shape"
]
shape
=
extra_options
[
"original_shape"
]
aspect_ratio
=
shape
[
-
1
]
/
shape
[
-
2
]
aspect_ratio
=
shape
[
-
1
]
/
shape
[
-
2
]
hw
=
q
.
size
(
1
)
hw
=
q
.
size
(
1
)
h
,
w
=
round
(
math
.
sqrt
(
hw
*
aspect_ratio
)),
round
(
math
.
sqrt
(
hw
/
aspect_ratio
))
h
,
w
=
round
(
math
.
sqrt
(
hw
*
aspect_ratio
)),
round
(
math
.
sqrt
(
hw
/
aspect_ratio
))
factor
=
2
**
((
q
.
shape
[
-
1
]
//
model_chan
nels
)
-
1
)
if
scale_depth
else
1
factor
=
(
2
**
apply_to
.
index
(
model_chan
s
)
)
if
scale_depth
else
1
nh
=
random_divisor
(
h
,
latent_tile_size
*
factor
,
swap_size
)
nh
=
random_divisor
(
h
,
latent_tile_size
*
factor
,
swap_size
)
nw
=
random_divisor
(
w
,
latent_tile_size
*
factor
,
swap_size
)
nw
=
random_divisor
(
w
,
latent_tile_size
*
factor
,
swap_size
)
...
...
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