From af044007d56a181d0878ea8d07ebb9160236b368 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Mon, 7 Aug 2023 15:19:49 -0400 Subject: [PATCH] pick correct config file for sdxl models --- invokeai/backend/model_management/model_manager.py | 4 +++- invokeai/backend/model_management/models/sdxl.py | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/invokeai/backend/model_management/model_manager.py b/invokeai/backend/model_management/model_manager.py index 0bad714a17..961980ffd0 100644 --- a/invokeai/backend/model_management/model_manager.py +++ b/invokeai/backend/model_management/model_manager.py @@ -941,7 +941,9 @@ class ModelManager(object): raise DuplicateModelException(f"Model with key {model_key} added twice") model_path = self.relative_model_path(model_path) - model_config: ModelConfigBase = model_class.probe_config(str(model_path)) + model_config: ModelConfigBase = model_class.probe_config( + str(model_path), model_base=cur_base_model + ) self.models[model_key] = model_config new_models_found = True except DuplicateModelException as e: diff --git a/invokeai/backend/model_management/models/sdxl.py b/invokeai/backend/model_management/models/sdxl.py index 7fc3efb77c..1b5d252cb9 100644 --- a/invokeai/backend/model_management/models/sdxl.py +++ b/invokeai/backend/model_management/models/sdxl.py @@ -80,8 +80,10 @@ class StableDiffusionXLModel(DiffusersModel): raise Exception("Unkown stable diffusion 2.* model format") if ckpt_config_path is None: - # TO DO: implement picking - pass + # avoid circular import + from .stable_diffusion import _select_ckpt_config + + ckpt_config_path = _select_ckpt_config(kwargs.get("model_base", BaseModelType.StableDiffusionXL), variant) return cls.create_config( path=path,