From 81dee04dc9d4f262b7c1a3453ee7c0662a64d3db Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Sun, 5 Mar 2023 08:40:03 -0500 Subject: [PATCH] during migration do not overwrite symlinks --- invokeai/backend/config/model_install_backend.py | 1 - invokeai/backend/model_management/model_manager.py | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/invokeai/backend/config/model_install_backend.py b/invokeai/backend/config/model_install_backend.py index 1180991d06..b5110c53ea 100644 --- a/invokeai/backend/config/model_install_backend.py +++ b/invokeai/backend/config/model_install_backend.py @@ -270,7 +270,6 @@ def _download_diffusion_weights( path = download_from_hf( model_class, repo_id, - cache_subdir="diffusers", safety_checker=None, **extra_args, ) diff --git a/invokeai/backend/model_management/model_manager.py b/invokeai/backend/model_management/model_manager.py index aa74cc697d..f559fb6e46 100644 --- a/invokeai/backend/model_management/model_manager.py +++ b/invokeai/backend/model_management/model_manager.py @@ -955,7 +955,9 @@ class ModelManager(object): continue print(f"** {source} => {dest}") if source.exists(): - if dest.exists(): + if dest.is_symlink(): + print(f"** Found symlink at {dest.name}. Not migrating.") + elif dest.exists(): rmtree(source) else: move(source, dest)