From bf1f6619df0c748656f807b4ab0078b5af432e8f Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Wed, 26 Jul 2023 15:02:32 -0400 Subject: [PATCH 1/2] fix conversion for sd1 and sd2 models --- .../backend/model_management/models/stable_diffusion.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/invokeai/backend/model_management/models/stable_diffusion.py b/invokeai/backend/model_management/models/stable_diffusion.py index 735e2e6bfb..64dbd1c9ee 100644 --- a/invokeai/backend/model_management/models/stable_diffusion.py +++ b/invokeai/backend/model_management/models/stable_diffusion.py @@ -14,6 +14,7 @@ from .base import ( read_checkpoint_meta, classproperty, InvalidModelException, + ModelNotFoundException, ) from .sdxl import StableDiffusionXLModel import invokeai.backend.util.logging as logger @@ -268,12 +269,17 @@ def _convert_ckpt_and_cache( # to avoid circular import errors from ..convert_ckpt_to_diffusers import convert_ckpt_to_diffusers from ...util.devices import choose_torch_device, torch_dtype - + + model_base_to_model_type = {BaseModelType.StableDiffusion1: 'FrozenCLIPEmbedder', + BaseModelType.StableDiffusion2: 'FrozenOpenCLIPEmbedder', + } + logger.info(f'Converting {weights} to diffusers format') with SilenceWarnings(): convert_ckpt_to_diffusers( weights, output_path, + model_type=model_base_to_model_type[version], model_version=version, model_variant=model_config.variant, original_config_file=config_file, From 020031f376bca74bb1e6a93f3507f47517a56017 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Wed, 26 Jul 2023 15:17:00 -0400 Subject: [PATCH 2/2] add all legacy model .yaml files to configs directory unconditionally --- invokeai/backend/install/invokeai_configure.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/invokeai/backend/install/invokeai_configure.py b/invokeai/backend/install/invokeai_configure.py index cd4ad1c798..0d3f98155c 100755 --- a/invokeai/backend/install/invokeai_configure.py +++ b/invokeai/backend/install/invokeai_configure.py @@ -767,8 +767,8 @@ def main(): if migrate_if_needed(opt, config.root_path): sys.exit(0) - if not config.model_conf_path.exists(): - initialize_rootdir(config.root_path, opt.yes_to_all) + # run this unconditionally in case new directories need to be added + initialize_rootdir(config.root_path, opt.yes_to_all) models_to_download = default_user_selections(opt) new_init_file = config.root_path / 'invokeai.yaml'