stable-diffusion-webui
stable-diffusion-webui copied to clipboard
SDWebUI behind a proxy
Is there an existing issue for this?
- [X] I have searched the existing issues and checked the recent builds/commits
What would your feature do ?
how to make SDWebUI work behind a proxy? during webUI startup it needs to download some resource from hugginface, and python or conda can't access the web if a proxy is used
also, since it still tries to download some resource from hugginface, this prevents its use offline.
this resource seems to be "cached" in the ".cache" folder inside the user folder, but it still searches the web on every webUI startup
Proposed workflow
just execute with a proxy setup on windows network configuration
Additional information
need sdwebui to work offline too
Make the traffic from python, git and conda bypass your proxy
Make the traffic from python, git and conda bypass your proxy
git does (don't mind the proxy), but not python and conda.
Some time ago I had this problem in another context, I looked for how to do it and it worked for me once, then it didn't work for me anymore and I couldn't do it again.
Perhaps some parameter can be included in the webui startup that allows to specify if there is a proxy, and to use it, or not, to use this configuration, or use the system one
Make the traffic from python, git and conda bypass your proxy
git does (don't mind the proxy), but not python and conda.
Some time ago I had this problem in another context, I looked for how to do it and it worked for me once, then it didn't work for me anymore and I couldn't do it again.
Perhaps some parameter can be included in the webui startup that allows you to specify if there is and if to use or not a proxy, its configuration or use the system one
There is one, but it may or may not work. Let me find it.
Try adding TRANSFORMERS_OFFLINE=1 before the batch/python script
where? how? like this: set TRANSFORMERS_OFFLINE=1 in webui-user.bat ?
where?
how?
like this:
set TRANSFORMERS_OFFLINE=1
in webui-user.bat ?
I'm not familiar with Windows so you'll have to experiment with where to put it.
mmm...
in https://huggingface.co/docs/transformers/installation they talk about the offline use of Transformers from cached or previously downloade files. -By setting the environment variables (Linux and Windows)... -While running... -Also by getting the files beforehand, putting them to any desired folder and configuring Transformers to use them.
I think someone here should take a look to this, to bring any of that solutions to sdwebui. That should help with offline/proxies/firewall usages contexts.
Hi! Have you more info on offline/firewall mode? I m interested too
no yet. for me it worked once, dont know why or how, never again, before or after that
Has this problem been solved?I'm facing the same situation
e no yet, it seems theoretically it was, but nah
@maikelsz @laptop-lace
-
for git proxy:
git config --global https.proxy <your-proxy-server> git config --global https.proxy http://127.0.0.1:20809 // a example
-
for python3.10 in Windows, set the env like this(remember change the proxy to your proxy-server):
then check if python use the proxy by this command:
python -c 'import urllib.request; print(urllib.request.getproxies())' // result should like this: {'https': 'http://127.0.0.1:20809'}
-
for conda: sorry, I have no idea, the above commands make sdwebui seem to work well for me now.