From c08518abae926d596ac5095ba8af7c3c3d88cc4d Mon Sep 17 00:00:00 2001 From: Manuel Schmid Date: Mon, 18 Mar 2024 17:40:37 +0100 Subject: [PATCH] feat: add backwards compatibility for presets without disable/enable LoRA boolean https://github.com/lllyasviel/Fooocus/pull/2507 --- modules/config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/config.py b/modules/config.py index c82f61c..f3bf7f1 100644 --- a/modules/config.py +++ b/modules/config.py @@ -323,8 +323,12 @@ default_loras = get_config_item_or_set_default( 1.0 ] ], - 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) + 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) + or len(y) == 2 and isinstance(y[0], str) and isinstance(y[1], numbers.Number) + for y in x) ) +default_loras = [(y[0], y[1], y[2]) if len(y) == 3 else (True, y[0], y[1]) for y in default_loras] default_max_lora_number = get_config_item_or_set_default( key='default_max_lora_number', default_value=len(default_loras) if isinstance(default_loras, list) and len(default_loras) > 0 else 5,