aboutsummaryrefslogtreecommitdiffstats
path: root/modules/extra_networks.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2024-01-04 11:09:59 +0300
committerGitHub <noreply@github.com>2024-01-04 11:09:59 +0300
commit149c9d223463c8fc34f53f26ca06e02be4c8835b (patch)
tree6dbb7e0d87e9a392d4f022b90f1f68e2a4b5fd5e /modules/extra_networks.py
parent04a005f0e98ebade44b33237bf4ccaa64f12600a (diff)
parent320a217b78047f30e1aa5e735742669a7f4c6bd8 (diff)
downloadstable-diffusion-webui-gfx803-149c9d223463c8fc34f53f26ca06e02be4c8835b.tar.gz
Merge pull request #14528 from AUTOMATIC1111/mass-file-lister
mass file lister as an attempt to tackle #14507
Diffstat (limited to 'modules/extra_networks.py')
-rw-r--r--modules/extra_networks.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/extra_networks.py b/modules/extra_networks.py
index b9533677..04249dff 100644
--- a/modules/extra_networks.py
+++ b/modules/extra_networks.py
@@ -206,7 +206,7 @@ def parse_prompts(prompts):
return res, extra_data
-def get_user_metadata(filename):
+def get_user_metadata(filename, lister=None):
if filename is None:
return {}
@@ -215,7 +215,8 @@ def get_user_metadata(filename):
metadata = {}
try:
- if os.path.isfile(metadata_filename):
+ exists = lister.exists(metadata_filename) if lister else os.path.exists(metadata_filename)
+ if exists:
with open(metadata_filename, "r", encoding="utf8") as file:
metadata = json.load(file)
except Exception as e: