Skip to content

Commit e0ea443

Browse files
authored
Update autoencoder_kl_wan.py
1 parent c0015fc commit e0ea443

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/diffusers/models/autoencoders/autoencoder_kl_wan.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,12 +1145,13 @@ def clear_cache(self):
11451145
def _encode(self, x: torch.Tensor):
11461146
_, _, num_frame, height, width = x.shape
11471147

1148-
if self.use_tiling and (width > self.tile_sample_min_width or height > self.tile_sample_min_height):
1149-
return self.tiled_encode(x)
1150-
11511148
self.clear_cache()
11521149
if self.config.patch_size is not None:
11531150
x = patchify(x, patch_size=self.config.patch_size)
1151+
1152+
if self.use_tiling and (width > self.tile_sample_min_width or height > self.tile_sample_min_height):
1153+
return self.tiled_encode(x)
1154+
11541155
iter_ = 1 + (num_frame - 1) // 4
11551156
for i in range(iter_):
11561157
self._enc_conv_idx = [0]

0 commit comments

Comments
 (0)