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

[Feature] - Set remote SD URL with environment variable #8

Merged

Conversation

sphuff
Copy link
Contributor

@sphuff sphuff commented Dec 21, 2022

Motivation:
Allows users to use a remote instance of the Automatic UI

How to use:

export SD_URL=http://104.143.3.146:10758 (example URL I was using)
// start app
uvicorn serverMain:app --reload

Or you can do the following:

  • Add set SD_URL=http://104.143.3.146:10758 in your start_server.bat

How it works:
All requests are proxied through the local python server. The remote SD server is then hit


sd_url = os.environ.get('SD_URL', 'http://127.0.0.1:7860')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

still defaults to the local instance on 7860

@WadeWarren
Copy link

This is great – thanks!

@AbdullahAlfaraj
Copy link
Owner

this is awesome.
all of the generation related request like (img2img, inpaint) are working
but the progressbar seem to be broken. it's stuck at 0%.
I will keep testing it.

@sphuff
Copy link
Contributor Author

sphuff commented Dec 22, 2022

@AbdullahAlfaraj ah I see what's happening - the server is only handling one request at a time, so the progress request isn't resolving until after the images are done. I should be able to do the image task in the background to fix - will update shortly

@sphuff
Copy link
Contributor Author

sphuff commented Dec 22, 2022

Ok, done. I ending up adding asyncio and httpx to handle the async requests on the python side. So now I'm seeing it working with the progress request, as well as the txt2img/img2img

@AbdullahAlfaraj AbdullahAlfaraj merged commit 716ecd7 into AbdullahAlfaraj:master Dec 22, 2022
@AbdullahAlfaraj
Copy link
Owner

@sphuff fantastic work.

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

3 participants