diff --git a/modules/config.py b/modules/config.py index 001cf949d..8609b4154 100644 --- a/modules/config.py +++ b/modules/config.py @@ -520,10 +520,14 @@ def init_temp_path(path: str | None, default_path: str) -> str: image_count += 1 default_ip_images[image_count] = get_config_item_or_set_default( key=f'default_ip_image_{image_count}', - default_value=None, - validator=lambda x: x is None or isinstance(x, str) and os.path.exists(x), + default_value='None', + validator=lambda x: x == 'None' or isinstance(x, str) and os.path.exists(x), expected_type=str ) + + if default_ip_images[image_count] == 'None': + default_ip_images[image_count] = None + default_ip_types[image_count] = get_config_item_or_set_default( key=f'default_ip_type_{image_count}', default_value=modules.flags.default_ip, @@ -698,7 +702,7 @@ def init_temp_path(path: str | None, default_path: str) -> str: default_inpaint_mask_sam_model = get_config_item_or_set_default( key='default_inpaint_mask_sam_model', default_value='vit_b', - validator=lambda x: x in [y[1] for y in modules.flags.inpaint_mask_sam_model if y[1] == x], + validator=lambda x: x in modules.flags.inpaint_mask_sam_model, expected_type=str )