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

[WIP] Support for Automatic1111 API Auth #2139

Conversation

spammenotinoz
Copy link

Enable Auth in Automatic111 with the --api --api-auth username:password

Set the following environment variables in docker;
- "ENABLE_IMAGE_GENERATION=True"
- "AUTOMATIC1111_BASE_URL=http://invokeaiurl:7860"
- "AUTOMATIC1111_API_AUTH=username:password"
- "IMAGE_GENERATION_MODEL=model_name"
- "IMAGE_SIZE=widthxheight"
Note: Works, but if you enter Image within Admin settings it breaks, as breaks as Auth hasn't been added to the Admin Interface. Appreciate if someone can help with that.

Pull Request Checklist

  • Target branch: Pull requests should target the dev branch.
    DEV

  • Description: Briefly describe the changes in this pull request.
    Session authentication added to backend\apps\images\main.py

  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.

  • Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?

  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
    No

  • Testing: Have you written and run sufficient tests for the changes?

  • Code Review: Have you self-reviewed your code and addressed any coding standard issues?
    Yes, refer to current bugs


Description

Support for Automatic1111 Authentication, which is critical if you host the Automatic1111 on a different server, which likely most will want to due to GPU limitations.

Changelog Entry

Added

  • Authentication support for Automatic1111

Breaking Changes

  • Breaks Image Settings within Admin Interface

Additional Information

  • WIP

Environment Variables
      - "AUTOMATIC1111_API_AUTH=username:password"
      - "IMAGE_GENERATION_MODEL=model_name"
      - "IMAGE_SIZE=widthxheight"
Note: Works, but breaks Admin, Image Settings,
app.state.IMAGE_SIZE = IMAGE_SIZE
app.state.IMAGE_STEPS = IMAGE_STEPS

app.state.AUTOMATIC1111_API_AUTH = os.getenv("AUTOMATIC1111_API_AUTH")
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be imported via the config block in line 34 with the other variables, import os is thus not necessary either.

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.

None yet

2 participants