From e3b72bdb71fc506571044bbb37a16f6cc1c83fcc Mon Sep 17 00:00:00 2001 From: w-e-w <40751091+w-e-w@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:40:39 +0900 Subject: [PATCH] fix calling extraNetworksSetup twise this also has the added effect of moving the controls the right side as it was previously blocked by a invisible duplicate element --- javascript/extraNetworks.js | 5 ++--- modules/ui_extra_networks.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/javascript/extraNetworks.js b/javascript/extraNetworks.js index 63a150827..b284cc77e 100644 --- a/javascript/extraNetworks.js +++ b/javascript/extraNetworks.js @@ -2167,7 +2167,7 @@ async function extraNetworksSetupTab(tabname) { } } -async function extraNetworksSetup() { +async function extraNetworksSetup(tabname) { /** Sets up all tabs for extra networks. * * This function is called from `modules/ui_extra_networks.py::create_ui()` @@ -2177,8 +2177,7 @@ async function extraNetworksSetup() { await waitForBool(initialUiOptionsLoaded); extra_networks_setup_debounce_timer = setTimeout(async() => { await Promise.all([ - extraNetworksSetupTab('txt2img'), - extraNetworksSetupTab('img2img'), + extraNetworksSetupTab(tabname), ]); extraNetworksSetupEventDelegators(); extra_networks_setup_debounce_timer = null; diff --git a/modules/ui_extra_networks.py b/modules/ui_extra_networks.py index 7009f4d10..1f13f6241 100644 --- a/modules/ui_extra_networks.py +++ b/modules/ui_extra_networks.py @@ -1450,7 +1450,7 @@ def create_ui(interface: gr.Blocks, unrelated_tabs, tabname): _js="setupAllResizeHandles", ).then( fn=lambda: None, - _js="extraNetworksSetup", + _js="function(){extraNetworksSetup('" + tabname + "')}", ) return ui