From 727293d722a946d837139ad9a95e44a56ca36ca3 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Sun, 18 Jun 2023 08:26:25 +1200 Subject: [PATCH] fix: 2.1 models breaking generation Co-Authored-By: StAlKeR7779 <7768370+StAlKeR7779@users.noreply.github.com> --- invokeai/backend/model_management/models/base.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/invokeai/backend/model_management/models/base.py b/invokeai/backend/model_management/models/base.py index ac43b938b0..f32e658aa1 100644 --- a/invokeai/backend/model_management/models/base.py +++ b/invokeai/backend/model_management/models/base.py @@ -94,6 +94,11 @@ class ModelBase(metaclass=ABCMeta): def _hf_definition_to_type(self, subtypes: List[str]) -> Type: if len(subtypes) < 2: raise Exception("Invalid subfolder definition!") + if all(t is None for t in subtypes): + return None + elif any(t is None for t in subtypes): + raise Exception(f"Unsupported definition: {subtypes}") + if subtypes[0] in ["diffusers", "transformers"]: res_type = sys.modules[subtypes[0]] subtypes = subtypes[1:]