-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Support ControlNet for Qwen-Image-Edit #12325
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?
Support ControlNet for Qwen-Image-Edit #12325
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
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.
thanks! i left some comments
didn't know the instant x controlnet is compatible with qwen edit :)
src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_controlnet.py
Outdated
Show resolved
Hide resolved
src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_controlnet.py
Outdated
Show resolved
Hide resolved
src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_controlnet.py
Outdated
Show resolved
Hide resolved
src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_controlnet.py
Outdated
Show resolved
Hide resolved
src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_controlnet.py
Outdated
Show resolved
Hide resolved
@@ -639,7 +639,9 @@ def forward( | |||
if controlnet_block_samples is not None: | |||
interval_control = len(self.transformer_blocks) / len(controlnet_block_samples) | |||
interval_control = int(np.ceil(interval_control)) | |||
hidden_states = hidden_states + controlnet_block_samples[index_block // interval_control] | |||
sample = controlnet_block_samples[index_block // interval_control] |
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.
can we adjust inputs in pipeline instead?
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.
I added sample padding to the pipeline and rolled back that change. Let me know if that works for you.
Thank you for your code review. In fact, for my PR, I only merged the
Your feedback is all valid, and I can address it in my PR. However, this feedback also applies to the other Qwen-Image pipelines. Given that there is already a complete refactoring PR #12322, what would you prefer me to do:
|
hi @dimitribarbot
if it is refering to the remove of my review is not taking into consideration of this PR # #12322 at all, your PR will probably be merged first, and we can solve the conflicts from the other PR if there is any |
a603407
to
195bddd
Compare
hi @yiyixuxu
The removal of the For your comment in the
Would you prefer me to revert the changes to |
@dimitribarbot thanks for this PR. You can completely disregard #12322 for now. We're still brainstorming it (hence it's WIP). |
9866325
to
5b1c134
Compare
What does this PR do?
Add ControlNet (InstantX/Qwen-Image-ControlNet-Union) support for Qwen-Image-Edit.
This pipeline enables two latent images to be used as inputs: one for Qwen-Image-Edit and another for Qwen-Image-ControlNet-Union. This provides greater control over the expected results.
Inference
N.B.1. If this PR and image location are accepted, I will upload the
living_room.png
file to thedocumentation-images
repository.N.B.2. To achieve the desired result, set
controlnet_conditioning_scale
to a value greater than 1. A good starting point is 1.5.Examples
Depth
Input image:
Control image:
Result:
Pose
Input image:
Control image:
Result:
Whereas if we don't use controlnet:
N.B. All examples were created using the Nunchaku version of the transformer.
Before submitting
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@yiyixuxu
@asomoza