Commit 6ce5f97
fix: bypass spatial VAE tiling for Wan 2.1 I2V video encode/decode
When vae_tiling is enabled, vae_encode() and decode_first_stage() use a 2D
spatial tiling path that is incompatible with the 4D video tensors produced
by the Wan video VAE.
ENCODE: vae_encode() pre-allocates its result as [W/8, H/8, z_dim, batch].
For Wan 2.1 I2V the WanVAE encoder produces [W/8, H/8, t_latent, z_dim].
Passing encode_video=false (the default) hits the tiling branch and produces
a transposed tensor instead of the correct shape, causing assertion failures.
DECODE: decode_first_stage() checks vae_tiling_params.enabled without a
!decode_video guard. The Wan video latent is fed through the 2D tiling path,
which produces all-black (zero) output frames.
Fix:
- Add encode_video=true to the Wan 2.1 I2V concat-latent encode call
- Add !decode_video guard to the tiling branch in decode_first_stage()
This allows video VAE operations to bypass tiling while keeping it enabled
for regular image inference.
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 10f8d44 commit 6ce5f97
2 files changed
Lines changed: 14 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2410 | 2410 | | |
2411 | 2411 | | |
2412 | 2412 | | |
2413 | | - | |
2414 | | - | |
| 2413 | + | |
| 2414 | + | |
2415 | 2415 | | |
2416 | 2416 | | |
2417 | 2417 | | |
2418 | 2418 | | |
2419 | 2419 | | |
2420 | 2420 | | |
2421 | 2421 | | |
2422 | | - | |
2423 | | - | |
| 2422 | + | |
| 2423 | + | |
2424 | 2424 | | |
2425 | 2425 | | |
2426 | 2426 | | |
| |||
4905 | 4905 | | |
4906 | 4906 | | |
4907 | 4907 | | |
4908 | | - | |
| 4908 | + | |
4909 | 4909 | | |
4910 | 4910 | | |
4911 | 4911 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
125 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
126 | 129 | | |
127 | 130 | | |
128 | 131 | | |
| |||
169 | 172 | | |
170 | 173 | | |
171 | 174 | | |
172 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
173 | 178 | | |
174 | 179 | | |
175 | 180 | | |
| |||
0 commit comments