-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Add Qwen-Image-Edit Inpainting pipeline #12225
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
Cc: @naykun as well.
Hi @Trgtuan10 , that would be an amazing feature! It seems to preserve details better than the current QwenImageInpaintPipeline
—great improvement!
I’ll dive in and run some more extensive tests on this PR shortly. Thanks so much for your contribution, and for helping push this forward! 🙌
Thanks @naykun! Please feel free to test it out and let me know if you run into any issues.
Hi @naykun @sayakpaul, have you tested it yet? I'd appreciate any feedback or reviews!
@Trgtuan10 I've tested it, and things are working well overall. This approach shows promise for handling complex editing scenarios while keeping the rest of the content unchanged. There are a few unstable cases where instructions don't always take effect, but I believe we can mitigate those with better prompts and strategic masking. I suggest we move forward with this PR.
cc @sayakpaul @yiyixuxu
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 for this! I have two minor comments.
I think we should also add tests and docs. Thanks to @naykun for running the tests as well.
src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_inpaint.py
Outdated
Show resolved
Hide resolved
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.
thank you for your PR!!
left some very small comments about #Copied from
Thanks for the reviews @sayakpaul @yiyixuxu. I’ve updated the code to stay up to date with the latest changes from the main branch. Please check it again.
@bot /style
Style fix is beginning .... View the workflow run here.
HuggingFaceDocBuilderDev
commented
Aug 30, 2025
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.
oh CI still fail and style bot cannot fix
would you be able to fix it? just run make style
and fix the format issues as listed
thanks!
@yiyixuxu I just fixed
@yiyixuxu I just fixed
Hi,
I have read the code, and i'm confused why masked_image_latents
is not used when send to DiT?
@xduzhangjiayu No problem, I don’t think anyone is using these parameters. Feel free to open a PR to make the code clearer
@Trgtuan10 We don't need to concat the masked_image_latents
and latents
for inpainting model?
Yes, we don't need. The mask is only used when creating latents after each step, code
Yes, we don't need. The mask is only used when creating latents after each step, code
Thanks! I understand, it's like a BLD inpainting
Uh oh!
There was an error while loading. Please reload this page.
What does this PR do?
This PR introduces support for the Qwen-Image-Edit model in Inpainting tasks, expanding the model’s creative capabilities and integration within the Diffusers library.
Example code
Comparison about performance of QwenImage-Edit Inpaint
Mask
QwenImage-Edit
QwenImage-Edit Inpaint
Who can review?
cc @a-r-r-o-w @sayakpaul