Skip to content

Commit

Permalink
Merge pull request #10324 from catboxanon/offline
Browse files Browse the repository at this point in the history
Allow web UI to be ran fully offline
  • Loading branch information
AUTOMATIC1111 authored May 13, 2023
2 parents 2b3fc24 + 867c8a1 commit 23b62af
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modules/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,14 +665,19 @@ def reload_gradio_theme(theme_name=None):
if not theme_name:
theme_name = opts.gradio_theme

default_theme_args = dict(
font=["Source Sans Pro", '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()
gradio_theme = gr.themes.Default(**default_theme_args)
else:
try:
gradio_theme = gr.themes.ThemeClass.from_hub(theme_name)
except Exception as e:
errors.display(e, "changing gradio theme")
gradio_theme = gr.themes.Default()
gradio_theme = gr.themes.Default(**default_theme_args)



Expand Down
3 changes: 3 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* temporary fix to load default gradio font in frontend instead of backend */

@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600&display=swap');

/* general gradio fixes */

Expand Down

0 comments on commit 23b62af

Please sign in to comment.