diff --git a/invokeai/backend/model_management/__init__.py b/invokeai/backend/model_management/__init__.py index cf7527740b..69f449dd45 100644 --- a/invokeai/backend/model_management/__init__.py +++ b/invokeai/backend/model_management/__init__.py @@ -6,5 +6,4 @@ from .convert_ckpt_to_diffusers import ( load_pipeline_from_original_stable_diffusion_ckpt, ) from .model_manager import ModelManager -from invokeai.frontend.merge import merge_diffusion_models diff --git a/invokeai/backend/model_management/model_manager.py b/invokeai/backend/model_management/model_manager.py index 1cbf891423..9a1b7d73b4 100644 --- a/invokeai/backend/model_management/model_manager.py +++ b/invokeai/backend/model_management/model_manager.py @@ -538,7 +538,7 @@ class ModelManager(object): self, repo_or_path: Union[str, Path], model_name: str = None, - model_description: str = None, + description: str = None, vae: dict = None, commit_to_conf: Path = None, ) -> bool: @@ -941,7 +941,7 @@ class ModelManager(object): "openai/clip-vit-large-patch14/models--openai--clip-vit-large-patch14" ), ] - legacy_locations.extend(list(Path(models_dir,"diffusers").glob('*'))) + legacy_locations.extend(list(global_cache_dir("diffusers").glob('*'))) legacy_layout = False for model in legacy_locations: @@ -950,9 +950,17 @@ class ModelManager(object): return print( - "** Old model directory layout (< v3.0) detected. Reorganizing." + """ +>> ALERT: +>> The location of your previously-installed diffusers models needs to move from +>> invokeai/models/diffusers to invokeai/models/hub due to a change introduced by +>> diffusers version 0.14. InvokeAI will now move all models from the "diffusers" directory +>> into "hub" and then remove the diffusers directory. This is a quick, safe, one-time +>> operation. However if you have customized either of these directories and need to +>> make adjustments, please press ctrl-C now to abort and relaunch InvokeAI when you are ready. +>> Otherwise press to continue.""" ) - print("** This is a quick one-time operation.") + input('continue> ') # transformer files get moved into the hub directory if cls._is_huggingface_hub_directory_present(): @@ -971,7 +979,10 @@ class ModelManager(object): if dest.is_symlink(): print(f"** Found symlink at {dest.name}. Not migrating.") elif dest.exists(): - rmtree(source) + if source.is_dir(): + rmtree(source) + else: + source.unlink() else: move(source, dest) diff --git a/invokeai/frontend/web/.husky/pre-commit b/invokeai/frontend/web/.husky/pre-commit index f5a410bda9..096d3759e5 100755 --- a/invokeai/frontend/web/.husky/pre-commit +++ b/invokeai/frontend/web/.husky/pre-commit @@ -1,4 +1,4 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -cd invokeai/frontend/ && npm run lint-staged +cd invokeai/frontend/web && npm run lint-staged