Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion invokeai/backend/model_management/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@
load_pipeline_from_original_stable_diffusion_ckpt,
)
from .model_manager import ModelManager
from invokeai.frontend.merge import merge_diffusion_models

21 changes: 16 additions & 5 deletions invokeai/backend/model_management/model_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ def import_diffuser_model(
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:
Expand Down Expand Up @@ -941,7 +941,7 @@ def migrate_models(cls):
"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:
Expand All @@ -950,9 +950,17 @@ def migrate_models(cls):
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 <enter> 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():
Expand All @@ -971,7 +979,10 @@ def migrate_models(cls):
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)

Expand Down
2 changes: 1 addition & 1 deletion invokeai/frontend/web/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -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