feat(app): delete model_images instead of using send2trash

This commit is contained in:
psychedelicious 2024-08-03 20:18:36 +10:00
parent 08993c0d29
commit 6c4cf58a31

View File

@ -2,7 +2,6 @@ from pathlib import Path
from PIL import Image from PIL import Image
from PIL.Image import Image as PILImageType from PIL.Image import Image as PILImageType
from send2trash import send2trash
from invokeai.app.services.invoker import Invoker from invokeai.app.services.invoker import Invoker
from invokeai.app.services.model_images.model_images_base import ModelImageFileStorageBase from invokeai.app.services.model_images.model_images_base import ModelImageFileStorageBase
@ -70,7 +69,7 @@ class ModelImageFileStorageDisk(ModelImageFileStorageBase):
if not self._validate_path(path): if not self._validate_path(path):
raise ModelImageFileNotFoundException raise ModelImageFileNotFoundException
send2trash(path) path.unlink()
except Exception as e: except Exception as e:
raise ModelImageFileDeleteException from e raise ModelImageFileDeleteException from e