-
Notifications
You must be signed in to change notification settings - Fork 987
Add Video-As-Prompt-Wan2.1-14B inference #1022
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
base: main
Are you sure you want to change the base?
Conversation
Removed dataset snapshot download function call.
Summary of ChangesHello @lzws, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces the 'Video-As-Prompt' (VAP) capability to the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces support for Video-As-Prompt (VAP) with the Wan2.1-14B model. This includes a new MotWanModel for motion transfer, updates to the model configuration and wan_video_dit to handle the new model weights, and significant additions to the WanVideoPipeline to process VAP inputs. A new pipeline unit, WanVideoUnit_VAP, is added to handle the VAP logic, and an example script is provided to demonstrate its usage.
My review found a critical bug in the new pipeline unit that would cause a NameError, and a minor redundancy in the new model definition. Overall, the changes are well-structured for integrating this new feature.
| if end_image is not None: | ||
| vap_end_image = pipe.preprocess_image(vap_video[-1].resize((width, height))).to(pipe.device) | ||
| if pipe.dit.has_image_pos_emb: | ||
| vap_clip_context = torch.concat([clip_context, pipe.image_encoder.encode_image([vap_end_image])], dim=1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable clip_context is used here but it has not been defined in this scope, which will lead to a NameError. It seems you intended to use vap_clip_context, which was defined on line 967.
| vap_clip_context = torch.concat([clip_context, pipe.image_encoder.encode_image([vap_end_image])], dim=1) | |
| vap_clip_context = torch.concat([vap_clip_context, pipe.image_encoder.encode_image([vap_end_image])], dim=1) |
| if hash_state_dict_keys(state_dict) == '19debbdb7f4d5ba93b4ddb1cbe5788c7': | ||
| mot_layers = (0, 4, 8, 12, 16, 20, 24, 28, 32, 36) | ||
| else: | ||
| mot_layers = (0, 4, 8, 12, 16, 20, 24, 28, 32, 36) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.