diff --git a/html/extra-networks-btn-dirs-view-item.html b/html/extra-networks-btn-dirs-view-item.html index 63b2a64ea..7146a542d 100644 --- a/html/extra-networks-btn-dirs-view-item.html +++ b/html/extra-networks-btn-dirs-view-item.html @@ -1,5 +1,6 @@ \ No newline at end of file +>{label} diff --git a/modules/shared_options.py b/modules/shared_options.py index 605bbd803..34d20595a 100644 --- a/modules/shared_options.py +++ b/modules/shared_options.py @@ -250,8 +250,8 @@ options_templates.update(options_section(('interrogate', "Interrogate"), { })) options_templates.update(options_section(('extra_networks', "Extra Networks", "sd"), { - "extra_networks_show_hidden_directories": OptionInfo(True, "Show hidden directories").info("directory is hidden if its name starts with \".\"."), - "extra_networks_hidden_models": OptionInfo("When searched", "Show cards for models in hidden directories", gr.Radio, {"choices": ["Always", "When searched", "Never"]}).info('"When searched" option will only show the item when the search string has 4 characters or more'), + "extra_networks_show_hidden_directories": OptionInfo(True, "Show hidden directories").info("directory is hidden if its name starts with \".\".").needs_reload_ui(), + "extra_networks_hidden_models": OptionInfo("When searched", "Show cards for models in hidden directories", gr.Radio, {"choices": ["Always", "When searched", "Never"]}).info('"When searched" option will only show the item when the search string has 4 characters or more').needs_reload_ui(), "extra_networks_default_multiplier": OptionInfo(1.0, "Default multiplier for extra networks", gr.Slider, {"minimum": 0.0, "maximum": 2.0, "step": 0.01}), "extra_networks_card_width": OptionInfo(0, "Card width for Extra Networks").info("in pixels"), "extra_networks_card_height": OptionInfo(0, "Card height for Extra Networks").info("in pixels"), diff --git a/modules/ui_extra_networks.py b/modules/ui_extra_networks.py index 89db499d6..74383e371 100644 --- a/modules/ui_extra_networks.py +++ b/modules/ui_extra_networks.py @@ -678,18 +678,25 @@ class ExtraNetworksPage: tree.values(), key=lambda x: shared.natural_sort_key(x.relpath), ) - dirs_html = "".join( - [ + dirs_html = [] + for node in dir_nodes: + if node.parent is None: + label = node.relpath + else: + label = os.sep.join(node.relpath.split(os.sep)[1:]) + + dirs_html.append( self.btn_dirs_view_item_tpl.format( **{ "extra_class": "search-all" if node.relpath == "" else "", "tabname_full": f"{tabname}_{self.extra_networks_tabname}", + "title": html.escape(node.abspath), "path": html.escape(node.relpath), + "label": html.escape(label), } ) - for node in dir_nodes - ] - ) + ) + dirs_html = "".join(dirs_html) return dirs_html