Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions comfy/ldm/wan/vae2_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def __init__(self, in_dim, out_dim, dropout=0.0):
if in_dim != out_dim else nn.Identity())

def forward(self, x, feat_cache=None, feat_idx=[0]):
h = self.shortcut(x)
old_x = x
for layer in self.residual:
if isinstance(layer, CausalConv3d) and feat_cache is not None:
idx = feat_idx[0]
Expand All @@ -156,7 +156,7 @@ def forward(self, x, feat_cache=None, feat_idx=[0]):
feat_idx[0] += 1
else:
x = layer(x)
return x + h
return x + self.shortcut(old_x)


def patchify(x, patch_size):
Expand Down Expand Up @@ -327,7 +327,7 @@ def __init__(self,
self.downsamples = nn.Sequential(*downsamples)

def forward(self, x, feat_cache=None, feat_idx=[0]):
x_copy = x.clone()
x_copy = x
for module in self.downsamples:
x = module(x, feat_cache, feat_idx)

Expand Down Expand Up @@ -369,7 +369,7 @@ def __init__(self,
self.upsamples = nn.Sequential(*upsamples)

def forward(self, x, feat_cache=None, feat_idx=[0], first_chunk=False):
x_main = x.clone()
x_main = x
for module in self.upsamples:
x_main = module(x_main, feat_cache, feat_idx)
if self.avg_shortcut is not None:
Expand Down
Loading