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
8328a2d8
Commit
8328a2d8
authored
Jul 26, 2024
by
comfyanonymous
Browse files
Let hunyuan dit work with all prompt lengths.
parent
afe732be
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
comfy/ldm/hydit/poolers.py
comfy/ldm/hydit/poolers.py
+1
-0
No files found.
comfy/ldm/hydit/poolers.py
View file @
8328a2d8
...
...
@@ -16,6 +16,7 @@ class AttentionPool(nn.Module):
self
.
embed_dim
=
embed_dim
def
forward
(
self
,
x
):
x
=
x
[:,:
self
.
positional_embedding
.
shape
[
0
]
-
1
]
x
=
x
.
permute
(
1
,
0
,
2
)
# NLC -> LNC
x
=
torch
.
cat
([
x
.
mean
(
dim
=
0
,
keepdim
=
True
),
x
],
dim
=
0
)
# (L+1)NC
x
=
x
+
self
.
positional_embedding
[:,
None
,
:].
to
(
dtype
=
x
.
dtype
,
device
=
x
.
device
)
# (L+1)NC
...
...
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