Skip to content

Commit 08993c0

Browse files
feat(app): delete images instead of using send2trash
Closes #6709
1 parent 571ba87 commit 08993c0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

invokeai/app/services/image_files/image_files_disk.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from PIL import Image, PngImagePlugin
77
from PIL.Image import Image as PILImageType
8-
from send2trash import send2trash
98

109
from invokeai.app.services.image_files.image_files_base import ImageFileStorageBase
1110
from invokeai.app.services.image_files.image_files_common import (
@@ -103,15 +102,15 @@ def delete(self, image_name: str) -> None:
103102
image_path = self.get_path(image_name)
104103

105104
if image_path.exists():
106-
send2trash(image_path)
105+
image_path.unlink()
107106
if image_path in self.__cache:
108107
del self.__cache[image_path]
109108

110109
thumbnail_name = get_thumbnail_name(image_name)
111110
thumbnail_path = self.get_path(thumbnail_name, True)
112111

113112
if thumbnail_path.exists():
114-
send2trash(thumbnail_path)
113+
thumbnail_path.unlink()
115114
if thumbnail_path in self.__cache:
116115
del self.__cache[thumbnail_path]
117116
except Exception as e:

0 commit comments

Comments
 (0)