Skip to content
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: deprecated arguments in stable diffusion demo #10434

Merged
merged 4 commits into from
Jan 25, 2025

Conversation

ddayto21
Copy link
Contributor

Description

Resolves Issue #10430

  1. Fixed Deprecated Arguments:

    • Replaced use_auth_token with token.
    • Replaced revision="fp16" with variant="fp16" in the StableDiffusionPipeline setup.
  2. Added Hugging Face Token Validation:

    • Introduced a runtime check for the HF_TOKEN environment variable.
    • Displays a clear error message if the token is missing, both in the console and UI.
  3. Improved User Experience:

    • Prevents users from entering the UI when the token is not properly set.
    • Provides clear instructions on how to set the token.

- Updated `requirements.txt` to include specific package versions, ensuring better dependency management and compatibility.
- Enhanced `run.py` to check for the Hugging Face access token (`HUGGING_FACE_ACCESS_TOKEN`) at runtime, providing a clear error message if it's missing.
- Replaced deprecated arguments (`use_auth_token`, `revision="fp16"`) with updated ones (`token`, `variant="fp16"`) in the StableDiffusionPipeline setup.
- Added minor formatting improvements to improve readability and maintainability in the `run.py` script.

These changes enhance user clarity, ensure compatibility with updated libraries, and improve the code's overall quality.
@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Jan 24, 2025

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website building...
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://gradio-pypi-previews.s3.amazonaws.com/5c5cc0783b3c37b9a59edd0113fd2265c4ca45ab/gradio-5.13.1-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@5c5cc0783b3c37b9a59edd0113fd2265c4ca45ab#subdirectory=client/python"

Install Gradio JS Client from this PR

npm install https://gradio-npm-previews.s3.amazonaws.com/5c5cc0783b3c37b9a59edd0113fd2265c4ca45ab/gradio-client-1.10.0.tgz

Use Lite from this PR

<script type="module" src="https://gradio-lite-previews.s3.amazonaws.com/5c5cc0783b3c37b9a59edd0113fd2265c4ca45ab/dist/lite.js""></script>

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Jan 24, 2025

🦄 no changes detected

This Pull Request does not include changes to any packages.

__No changes detected. __

  • Maintainers can select this checkbox to manually select packages to update.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can create the changelog file directly.

Copy link
Member

@abidlabs abidlabs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ddayto21, as noted in our contributing guidelines, we welcome meaningful contributions that solve real issues and improve the codebase. Please avoid opening PRs with content generated primarily by AI language models.

This looks to be one such PR and it resulted in a messy process with the previous PR being closed and this one being reopened. I'll go ahead and merge this in this time but in the future, please avoid opening such PRs.

@abidlabs abidlabs merged commit 7174340 into gradio-app:main Jan 25, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Deprecated Arguments in StableDiffusionPipeline
3 participants