From 26cff4557c7d1eba5ada9beffdb04d61c05a027d Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Sun, 16 Jun 2024 08:00:35 -0400 Subject: [PATCH] handle fallback theme --- CHANGELOG.md | 23 ++++++++++++++++------- modules/shared.py | 5 +++-- modules/theme.py | 4 +++- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e25dfff1..f3b797be4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,26 @@ # Change Log for SD.Next +## Pending + +- Diffusers==0.30.0 +- https://github.com/huggingface/diffusers/issues/8579 +- https://github.com/huggingface/diffusers/issues/8546 +- https://github.com/huggingface/diffusers/pull/8566 +- https://github.com/huggingface/diffusers/pull/8506 + ## Update for 2024-06-15 -- sd3 enable taesd preview and non-full quality mode -- sd3 simplified loading of model in single-file safetensors format -- css tweaks for standardui -- force apply vae config on model load - fix unsaturated outputs -- restructure api examples: `cli/api-*` +- support for `torch-directml` **0.2.2**, thanks @lshqqytiger! +- **sd3** enable taesd preview and non-full quality mode +- **sd3** simplified loading of model in single-file safetensors format +- fix unsaturated outputs, force apply vae config on model load - fix control second pass resize - fix api face-hires -- fix hunyuandit set attention processor +- fix **hunyuandit** set attention processor - fix civitai download without name +- css tweaks for standardui +- restructure api examples: `cli/api-*` +- handle theme fallback when invalid theme is specified ## Update for 2024-06-13 diff --git a/modules/shared.py b/modules/shared.py index 571f06052..91638dd1c 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -330,8 +330,9 @@ def temp_disable_extensions(): modules.shared.opts.data['theme_type'] = 'None' modules.shared.opts.data['gradio_theme'] = theme_name else: - modules.shared.opts.data['theme_type'] = 'None' - modules.shared.opts.data['gradio_theme'] = theme_name + modules.shared.log.error(f'UI theme invalid: theme="{theme_name}" available={["standard/*", "modern/*", "none/*"]} fallback="standard/black-teal"') + modules.shared.opts.data['theme_type'] = 'Standard' + modules.shared.opts.data['gradio_theme'] = 'black-teal' for ext in disable_themes: if ext.lower() not in opts.disabled_extensions: diff --git a/modules/theme.py b/modules/theme.py index 8dfde3e22..26bb39858 100644 --- a/modules/theme.py +++ b/modules/theme.py @@ -91,7 +91,6 @@ def reload_gradio_theme(): 'font_mono':['IBM Plex Mono', 'ui-monospace', 'Consolas', 'monospace'] } gradio_theme = gr.themes.Base(**default_font_params) - available_themes = list_themes() if theme_name not in available_themes: modules.shared.log.error(f'UI theme invalid: type={modules.shared.opts.theme_type} theme="{theme_name}" available={available_themes}') @@ -99,6 +98,9 @@ def reload_gradio_theme(): theme_name = 'black-teal' elif modules.shared.opts.theme_type == 'Modern': theme_name = 'Default' + else: + modules.shared.opts.theme_type = 'Standard' + theme_name = 'black-teal' modules.shared.opts.data['gradio_theme'] = theme_name