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
Add support for diffuser pipelines in gr.Interface.from_pipeline(). #7265
Add support for diffuser pipelines in gr.Interface.from_pipeline(). #7265
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-builds.s3.amazonaws.com/a64bc61e390b9c4a09a3300a4cd971b05587e2dc/gradio-4.20.1-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@a64bc61e390b9c4a09a3300a4cd971b05587e2dc#subdirectory=client/python" |
@abidlabs, I've made an initial commit adding support for the Stable Diffusion pipeline, which I've successfully tested locally. Could you or someone from your team review the approach? I plan to apply the same methodology to the remaining pipelines. |
Thanks @shubhamofbce this is looking good! Just one comment at the top |
992115f
to
34209af
Compare
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
@aliabd This is ready for review. |
Thanks @shubhamofbce this generally looks good to me. I'll give it a full review after you've refactored based on @akx's comments. To get the python tests to run properly, you'll need to use ruff to format the code. Please run |
@shubhamofbce let us know when this is ready for another look! Thanks |
e8be811
to
04c2804
Compare
@akx @abidlabs This is ready for review now. One important change that i want to point out |
I have also formatted the code using |
Thanks @shubhamofbce for making the changes! It looks like we need we need to add |
74cbf14
to
2c28854
Compare
@abidlabs I have updated the requirements.in file and also updated the requirements.txt file using pip compile. |
97a854f
to
f81a3ae
Compare
@akx I have fixed the code as per your suggestions, Also i have tested locally a transformer pipeline and a diffuser pipeline to make sure everything is working as expected. |
…ns present in pipelines_helpers.py
648e408
to
7f796ef
Compare
Thanks @shubhamofbce I'll review and get this merged in this week! |
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.
Great PR @shubhamofbce! Thank you so much for taking our feedback into account. I made some small tweaks, but overall, this looks good to me.
Will merge in once CI passes
@shubhamofbce your contribution is now part of the official diffusers docs: https://huggingface.co/docs/diffusers/main/en/api/pipelines/stable_diffusion/overview#create-web-demos-using-gradio Thanks again for the great PR! |
Thanks @abidlabs, looking forward for more such useful additions to gradio. |
Description
I have added support for the following diffuser pipelines in gr.Interface.from_pipeline().
Closes: #6856
🎯 PRs Should Target Issues
Not adhering to this guideline will result in the PR being closed.
Tests
PRs will only be merged if tests pass on CI. To run the tests locally, please set up your Gradio environment locally and run the tests:
bash scripts/run_all_tests.sh
You may need to run the linters:
bash scripts/format_backend.sh
andbash scripts/format_frontend.sh