feat: allow to add disabled LoRAs in config on application start (#2507)

add LoRA checkbox enable/disable handling to all necessary occurrences
This commit is contained in:
Manuel Schmid
2024-03-11 17:59:58 +01:00
committed by GitHub
parent 2831dc70a7
commit 39669453cd
8 changed files with 43 additions and 10 deletions
+8 -5
View File
@@ -73,14 +73,17 @@ class StableDiffusionModel:
loras_to_load = []
for name, weight in loras:
if name == 'None':
for enabled, filename, weight in loras:
if not enabled:
continue
if os.path.exists(name):
lora_filename = name
if filename == 'None':
continue
if os.path.exists(filename):
lora_filename = filename
else:
lora_filename = get_file_from_folder_list(name, modules.config.paths_loras)
lora_filename = get_file_from_folder_list(filename, modules.config.paths_loras)
if not os.path.exists(lora_filename):
print(f'Lora file not found: {lora_filename}')