Skip to content

Commit

Permalink
Wan code small cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Feb 27, 2025
1 parent b07f116 commit f4dac8a
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions comfy/ldm/wan/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,10 @@ def forward(

x = x + y * e[2]

# cross-attention & ffn function
def cross_attn_ffn(x, context, e):
x = x + self.cross_attn(self.norm3(x), context)
y = self.ffn(self.norm2(x) * (1 + e[4]) + e[3])
x = x + y * e[5]
return x

x = cross_attn_ffn(x, context, e)
# cross-attention & ffn
x = x + self.cross_attn(self.norm3(x), context)
y = self.ffn(self.norm2(x) * (1 + e[4]) + e[3])
x = x + y * e[5]
return x


Expand Down Expand Up @@ -442,7 +438,6 @@ def forward_orig(
# unpatchify
x = self.unpatchify(x, grid_sizes)
return x
# return [u.float() for u in x]

def forward(self, x, timestep, context, clip_fea=None, **kwargs):
bs, c, t, h, w = x.shape
Expand Down

0 comments on commit f4dac8a

Please sign in to comment.