-
Notifications
You must be signed in to change notification settings - Fork 89
(fix/diffusers): fix some bugs #1448
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: master
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @Cui-yshoho, 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 a new multimodal processor for Qwen2-VL models, significantly refactors the Wan-VACE transformer architecture, and enhances several pipelines with improved type hinting and documentation. It also addresses cross-version compatibility for various pipeline tests, ensuring greater stability and robustness across different library environments. The changes aim to fix bugs and improve the overall functionality and maintainability of 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 a variety of fixes and refactorings across the diffusers library. Key improvements include updating the transformer_wan_vace.py to use a new WanAttention class, correcting type hints for better compatibility (e.g., ms.dtype to ms.Type), and adding support for Qwen2VLProcessor. The changes generally enhance code quality and correctness. My review identifies one high-severity issue in pipeline_wan_vace.py where a necessary dtype conversion was removed, which could lead to runtime errors. I have provided a suggestion to fix this.
|
|
||
| conditioning_latents = self.prepare_video_latents(video, mask, reference_images, generator) | ||
| mask = self.prepare_masks(mask, reference_images, generator).to(conditioning_latents.dtype) | ||
| mask = self.prepare_masks(mask, reference_images, generator) |
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 removal of .to(conditioning_latents.dtype) could introduce a dtype mismatch during the mint.cat operation on the next line. The conditioning_latents tensor has vae_dtype, while the mask tensor from prepare_masks appears to have a float32 dtype originating from the preprocess_conditions call. If vae_dtype is not float32 (e.g., bfloat16), this will likely cause a runtime error. It's safer to ensure both tensors have the same dtype before concatenation.
| mask = self.prepare_masks(mask, reference_images, generator) | |
| mask = self.prepare_masks(mask, reference_images, generator).to(conditioning_latents.dtype) |
| self, | ||
| prompt: Union[str, List[str]] = None, | ||
| dtype: Optional[ms.dtype] = None, | ||
| dtype: Optional[ms.Type] = None, |
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.
| prompt: Union[str, List[str]] = None, | ||
| image: Optional[ms.tensor] = None, | ||
| dtype: Optional[ms.dtype] = None, | ||
| dtype: Optional[ms.Type] = None, |
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.
| prompt: Union[str, List[str]] = None, | ||
| image: Optional[ms.tensor] = None, | ||
| dtype: Optional[ms.dtype] = None, | ||
| dtype: Optional[ms.Type] = None, |
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.
| self, | ||
| prompt: Union[str, List[str]] = None, | ||
| dtype: Optional[ms.dtype] = None, | ||
| dtype: Optional[ms.Type] = None, |
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.
| self, | ||
| prompt: Union[str, List[str]] = None, | ||
| dtype: Optional[ms.dtype] = None, | ||
| dtype: Optional[ms.Type] = None, |
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.
4d6a0f4 to
06a0fd3
Compare
06a0fd3 to
13ddbd2
Compare
What does this PR do?
Fixes # (issue)
Adds # (feature)
Before submitting
What's New. Here are thedocumentation guidelines
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
@xxx