diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-01-21 20:11:37 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-01-21 20:11:37 +0000 |
commit | 500d9a32c7b1f877c8f44159a9a10c594b545a80 (patch) | |
tree | 8b4a938b1c9b8af9fe0b99478f91ed0ec070a22a /extensions-builtin/Lora/lora.py | |
parent | 4a8fe09652b304034708d967c47901312940e852 (diff) | |
download | stable-diffusion-webui-gfx803-500d9a32c7b1f877c8f44159a9a10c594b545a80.tar.gz stable-diffusion-webui-gfx803-500d9a32c7b1f877c8f44159a9a10c594b545a80.tar.bz2 stable-diffusion-webui-gfx803-500d9a32c7b1f877c8f44159a9a10c594b545a80.zip |
add --lora-dir commandline option
Diffstat (limited to 'extensions-builtin/Lora/lora.py')
-rw-r--r-- | extensions-builtin/Lora/lora.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/extensions-builtin/Lora/lora.py b/extensions-builtin/Lora/lora.py index 6d860224..da1797dc 100644 --- a/extensions-builtin/Lora/lora.py +++ b/extensions-builtin/Lora/lora.py @@ -177,12 +177,12 @@ def lora_Conv2d_forward(self, input): def list_available_loras():
available_loras.clear()
- os.makedirs(lora_dir, exist_ok=True)
+ os.makedirs(shared.cmd_opts.lora_dir, exist_ok=True)
candidates = \
- glob.glob(os.path.join(lora_dir, '**/*.pt'), recursive=True) + \
- glob.glob(os.path.join(lora_dir, '**/*.safetensors'), recursive=True) + \
- glob.glob(os.path.join(lora_dir, '**/*.ckpt'), recursive=True)
+ 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)
for filename in sorted(candidates):
if os.path.isdir(filename):
@@ -193,7 +193,6 @@ def list_available_loras(): available_loras[name] = LoraOnDisk(name, filename)
-lora_dir = os.path.join(shared.models_path, "Lora")
available_loras = {}
loaded_loras = []
|