-
Notifications
You must be signed in to change notification settings - Fork 26.6k
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
Offline working #1523
Comments
It would be helpful to know where it's actually erroring out. I'd imagine it's choking on the git clone bits. But, as far as I can tell, if you were to run this on a machine with an internet connection, then copy the whole directory to another computer that also has the same python installations...it should work? The venv is set up within the project directory, the models are downloaded within the project directory...and the repos are cloned to the project directory. Post a log from the console of the error you're getting, I can take a look and provide more insight. |
full console log: venv "f:\stable-diffusion-webui\stable-diffusion-webui\venv\Scripts\Python.exe" stderr: Running command git clone -q https://github.com/openai/CLIP 'C:\Users\User\AppData\Local\Temp\pip-req-build-2aqgsveq' Press any key to continue . . . the same happens if you are behind a proxy |
So it's choking on trying to git clone CLIP, which was actually just removed in a commit today. You will still need to have an internet connection to install the requirements on first run and download models if needed, but once they are in place, I'd expect this to work fine without internet. |
I've tried it, over and over again. in "venv/Lib/site-pakages" is the CLIP package. then, why try to download it again? and if it is with GIT, in the "repositories" folder (where I think it should be downloaded), there is no CLIP. What if I clone it once manually? if in theory when executed (with connection) it installs those requirements, in the next execution (without connection) it should not need it. No? also, behind a proxy it also fails (different one, I´ll post latter) In another project I'm testing (stable-diffusion-ui), on every boot it downloads the latest updates it finds. one question. |
Hi! Lines 120-124 look something like this: There is no reason to pull the repos every single time you run the program and it runs fine without these lines IF an initial full run have been made (things need to be there...). You can also outcomment line (currently) line 129: Now... I just tested this and it works fine here, no problems arise with those lines gone. |
not working. well, kind of. now it wants tokenization from hugginface, fails to connect/get it, of course, is working offline. a different project I've testing does the same, but sometime works without it, as if the token was cached or something, then it can start off line the console: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): it seems there is some "cache" somewhere, but the token is not there anyway. |
I also had the same token error, but I copied .cache folder from "C:\Users\YourUserName.cache" and paste into offline PC. Then webUI started to work nicely. |
mmm... in https://huggingface.co/docs/transformers/installation they talk about the offline use of Transformers I think someone here should take a look to this, to bring any of that solutions to sdwebui. |
I took the following procedures to make the webui work offline.
|
I´ll try this, only need some things, most are already there. |
The project should always be able to run offline, in the rare case it doesn't, it means certain modules were not installed the first time. There are also times that a new version of huggingface transformers or something webui depends on gets updated during the webui.bat startup.. and it breaks your install. To be careful, you should be starting it up offline to 100% avoid fetching new updates for those packages. If it worked before, you can be 100% confident it will work the next time you start it up (without wifi connection) I hope you understand what I'm saying, cheers |
sorry but 99% of the times SD-WebUI has not started offline or behind a proxy (I suppose there is a way to bypass the proxy, or make python/conda use the one in use) (same with another project I've been testing) |
i can confirm i have the same issue when not online, it tries to grab something from the web at "Installing requirements for Web UI" and then it fails... |
Confirming the same issue. It looks like it is somehow linked to corporate firewall settings because it works nicely outside of the corporate network. It means for me that SD tries to connect to update itself but depending on network availability it either updates and starts or fails. Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): |
I have the same issue. Yesterday my ISP was down and I couldn't start the WebUI. It always hung on "Installing requirements for Web UI". It hangs on: |
exactly the same issue for me. |
Update. Now it works if there is no connection. I assume the issue was fixed after pulling the update. But it is still not working if there is a connection with some restrictions. Hope this can help. |
I have intermittent internet over 4G/5G, and when the internet drops, the WebUI says "Connection lost" error, puts a error over model list (not sure why that would need internet) and text2img results don't show, all off local install and using local address (127.0.0.1), is this normal behavior? |
I got a DOS bomb attack warning in Web UI, and I wanted to work offline, and finding out that this does not work is intimidating. |
I'm more concerned why on earth it would require internet to begin, and be monitoring internet on a localhost session, to then kill my session cause it can't access the outside web. Seems shady without a legitimate reason. It makes sense during installation, but if it's installed, and there is no net, it should skip all this and just launch. But to then disable the actual WebUI once launched, cause internet dies, is fishy. |
@HotChocut I'll take that as some sort of compliment :) And have a look at the repo |
@kiancn it is indeed a complement! Thanks to your solution I was able to get a lot of training done while traveling so I am very grateful! As for the repo all it does is copy the text from launch.py to launch-offline.py, then hash out the line such as in your solution, then copies webui.bat to webui-offline.bat and changes it to use launch-offline.py instead of launch.py so that both launch-offline.py and webui-offline.bat are up-to-date every time you run webui-user-offline.bat to launch stable diffusion without internet. I could definitely improve webui-offline-setup.bat as right now it's just a slightly changed webui.bat but I'm not particularly familiar with python so I just left it as is since it worked well enough, if there's something I could do to improve it or if there are any issues please let me know as I am by no means an expert so I'm sure I've overlooked planty of things |
Thank you HotChocut. I went through the trouble of registering just to thank you for sharing the solution which I could find no where else. But also thank you too kiancn for the initial solution. I read it and was sure it was the solution but HotChocut made it easier. And also thank you to maikelsz for bringing up this issue. Im going to assume my problem was that I am using Psiphon for internet connection so its some sort of proxy or maybe bad internet connection through Psiphon (my internet speed is a quarter of 1MB and always disconnecting every few mins) - I assume this because I initially got SD working fine using a solid public wifi connection. I come home and poo. Nothing works. So with this offline solution I can finally sit for 10 to 20 minutes to see what kind of images an AI can generate these days, I apologize for the long post. |
@kiancn this worked for me, ty |
* 🔊 Add logger * nits
at each start SDWebUI tries to install something from the web: "Installing requirements for Web UI". and if there is no connection, everything fails. if there is a connection at least during startup, then it can continue to work without the need for connectivity.
Is there any chance that what it wants to install will be cached?
Or that what is already installed is used, and updates are only made when there is a connection?
in summary:
-after install, no need of internet connection.
-offline works
-if there is connectivity, then update the modules
it is to be able to use SDWebUI on other PCs, and offline.for example, on laptops during travel or places without any connectivity (yes, I can do it with a hotspot on the mobile phone, but still)
-be able to copy the install folder to different PCs, so there is no need to download and install everything again on each one. maybe in some file it is necessary to change a path. so I can update in one PC and then just copy to the rest.
before SDWebUI I manage to run the SDUI project. this one need something form the huginface web. or wont work, BUT, sometimes works without it, and then starts and work offline. still trying to find what is is
The text was updated successfully, but these errors were encountered: