@@ -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
0 commit comments