mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-01-31 02:32:57 +08:00
reduce unnecessary re-indexing extra networks dir
This commit is contained in:
parent
e4dcdcc955
commit
fccd0b00c2
@ -417,21 +417,21 @@ def create_ui(interface: gr.Blocks, unrelated_tabs, tabname):
|
|||||||
|
|
||||||
dropdown_sort.change(fn=lambda: None, _js="function(){ applyExtraNetworkSort('" + tabname + "'); }")
|
dropdown_sort.change(fn=lambda: None, _js="function(){ applyExtraNetworkSort('" + tabname + "'); }")
|
||||||
|
|
||||||
|
def create_html():
|
||||||
|
ui.pages_contents = [pg.create_html(ui.tabname) for pg in ui.stored_extra_pages]
|
||||||
|
|
||||||
def pages_html():
|
def pages_html():
|
||||||
if not ui.pages_contents:
|
if not ui.pages_contents:
|
||||||
return refresh()
|
create_html()
|
||||||
|
|
||||||
return ui.pages_contents
|
return ui.pages_contents
|
||||||
|
|
||||||
def refresh():
|
def refresh():
|
||||||
for pg in ui.stored_extra_pages:
|
for pg in ui.stored_extra_pages:
|
||||||
pg.refresh()
|
pg.refresh()
|
||||||
|
create_html()
|
||||||
ui.pages_contents = [pg.create_html(ui.tabname) for pg in ui.stored_extra_pages]
|
|
||||||
|
|
||||||
return ui.pages_contents
|
return ui.pages_contents
|
||||||
|
|
||||||
interface.load(fn=pages_html, inputs=[], outputs=[*ui.pages])
|
interface.load(fn=pages_html, inputs=[], outputs=ui.pages)
|
||||||
button_refresh.click(fn=refresh, inputs=[], outputs=ui.pages)
|
button_refresh.click(fn=refresh, inputs=[], outputs=ui.pages)
|
||||||
|
|
||||||
return ui
|
return ui
|
||||||
|
Loading…
Reference in New Issue
Block a user