aboutsummaryrefslogtreecommitdiffstats
path: root/extensions-builtin/Lora/lora.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-05-08 08:33:45 +0000
committerAUTOMATIC <16777216c@gmail.com>2023-05-08 08:33:45 +0000
commit083dc3c76ab7dbc7b2b04f3396d4f5280b002906 (patch)
tree2cc1ea2ab9cf9cb59655fae23a661868adfce871 /extensions-builtin/Lora/lora.py
parent855f83f92c7f951683d3c664c58f4b37017b8d32 (diff)
downloadstable-diffusion-webui-gfx803-083dc3c76ab7dbc7b2b04f3396d4f5280b002906.tar.gz
stable-diffusion-webui-gfx803-083dc3c76ab7dbc7b2b04f3396d4f5280b002906.tar.bz2
stable-diffusion-webui-gfx803-083dc3c76ab7dbc7b2b04f3396d4f5280b002906.zip
directory hiding for extra networks: dirs starting with . will hide their cards on extra network tabs unless specifically searched for
create HTML for extra network pages only on demand allow directories starting with . to still list their models for lora, checkpoints, etc keep "search" filter for extra networks when user refreshes the page
Diffstat (limited to 'extensions-builtin/Lora/lora.py')
-rw-r--r--extensions-builtin/Lora/lora.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/extensions-builtin/Lora/lora.py b/extensions-builtin/Lora/lora.py
index 83c1c6fd..83933639 100644
--- a/extensions-builtin/Lora/lora.py
+++ b/extensions-builtin/Lora/lora.py
@@ -352,11 +352,7 @@ def list_available_loras():
os.makedirs(shared.cmd_opts.lora_dir, exist_ok=True)
- candidates = \
- glob.glob(os.path.join(shared.cmd_opts.lora_dir, '**/*.pt'), recursive=True) + \
- glob.glob(os.path.join(shared.cmd_opts.lora_dir, '**/*.safetensors'), recursive=True) + \
- glob.glob(os.path.join(shared.cmd_opts.lora_dir, '**/*.ckpt'), recursive=True)
-
+ candidates = list(shared.walk_files(shared.cmd_opts.lora_dir, allowed_extensions=[".pt", ".ckpt", ".safetensors"]))
for filename in sorted(candidates, key=str.lower):
if os.path.isdir(filename):
continue