aboutsummaryrefslogtreecommitdiffstats
path: root/modules/ui_extensions.py
diff options
context:
space:
mode:
authorspace-nuko <24979496+space-nuko@users.noreply.github.com>2023-03-29 23:55:57 +0000
committerspace-nuko <24979496+space-nuko@users.noreply.github.com>2023-03-29 23:55:57 +0000
commit9b1fa8298127b05c71c4de04bd6f64b72540ef5a (patch)
tree77709eadf8a093e2b4a7eb350e59d79144895875 /modules/ui_extensions.py
parentf3320b802c12f29e5a3201fcc0abfe72be294293 (diff)
downloadstable-diffusion-webui-gfx803-9b1fa8298127b05c71c4de04bd6f64b72540ef5a.tar.gz
stable-diffusion-webui-gfx803-9b1fa8298127b05c71c4de04bd6f64b72540ef5a.tar.bz2
stable-diffusion-webui-gfx803-9b1fa8298127b05c71c4de04bd6f64b72540ef5a.zip
Add filename to UI and config name to filename
Diffstat (limited to 'modules/ui_extensions.py')
-rw-r--r--modules/ui_extensions.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/ui_extensions.py b/modules/ui_extensions.py
index b94b3a3a..b1ef38e2 100644
--- a/modules/ui_extensions.py
+++ b/modules/ui_extensions.py
@@ -61,7 +61,7 @@ def save_config_state(name):
if not name:
name = "Config"
current_config_state["name"] = name
- filename = os.path.join(config_states_dir, datetime.now().strftime("%Y_%m_%d-%H_%M_%S") + ".json")
+ filename = os.path.join(config_states_dir, datetime.now().strftime("%Y_%m_%d-%H_%M_%S") + "_" + name + ".json")
print(f"Saving backup of webui/extension state to {filename}.")
with open(filename, "w", encoding="utf-8") as f:
json.dump(current_config_state, f)
@@ -175,6 +175,7 @@ def update_config_states_table(state_name):
config_name = config_state.get("name", "Config")
created_date = time.asctime(time.gmtime(config_state["created_at"]))
+ filepath = config_state.get("filepath", "<unknown>")
code = f"""<!-- {time.time()} -->"""
@@ -200,6 +201,7 @@ def update_config_states_table(state_name):
style_commit = STYLE_PRIMARY
code += f"""<h2>Config Backup: {config_name}</h2>
+ <span>Filepath: {filepath}</span>
<span>Created at: {created_date}</span>"""
code += f"""<h2>WebUI State</h2>