diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2024-01-03 23:28:05 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2024-01-03 23:28:05 +0000 |
commit | 420f56c2e85ebbd3f530cf2c7b22022fda13ae13 (patch) | |
tree | fc11a8c4cb10138a1673f9b758539ddc37414fca /modules/extra_networks.py | |
parent | 04a005f0e98ebade44b33237bf4ccaa64f12600a (diff) | |
download | stable-diffusion-webui-gfx803-420f56c2e85ebbd3f530cf2c7b22022fda13ae13.tar.gz stable-diffusion-webui-gfx803-420f56c2e85ebbd3f530cf2c7b22022fda13ae13.tar.bz2 stable-diffusion-webui-gfx803-420f56c2e85ebbd3f530cf2c7b22022fda13ae13.zip |
mass file lister as an attempt to tackle #14507
Diffstat (limited to 'modules/extra_networks.py')
-rw-r--r-- | modules/extra_networks.py | 5 |
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:
|