mirror of
https://github.com/anapnoe/stable-diffusion-webui-ux.git
synced 2026-04-09 10:11:46 +02:00
Fix: force refresh for embedding and hypernetwork tables initialization
This commit is contained in:
@@ -94,8 +94,13 @@ class DatabaseManager:
|
||||
"message": "No valid table types to process"
|
||||
}) + "\n"
|
||||
return
|
||||
|
||||
|
||||
if refresh:
|
||||
for page in pages.values():
|
||||
page.refresh()
|
||||
|
||||
total_items = sum(len(list(page.list_items()) or []) for page in pages.values())
|
||||
|
||||
|
||||
pbar = tqdm(total=total_items, unit='item',
|
||||
bar_format='{l_bar}{bar}| {n_fmt}/{total_fmt} [{percentage:3.0f}%]')
|
||||
|
||||
@@ -78,9 +78,10 @@ def initialize_tables():
|
||||
else:
|
||||
logger.debug("All tables already exist in database")
|
||||
|
||||
initialize_tables()
|
||||
|
||||
def on_ui_tabs():
|
||||
# Make sure tables are initialized when UI loads
|
||||
initialize_tables()
|
||||
|
||||
with gr.Blocks(analytics_enabled=False) as anapnoe_sd_uiux_db:
|
||||
refresh_button = gr.Button("Refresh Database", elem_id="refresh_database")
|
||||
refresh_button.click(fn=initialize_tables, inputs=[], outputs=[])
|
||||
@@ -88,3 +89,4 @@ def on_ui_tabs():
|
||||
return (anapnoe_sd_uiux_db, 'Init DB', 'anapnoe_sd_uiux_db'),
|
||||
|
||||
script_callbacks.on_ui_tabs(on_ui_tabs)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user