fix call signature of import_diffuser_model()

This commit is contained in:
Lincoln Stein 2023-03-05 23:37:59 -05:00
parent 901337186d
commit 94daaa4abf
3 changed files with 17 additions and 7 deletions

View File

@ -6,5 +6,4 @@ from .convert_ckpt_to_diffusers import (
load_pipeline_from_original_stable_diffusion_ckpt, load_pipeline_from_original_stable_diffusion_ckpt,
) )
from .model_manager import ModelManager from .model_manager import ModelManager
from invokeai.frontend.merge import merge_diffusion_models

View File

@ -538,7 +538,7 @@ class ModelManager(object):
self, self,
repo_or_path: Union[str, Path], repo_or_path: Union[str, Path],
model_name: str = None, model_name: str = None,
model_description: str = None, description: str = None,
vae: dict = None, vae: dict = None,
commit_to_conf: Path = None, commit_to_conf: Path = None,
) -> bool: ) -> bool:
@ -941,7 +941,7 @@ class ModelManager(object):
"openai/clip-vit-large-patch14/models--openai--clip-vit-large-patch14" "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 legacy_layout = False
for model in legacy_locations: for model in legacy_locations:
@ -950,9 +950,17 @@ class ModelManager(object):
return return
print( 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 # transformer files get moved into the hub directory
if cls._is_huggingface_hub_directory_present(): if cls._is_huggingface_hub_directory_present():
@ -971,7 +979,10 @@ class ModelManager(object):
if dest.is_symlink(): if dest.is_symlink():
print(f"** Found symlink at {dest.name}. Not migrating.") print(f"** Found symlink at {dest.name}. Not migrating.")
elif dest.exists(): elif dest.exists():
rmtree(source) if source.is_dir():
rmtree(source)
else:
source.unlink()
else: else:
move(source, dest) move(source, dest)

View File

@ -1,4 +1,4 @@
#!/usr/bin/env sh #!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh" . "$(dirname -- "$0")/_/husky.sh"
cd invokeai/frontend/ && npm run lint-staged cd invokeai/frontend/web && npm run lint-staged