From b14d8b8980a86b1d2a161fb2f59673b421680812 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Fri, 12 Apr 2024 07:28:42 -0400 Subject: [PATCH] theme fallback --- CHANGELOG.md | 2 +- modules/theme.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae403696f..240a022fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ - PixArt-Σ requires `diffusers-0.28.0.dev0` -## Update for 2024-04-11 +## Update for 2024-04-12 - **Features**: - **Gallery**: list, preview, search through all your images and videos! diff --git a/modules/theme.py b/modules/theme.py index 5921ce957..c840457aa 100644 --- a/modules/theme.py +++ b/modules/theme.py @@ -61,6 +61,12 @@ def list_themes(): modules.shared.log.debug(f'UI themes available: type={modules.shared.opts.theme_type} themes={len(builtin)}') elif modules.shared.opts.theme_type == 'Modern': ext = next((e for e in modules.extensions.extensions if e.name == 'sdnext-ui-ux'), None) + if ext is None: + modules.shared.log.error('UI themes: ModernUI not found') + builtin = list_builtin_themes() + themes = sorted(builtin) + modules.shared.opts.theme_type = 'Standard' + return themes folder = os.path.join(ext.path, 'themes') themes = [] if os.path.exists(folder):