From 4f20a0db2eb369e765fffcda7c0daf306bce2087 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Thu, 9 Oct 2025 12:04:24 +1100 Subject: [PATCH] feat(mm): do not log when multiple non-unknown model matches --- invokeai/backend/model_manager/configs/factory.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/invokeai/backend/model_manager/configs/factory.py b/invokeai/backend/model_manager/configs/factory.py index 7be18014aa..042c08d976 100644 --- a/invokeai/backend/model_manager/configs/factory.py +++ b/invokeai/backend/model_manager/configs/factory.py @@ -408,6 +408,8 @@ class ModelConfigFactory: results[class_name] = e logger.debug(f"Unexpected exception while matching {mod.name} to {config_class.__name__}: {e}") + # Extract just the successful matches + # NOTE: This will include Unknown_Config matches, which we will handle later. matches = [r for r in results.values() if isinstance(r, Config_Base)] if not matches: @@ -443,7 +445,10 @@ class ModelConfigFactory: matches.sort(key=sort_key) - if len(matches) > 1: + # Warn if we have multiple non-unknown matches + has_unknown = any(isinstance(m, Unknown_Config) for m in matches) + real_match_count = len(matches) - (1 if has_unknown else 0) + if real_match_count > 1: logger.warning( f"Multiple model config classes matched for model {mod.path}: {[type(m).__name__ for m in matches]}." )