-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fix LLMGroundedDiffusionPipeline super class arguments #5993
Fix LLMGroundedDiffusionPipeline super class arguments #5993
Conversation
…nt as it's more future-proof
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. |
Thanks for the fix. It's interesting that it somehow does not error on my end. Is it a recent change? |
After tracing the change, I found #5713 broke the positional argument order. This fix is indeed needed. I also suggest replacing Thank you! |
Just verified on colab and it still gives an error. Tested commit: The original colab: https://colab.research.google.com/drive/1SXzMSeAB-LJYISb2yrUOdypLz4OYWUKj Steps to reproduce:
The error says at
Somehow the commit #5713 breaks things in a more complicated way than I think it is... It introduces an The proper way to fix this is to replace the initialization and super call with (i.e., add
After that it works on my end on colab. @KristianMischke could you help add this to the PR and check whether it works on colab? |
@TonyLianLong Thanks for investigating further! Applied your changes and it's working properly now in the colab notebook with my latest commit |
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.
ok by me but is there any reason we use StableDiffusionPipeline
as super class, instead of DiffusionPipeline
? if not maybe let's just change the super class to DiffusionPipeline
? pipelines should not use StableDiffusionPipeline
as base class at all
I use StableDiffusionPipeline as a superclass because we inherit many methods from it. If we inherit directly from |
We recommend using the Are you the author of this pipeline? I can merge this quickly for you now if that's what you want. Let me know:) |
Thanks for your suggestions! Yes, I'm the author of this pipeline, and I'd like to make it easier to maintain. Let's inherit from I can take the work to update the inheritance, or before I get some time to do this @KristianMischke you can also help with this if you feel excited about it. |
We don't have it in the doc (I think we should, though! cc @sayakpaul @stevhliu what do you think?) but it's everywhere in our codebase; here is an example diffusers/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py Line 323 in f72b28c
Once you added this |
let me know if you want to work on this - if not I will merge this PR and @TonyLianLong can open a different PR later |
Sounds good to me, maybe we can add it to the "How to contribute?" doc under Adding pipelines, models, and schedulers? |
@yiyixuxu and @TonyLianLong thanks for the continued correspondence! Given my limited time, I'd say merge and allow @TonyLianLong to adjust the structure later |
Somehow the colab still does not work: https://colab.research.google.com/drive/1SXzMSeAB-LJYISb2yrUOdypLz4OYWUKj Will look into this when I get time. |
OK, colab fixed. Seems like we need to specify Example:
|
I'd also like to add another small fix when peft is installed with diffusers, gives the TypeError: Linear.forward() got an unexpected keyword argument 'scale' |
Could you create an issue and assign it to me? @Skquark |
What does this PR do?
This PR makes
requires_safety_checker
a keyword argument so it doesn't collide withStableDiffusionPipeline.image_encoder
in the parameter order.Fixes #5992
Before submitting
documentation guidelines, and
here are tips on formatting docstrings.
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.
@TonyLianLong