aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSj-Si <sjw.jetty@gmail.com>2024-01-15 18:01:13 -0500
committerSj-Si <sjw.jetty@gmail.com>2024-01-15 18:01:13 -0500
commit1fdc18e6a01eb40889d46fab40f21aa138d64b01 (patch)
tree46d1af8fc5d8183cd53e0370e81d83c346d12ae9
parentf49c220c03f9b6ead18c2e08c04a469bf599b7d9 (diff)
Run linting
-rw-r--r--modules/ui_extra_networks.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/ui_extra_networks.py b/modules/ui_extra_networks.py
index 4ba2bea1..06fa22af 100644
--- a/modules/ui_extra_networks.py
+++ b/modules/ui_extra_networks.py
@@ -13,7 +13,6 @@ import html
from fastapi.exceptions import HTTPException
from modules.infotext_utils import image_from_url_text
-from modules.ui_components import ToolButton
extra_pages = []
allowed_dirs = set()
@@ -225,7 +224,6 @@ class ExtraNetworksPage:
width = f"width: {shared.opts.extra_networks_card_width}px;" if shared.opts.extra_networks_card_width else ''
background_image = f'<img src="{html.escape(preview)}" class="preview" loading="lazy">' if preview else ''
-
onclick = item.get("onclick", None)
if onclick is None:
# Don't quote prompt/neg_prompt since they are stored as js strings already.
@@ -239,7 +237,7 @@ class ExtraNetworksPage:
}
)
onclick = html.escape(onclick)
-
+
btn_copy_path = self.btn_copy_path_tpl.format(**{"filename": item["filename"]})
btn_metadata = ""
metadata = item.get("metadata")
@@ -551,8 +549,6 @@ def pages_in_preferred_order(pages):
return sorted(pages, key=lambda x: tab_scores[x.name])
def create_ui(interface: gr.Blocks, unrelated_tabs, tabname):
- from modules.ui import switch_values_symbol
-
ui = ExtraNetworksUi()
ui.pages = []
ui.pages_contents = []
@@ -588,6 +584,9 @@ def create_ui(interface: gr.Blocks, unrelated_tabs, tabname):
ui.button_save_preview = gr.Button('Save preview', elem_id=tabname+"_save_preview", visible=False)
ui.preview_target_filename = gr.Textbox('Preview save filename', elem_id=tabname+"_preview_filename", visible=False)
+ for tab in unrelated_tabs:
+ tab.select(fn=None, _js='function(){ extraNetworksUrelatedTabSelected("' + tabname + '"); }', inputs=[], outputs=[], show_progress=False)
+
def create_html():
ui.pages_contents = [pg.create_html(ui.tabname) for pg in ui.stored_extra_pages]