Skip to content

Commit

Permalink
Let hunyuan dit work with all prompt lengths.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Jul 26, 2024
1 parent afe732b commit 8328a2d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions comfy/ldm/hydit/poolers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def __init__(self, spacial_dim: int, embed_dim: int, num_heads: int, output_dim:
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
Expand Down

0 comments on commit 8328a2d

Please sign in to comment.