Skip to content

192 Frame Limit (Bug and Proposed Fix) #223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
pftq opened this issue Feb 22, 2025 · 0 comments
Open

192 Frame Limit (Bug and Proposed Fix) #223

pftq opened this issue Feb 22, 2025 · 0 comments

Comments

@pftq
Copy link

pftq commented Feb 22, 2025

I'm coming from debugging the SkyReels code and it seems to point at a bug in the Hunyuan VAE that hard limits the video at 192 frames (even if there is good output going beyond that, it just gets thrown out).

In autoencoder_kl_hunyuan_video.py. The original code runs into an out-of-bounds at the 25th tile (193rd frame at 8 frames per tile), which then causes the video to loop from 193 onwards instead of using the correct frames.

Find:

for i in range(0, num_frames, tile_latent_stride_num_frames):
    tile = z[:, :, i : i + tile_latent_min_num_frames + 1, :, :]

Replace:

for i in range(0, num_frames, tile_latent_stride_num_frames):
    end_idx = min(i + tile_latent_min_num_frames + 1, num_frames)
    tile = z[:, :, i : end_idx, :, :]
    if i > 0:
        tile = torch.cat([z[:, :, i - 1 : i, :, :], tile], dim=2)   # 20250222 pftq: Add previous frame for continuity

Making this change should remove the hard limit but I'm not quite sure how to test and apply it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant