mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-08-03 10:50:23 +00:00
add --lora-dir commandline option
This commit is contained in:
@@ -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 = []
|
||||
|
||||
|
Reference in New Issue
Block a user