Skip to content

Commit c0015fc

Browse files
authored
Update autoencoder_kl_wan.py
When using the Wan2.2 VAE, the spatial compression ratio calculated here is incorrect. It should be 16 instead of 8. Pass it in directly via the config to ensure it’s correct here.
1 parent 751e250 commit c0015fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/diffusers/models/autoencoders/autoencoder_kl_wan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ def __init__(
10521052
is_residual=is_residual,
10531053
)
10541054

1055-
self.spatial_compression_ratio = 2 ** len(self.temperal_downsample)
1055+
self.spatial_compression_ratio = scale_factor_spatial
10561056

10571057
# When decoding a batch of video latents at a time, one can save memory by slicing across the batch dimension
10581058
# to perform decoding of a single video latent at a time.

0 commit comments

Comments
 (0)