fix: use variable frame_num instead of hardcoded 81 in FLF2V mask#583
Open
wishhyt wants to merge 1 commit intoWan-Video:mainfrom
Open
fix: use variable frame_num instead of hardcoded 81 in FLF2V mask#583wishhyt wants to merge 1 commit intoWan-Video:mainfrom
wishhyt wants to merge 1 commit intoWan-Video:mainfrom
Conversation
The mask tensor in WanFLF2V.generate() was hardcoded with 81 frames instead of using the `F` (frame_num) variable. This causes a tensor dimension mismatch when frame_num is changed from the default 81. The same bug was previously fixed in image2video.py (PR Wan-Video#533) but was missed in first_last_frame2video.py. Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The mask tensor in
WanFLF2V.generate()(wan/first_last_frame2video.py, line 231) was hardcoded with81frames:msk = torch.ones(1, 81, lat_h, lat_w, device=self.device)msk = torch.ones(1, F, lat_h, lat_w, device=self.device)This causes a tensor dimension mismatch error when
frame_numis set to any value other than 81.The same bug was previously fixed in
image2video.pyvia PR #533, butfirst_last_frame2video.pywas missed.Reproduction
Run FLF2V generation with
--frame_num 41(or any value != 81) → crash due to tensor shape mismatch.Test plan
image2video.py(line 210)frame_num=81to confirm no regressionframe_num(e.g., 41) to confirm fix