Closed neojam closed 1 year ago
same here. how do we fix this?
I've run into this same issue on Ubuntu 22.04
It has been a long running issue with gradio based on my reads. I performed a git pull yesterday and ended up with the same results. Gradio was updated to 3.16 and would no longer load frontend without internet.
I fell back on an older backup where my venv was running Gradio 3.8 and it works fine. Oddly enough the same font.googleapi's references are present in both, so there may have been a change in timeouts (or lack thereof) in the Gradio logic. Pure speculation on my part as I haven't dug very deep on it, but there are other SD/TI bug reports on the same issue. So it seems it is not specific to 1111's repo.
I know that Gradio 3.8 works offline =but= it is also running an older commit of automatic1111. I tried to downgrade gradio on the latest automatic1111 code base and there are a bunch of UI errors that result.
I'll link to other non-automatic1111 reports of the same issue:
https://github.com/gradio-app/gradio/issues/1450
That was my first landing regarding the issue. You can read up on it there as well as the "mentions" at the bottom being linked from other repos. Seems to be a common problem and most of them (outside of the link shown above) seem to be very recent, so some switch probably got thrown recently.
I dont upate often as my use-case is primarily seamless textures, but I do like to check out new features/extentions from time to time (just chose a bad time to try). Will have to pass on it until offline or some sane work around returns, however.
This is and has been a truly incredible project and many many thanks to all involved.
I fell back on an older backup where my venv was running Gradio 3.8
how do you do that!??!
same here. how do we fix this?
In your \stable-diffusion-webui\modules\shared.py
add somewhere at top:
import urllib.request
and replace (at line 632):
def reload_gradio_theme(theme_name=None):
global gradio_theme
if not theme_name:
theme_name = opts.gradio_theme
if theme_name == "Default":
gradio_theme = gr.themes.Default()
else:
try:
gradio_theme = gr.themes.ThemeClass.from_hub(theme_name)
except requests.exceptions.ConnectionError:
print("Can't access HuggingFace Hub, falling back to default Gradio theme")
gradio_theme = gr.themes.Default()
with
def reload_gradio_theme(theme_name=None):
global gradio_theme
if not theme_name:
theme_name = opts.gradio_theme
default_font_params = {}
ret_code = 0
try:
req = urllib.request.Request("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono", method="HEAD")
ret_code = urllib.request.urlopen(req, timeout=3.0).get_code()
except:
ret_code = 0
if (ret_code != 200):
print("No internet access detected, using default fonts")
default_font_params = {
'font':['Helvetica', 'ui-sans-serif', 'system-ui', 'sans-serif'],
'font_mono':['IBM Plex Mono', 'ui-monospace', 'Consolas', 'monospace']
}
if theme_name == "Default":
gradio_theme = gr.themes.Default(**default_font_params)
else:
try:
gradio_theme = gr.themes.ThemeClass.from_hub(theme_name)
except requests.exceptions.ConnectionError:
print("Can't access HuggingFace Hub, falling back to default Gradio theme")
gradio_theme = gr.themes.Default(**default_font_params)
works for me.
borrowed from: https://github.com/vladmandic/automatic/commit/8f236ef022b333f30c8ec17f716dfee52c7ad126
In your \stable-diffusion-webui\modules\shared.py
works here also. will see if it throws any errors in the next few days
Any chance that we get a fully offline mode for Gradio? Something like gradio my_app.py --offline
would be great. A lot of corporate projects operates on a server with no external internet connection. The offline mode doesn't need any fancy CSS or interactive JS rendering, it just have to provide a simple UI interface.
I fell back on an older backup where my venv was running Gradio 3.8
how do you do that!??!
I wish my solution was more profound, but I found out early on in this repo that if you have a version that does what you =need= but want to experiment, just backup the entire directory. I'm running on linux, so it may be different on other platforms, but yeah i just copy the entire stable-diffusion-web-ui folder somewhere on an external drive (usually i remove the model checkpoints first or exclude them in the copy because i back those up separately). Then i'll do my git pull and upgrade the project. If something goes sideways, i just delete the new and copy the original back (to the original folder location). Gradio is packaged nicely inside the /venv folder within the stable-diffusion-web-ui, so the gradio version comes along with it.
i'm sure there are easier/cleaner/official ways to revert, but being self contained after install makes it pretty easy to backup. I know this doesn't help the "after the fact" scenario, but its just what i started doing. The project evolves around a good amount of external dependency. I normally only keep one copy on hand and just replace it as I go through successful upgrades (that way you can revert without an internet connection too! XD ). Sorry it probably wasn't the answer you're looking for.
Any chance that we get a fully offline mode for Gradio? Something like
gradio my_app.py --offline
would be great. A lot of corporate projects operates on a server with no external internet connection. The offline mode doesn't need any fancy CSS or interactive JS rendering, it just have to provide a simple UI interface.
just edit that file and change the code. it works offline with no problems
Oobabooga solved this problem in text-generation-webui by blocking the use of Google fonts. See https://github.com/oobabooga/text-generation-webui/issues/867.
This PR will resolve this, and also remove a phone-home request that Gradio makes, regardless of the value set for GRADIO_ANALYTICS_ENABLED
.
https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/10324
Can we find a solution to this that doesn't require me to edit shared.py file everytime I update automatic1111?
I don't care about the google tracking fonts, include comicsans as default, just let me start this offline if it happens to not have internet at that moment.
Is there an existing issue for this?
What happened?
I cant use WebUI offline anymore after the last big Update from a few days ago. Gradio hangs, showing only rotating squares when you open WebUI-URL.
Its looks like it tries to access following css indefinitely and doesnt work without an access to those: https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600&display=swap
Steps to reproduce the problem
What should have happened?
Commit where the problem happens
somewhere after 22bcc7be
What platforms do you use to access the UI ?
Windows
What browsers do you use to access the UI ?
Mozilla Firefox
Command Line Arguments
List of extensions
None. I cleared the "extensions" DIR for the test
Console logs
Additional information
I was able to reproduce the problem when I was online by blocking access to "fonts.googleapis.com" with umatrix. Only after unblocking the above url i was able to load webui interface.