-
Notifications
You must be signed in to change notification settings - Fork 88
feat(diffusers/pipelines): add pipelines and required modules of QwenImage in Diffusers Master #1288
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
Conversation
|
Can add an inference example and lora fine-tune example in |
The main reason for using ../../transformers/src/transformers/models/qwen2_5_vl/modeling_qwen2_5_vl.py:1517: in __init__
super().__init__(config)
../../transformers/src/transformers/modeling_utils.py:1898: in __init__
self.generation_config = GenerationConfig.from_model_config(config) if self.can_generate() else None
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
decoder_config = model_config.get_text_config(decoder=True)
if decoder_config is not model_config:
default_generation_config = GenerationConfig()
> decoder_config_dict = decoder_config.to_dict()
^^^^^^^^^^^^^^^^^^^^^^
E AttributeError: 'dict' object has no attribute 'to_dict'
../../transformers/src/transformers/generation/configuration_utils.py:1287: AttributeErrorUpgrading |
What does this PR do?
Adds
1. QwenImage Pipelines and Required Modules
(Comparable with Diffusers Master)
a. Pipelines
mindone.diffusers.QwenImagePipelinemindone.diffusers.QwenImageImg2ImgPipelinemindone.diffusers.QwenImageInpaintPipelinemindone.diffusers.QwenImageEditPipelinemindone.diffusers.QwenImageEditInpaintPipelineb. Modules
mindone.diffusers.models.AutoencoderQwenImagemindone.diffusers.models.QwenImageTransformer2DModelmindone.diffusers.loaders.QwenImageLoraLoaderMixin2. add UTs of pipelines
tests/diffusers_tests/pipelines/qwenimage/test_qwenimage.pytests/diffusers_tests/pipelines/qwenimage/test_qwenimage_img2img.pytests/diffusers_tests/pipelines/qwenimage/test_qwenimage_inpaint.pytests/diffusers_tests/pipelines/qwenimage/test_qwenimage_edit.pyFix
TypeError raised due to
mindone/diffusers/loaders/lora_conversion_utils.py.converted_state_dict[diffusers_down_key] = down_weight * scale_down->converted_state_dict[diffusers_down_key] = Parameter(down_weight * scale_down)converted_state_dict[diffusers_up_key] = up_weight * scale_up->converted_state_dict[diffusers_up_key] = Parameter(up_weight * scale_up)Usage
Performance
Experiments are tested on Ascend Atlas 800T A2 machines with MindSpore 2.7.0
Limitation
QwenImageEditPipelineandQwenImageEditInpaintPipelinewill load modules from Qwen-Image-Edit. The use of these two pipes requires manually changingimage_processor_typefromQwen2VLImageProcessorFasttoQwen2VLImageProcessorinQwen-Image-Edit/processor/preprocessor_config.jsonNotes
random seedandhidden statesfrom the text encoder.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