From fc187f263e7fa42dd2afaf8cb8c21ebc4e8124d0 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Sun, 5 Mar 2023 12:29:52 -0500 Subject: [PATCH] deal with non-directories in diffusers/ --- invokeai/backend/model_management/model_manager.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/invokeai/backend/model_management/model_manager.py b/invokeai/backend/model_management/model_manager.py index abd0a0a30d..9e6d23cddd 100644 --- a/invokeai/backend/model_management/model_manager.py +++ b/invokeai/backend/model_management/model_manager.py @@ -966,7 +966,10 @@ class ModelManager(object): 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)