diff --git a/modules/styles.py b/modules/styles.py index a13da7bcd..a959fac89 100644 --- a/modules/styles.py +++ b/modules/styles.py @@ -65,7 +65,7 @@ class StyleDatabase: def reload(self): self.styles.clear() for fn in os.listdir(self.path): - if not fn.endswith(".json"): + if not fn.lower().endswith(".json"): continue with open(os.path.join(self.path, fn), 'r', encoding='utf-8') as f: try: diff --git a/modules/ui_extra_networks.py b/modules/ui_extra_networks.py index 1f5274e1f..459851ada 100644 --- a/modules/ui_extra_networks.py +++ b/modules/ui_extra_networks.py @@ -369,6 +369,7 @@ def create_ui(container, button, tabname, skip_indexing = False): for page in extra_pages: if title == '' or title == page.title or len(page.html) == 0: page.refresh() + page.refresh_time = None page.create_page(ui.tabname) shared.log.debug(f"Refreshing Extra networks: page={page.title} items={len(page.items)} tab={ui.tabname}") res.append(page.html) diff --git a/modules/ui_extra_networks_styles.py b/modules/ui_extra_networks_styles.py index 2ccbed93b..974ea0614 100644 --- a/modules/ui_extra_networks_styles.py +++ b/modules/ui_extra_networks_styles.py @@ -13,20 +13,19 @@ class ExtraNetworksPageStyles(ui_extra_networks.ExtraNetworksPage): shared.prompt_styles.reload() def list_items(self): - styles = list(shared.prompt_styles.styles) - for style in styles: - path = os.path.join(shared.opts.styles_dir, style) - txt = f'Prompt: {shared.prompt_styles.styles[style].prompt}' - negative = shared.prompt_styles.styles[style].negative_prompt + for k in shared.prompt_styles.styles.keys(): + path = os.path.join(shared.opts.styles_dir, k) + txt = f'Prompt: {shared.prompt_styles.styles[k].prompt}' + negative = shared.prompt_styles.styles[k].negative_prompt if negative is not None and len(negative) > 0: txt += f'\nNegative: {negative}' yield { - "name": style, + "name": k, "search_term": path, "filename": path, "preview": self.find_preview(path), "description": txt, - "onclick": '"' + html.escape(f"""return selectStyle({json.dumps(style)})""") + '"', + "onclick": '"' + html.escape(f"""return selectStyle({json.dumps(k)})""") + '"', "local_preview": f"{path}.{shared.opts.samples_format}", }