From ed64b9bfed0574735d0b9ab5e7fc40640d376e80 Mon Sep 17 00:00:00 2001 From: JeLuF Date: Fri, 6 Jan 2023 01:41:55 +0100 Subject: [PATCH] Don't crash on unsupported models --- ui/easydiffusion/model_manager.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/easydiffusion/model_manager.py b/ui/easydiffusion/model_manager.py index fefcc916..1666e3ee 100644 --- a/ui/easydiffusion/model_manager.py +++ b/ui/easydiffusion/model_manager.py @@ -44,7 +44,13 @@ def load_default_models(context: Context): for model_type in MODELS_TO_LOAD_ON_START: context.model_paths[model_type] = resolve_model_to_use(model_type=model_type) set_model_config_path(context, model_type) - load_model(context, model_type) + try: + load_model(context, model_type) + except Exception as e: + log.error(f'[red]Error while loading {model_type} model: {context.model_paths[model_type]}[/red]') + log.error(f'[red]Error: {e}[/red]') + log.error(f'[red]Consider to remove the model from the model folder.[red]') + def unload_all(context: Context): for model_type in KNOWN_MODEL_TYPES: