Skip to content

Commit c08518a

Browse files
committed
feat: add backwards compatibility for presets without disable/enable LoRA boolean
lllyasviel#2507
1 parent 6b44c10 commit c08518a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/config.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,12 @@ def init_temp_path(path: str | None, default_path: str) -> str:
323323
1.0
324324
]
325325
],
326-
validator=lambda x: isinstance(x, list) and all(len(y) == 3 and isinstance(y[0], bool) and isinstance(y[1], str) and isinstance(y[2], numbers.Number) for y in x)
326+
validator=lambda x: isinstance(x, list) and all(
327+
len(y) == 3 and isinstance(y[0], bool) and isinstance(y[1], str) and isinstance(y[2], numbers.Number)
328+
or len(y) == 2 and isinstance(y[0], str) and isinstance(y[1], numbers.Number)
329+
for y in x)
327330
)
331+
default_loras = [(y[0], y[1], y[2]) if len(y) == 3 else (True, y[0], y[1]) for y in default_loras]
328332
default_max_lora_number = get_config_item_or_set_default(
329333
key='default_max_lora_number',
330334
default_value=len(default_loras) if isinstance(default_loras, list) and len(default_loras) > 0 else 5,

0 commit comments

Comments
 (0)