Skip to content

Commit a305b6a

Browse files
authored
fix call signature of import_diffuser_model() (#2871)
This fixes the borked #2867 PR.
2 parents 9013371 + 94daaa4 commit a305b6a

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

invokeai/backend/model_management/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@
66
load_pipeline_from_original_stable_diffusion_ckpt,
77
)
88
from .model_manager import ModelManager
9-
from invokeai.frontend.merge import merge_diffusion_models
109

invokeai/backend/model_management/model_manager.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ def import_diffuser_model(
538538
self,
539539
repo_or_path: Union[str, Path],
540540
model_name: str = None,
541-
model_description: str = None,
541+
description: str = None,
542542
vae: dict = None,
543543
commit_to_conf: Path = None,
544544
) -> bool:
@@ -941,7 +941,7 @@ def migrate_models(cls):
941941
"openai/clip-vit-large-patch14/models--openai--clip-vit-large-patch14"
942942
),
943943
]
944-
legacy_locations.extend(list(Path(models_dir,"diffusers").glob('*')))
944+
legacy_locations.extend(list(global_cache_dir("diffusers").glob('*')))
945945

946946
legacy_layout = False
947947
for model in legacy_locations:
@@ -950,9 +950,17 @@ def migrate_models(cls):
950950
return
951951

952952
print(
953-
"** Old model directory layout (< v3.0) detected. Reorganizing."
953+
"""
954+
>> ALERT:
955+
>> The location of your previously-installed diffusers models needs to move from
956+
>> invokeai/models/diffusers to invokeai/models/hub due to a change introduced by
957+
>> diffusers version 0.14. InvokeAI will now move all models from the "diffusers" directory
958+
>> into "hub" and then remove the diffusers directory. This is a quick, safe, one-time
959+
>> operation. However if you have customized either of these directories and need to
960+
>> make adjustments, please press ctrl-C now to abort and relaunch InvokeAI when you are ready.
961+
>> Otherwise press <enter> to continue."""
954962
)
955-
print("** This is a quick one-time operation.")
963+
input('continue> ')
956964

957965
# transformer files get moved into the hub directory
958966
if cls._is_huggingface_hub_directory_present():
@@ -971,7 +979,10 @@ def migrate_models(cls):
971979
if dest.is_symlink():
972980
print(f"** Found symlink at {dest.name}. Not migrating.")
973981
elif dest.exists():
974-
rmtree(source)
982+
if source.is_dir():
983+
rmtree(source)
984+
else:
985+
source.unlink()
975986
else:
976987
move(source, dest)
977988

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4-
cd invokeai/frontend/ && npm run lint-staged
4+
cd invokeai/frontend/web && npm run lint-staged

0 commit comments

Comments
 (0)