Skip to content

Commit 408a1d6

Browse files
Merge branch 'main' into depth_anything_v2
2 parents 4f8a4b0 + 140670d commit 408a1d6

File tree

21 files changed

+646
-137
lines changed

21 files changed

+646
-137
lines changed

invokeai/app/services/image_files/image_files_disk.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# Copyright (c) 2022 Kyle Schouviller (https://github.com/kyle0654) and the InvokeAI Team
22
from pathlib import Path
33
from queue import Queue
4-
from typing import Dict, Optional, Union
4+
from typing import Optional, Union
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 (
@@ -20,18 +19,12 @@
2019
class DiskImageFileStorage(ImageFileStorageBase):
2120
"""Stores images on disk"""
2221

23-
__output_folder: Path
24-
__cache_ids: Queue # TODO: this is an incredibly naive cache
25-
__cache: Dict[Path, PILImageType]
26-
__max_cache_size: int
27-
__invoker: Invoker
28-
2922
def __init__(self, output_folder: Union[str, Path]):
30-
self.__cache = {}
31-
self.__cache_ids = Queue()
23+
self.__cache: dict[Path, PILImageType] = {}
24+
self.__cache_ids = Queue[Path]()
3225
self.__max_cache_size = 10 # TODO: get this from config
3326

34-
self.__output_folder: Path = output_folder if isinstance(output_folder, Path) else Path(output_folder)
27+
self.__output_folder = output_folder if isinstance(output_folder, Path) else Path(output_folder)
3528
self.__thumbnails_folder = self.__output_folder / "thumbnails"
3629
# Validate required output folders at launch
3730
self.__validate_storage_folders()
@@ -103,15 +96,15 @@ def delete(self, image_name: str) -> None:
10396
image_path = self.get_path(image_name)
10497

10598
if image_path.exists():
106-
send2trash(image_path)
99+
image_path.unlink()
107100
if image_path in self.__cache:
108101
del self.__cache[image_path]
109102

110103
thumbnail_name = get_thumbnail_name(image_name)
111104
thumbnail_path = self.get_path(thumbnail_name, True)
112105

113106
if thumbnail_path.exists():
114-
send2trash(thumbnail_path)
107+
thumbnail_path.unlink()
115108
if thumbnail_path in self.__cache:
116109
del self.__cache[thumbnail_path]
117110
except Exception as e:

invokeai/app/services/model_images/model_images_default.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from PIL import Image
44
from PIL.Image import Image as PILImageType
5-
from send2trash import send2trash
65

76
from invokeai.app.services.invoker import Invoker
87
from invokeai.app.services.model_images.model_images_base import ModelImageFileStorageBase
@@ -70,7 +69,7 @@ def delete(self, model_key: str) -> None:
7069
if not self._validate_path(path):
7170
raise ModelImageFileNotFoundException
7271

73-
send2trash(path)
72+
path.unlink()
7473

7574
except Exception as e:
7675
raise ModelImageFileDeleteException from e

invokeai/frontend/web/public/locales/de.json

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@
9191
"viewingDesc": "Bilder in großer Galerie ansehen",
9292
"tab": "Tabulator",
9393
"enabled": "Aktiviert",
94-
"disabled": "Ausgeschaltet"
94+
"disabled": "Ausgeschaltet",
95+
"dontShowMeThese": "Zeig mir diese nicht"
9596
},
9697
"gallery": {
9798
"galleryImageSize": "Bildgröße",
@@ -106,7 +107,6 @@
106107
"download": "Runterladen",
107108
"setCurrentImage": "Setze aktuelle Bild",
108109
"featuresWillReset": "Wenn Sie dieses Bild löschen, werden diese Funktionen sofort zurückgesetzt.",
109-
"deleteImageBin": "Gelöschte Bilder werden an den Papierkorb Ihres Betriebssystems gesendet.",
110110
"unableToLoad": "Galerie kann nicht geladen werden",
111111
"downloadSelection": "Auswahl herunterladen",
112112
"currentlyInUse": "Dieses Bild wird derzeit in den folgenden Funktionen verwendet:",
@@ -628,7 +628,10 @@
628628
"private": "Private Ordner",
629629
"shared": "Geteilte Ordner",
630630
"archiveBoard": "Ordner archivieren",
631-
"archived": "Archiviert"
631+
"archived": "Archiviert",
632+
"noBoards": "Kein {boardType}} Ordner",
633+
"hideBoards": "Ordner verstecken",
634+
"viewBoards": "Ordner ansehen"
632635
},
633636
"controlnet": {
634637
"showAdvanced": "Zeige Erweitert",
@@ -943,6 +946,21 @@
943946
"paragraphs": [
944947
"Reduziert das Ausgangsbild auf die Breite und Höhe des Ausgangsbildes. Empfohlen zu aktivieren."
945948
]
949+
},
950+
"structure": {
951+
"paragraphs": [
952+
"Die Struktur steuert, wie genau sich das Ausgabebild an das Layout des Originals hält. Eine niedrige Struktur erlaubt größere Änderungen, während eine hohe Struktur die ursprüngliche Komposition und das Layout strikter beibehält."
953+
]
954+
},
955+
"creativity": {
956+
"paragraphs": [
957+
"Die Kreativität bestimmt den Grad der Freiheit, die dem Modell beim Hinzufügen von Details gewährt wird. Eine niedrige Kreativität hält sich eng an das Originalbild, während eine hohe Kreativität mehr Veränderungen zulässt. Bei der Verwendung eines Prompts erhöht eine hohe Kreativität den Einfluss des Prompts."
958+
]
959+
},
960+
"scale": {
961+
"paragraphs": [
962+
"Die Skalierung steuert die Größe des Ausgabebildes und basiert auf einem Vielfachen der Auflösung des Originalbildes. So würde z. B. eine 2-fache Hochskalierung eines 1024x1024px Bildes eine 2048x2048px große Ausgabe erzeugen."
963+
]
946964
}
947965
},
948966
"invocationCache": {

invokeai/frontend/web/public/locales/en.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,6 @@
374374
"dropToUpload": "$t(gallery.drop) to Upload",
375375
"deleteImage_one": "Delete Image",
376376
"deleteImage_other": "Delete {{count}} Images",
377-
"deleteImageBin": "Deleted images will be sent to your operating system's Bin.",
378377
"deleteImagePermanent": "Deleted images cannot be restored.",
379378
"displayBoardSearch": "Display Board Search",
380379
"displaySearch": "Display Search",
@@ -1054,11 +1053,7 @@
10541053
"remixImage": "Remix Image",
10551054
"usePrompt": "Use Prompt",
10561055
"useSeed": "Use Seed",
1057-
"width": "Width",
1058-
"isAllowedToUpscale": {
1059-
"useX2Model": "Image is too large to upscale with x4 model, use x2 model",
1060-
"tooLarge": "Image is too large to upscale, select smaller image"
1061-
}
1056+
"width": "Width"
10621057
},
10631058
"dynamicPrompts": {
10641059
"showDynamicPrompts": "Show Dynamic Prompts",
@@ -1679,6 +1674,8 @@
16791674
},
16801675
"upscaling": {
16811676
"creativity": "Creativity",
1677+
"exceedsMaxSize": "Upscale settings exceed max size limit",
1678+
"exceedsMaxSizeDetails": "Max upscale limit is {{maxUpscaleDimension}}x{{maxUpscaleDimension}} pixels. Please try a smaller image or decrease your scale selection.",
16821679
"structure": "Structure",
16831680
"upscaleModel": "Upscale Model",
16841681
"postProcessingModel": "Post-Processing Model",

invokeai/frontend/web/public/locales/es.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@
8888
"deleteImage_one": "Eliminar Imagen",
8989
"deleteImage_many": "",
9090
"deleteImage_other": "",
91-
"deleteImageBin": "Las imágenes eliminadas se enviarán a la papelera de tu sistema operativo.",
9291
"deleteImagePermanent": "Las imágenes eliminadas no se pueden restaurar.",
9392
"assets": "Activos",
9493
"autoAssignBoardOnClick": "Asignación automática de tableros al hacer clic"

invokeai/frontend/web/public/locales/it.json

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@
8989
"enabled": "Abilitato",
9090
"disabled": "Disabilitato",
9191
"comparingDesc": "Confronta due immagini",
92-
"comparing": "Confronta"
92+
"comparing": "Confronta",
93+
"dontShowMeThese": "Non mostrarmi questi"
9394
},
9495
"gallery": {
9596
"galleryImageSize": "Dimensione dell'immagine",
@@ -101,7 +102,6 @@
101102
"deleteImage_many": "Elimina {{count}} immagini",
102103
"deleteImage_other": "Elimina {{count}} immagini",
103104
"deleteImagePermanent": "Le immagini eliminate non possono essere ripristinate.",
104-
"deleteImageBin": "Le immagini eliminate verranno spostate nel cestino del tuo sistema operativo.",
105105
"assets": "Risorse",
106106
"autoAssignBoardOnClick": "Assegna automaticamente la bacheca al clic",
107107
"featuresWillReset": "Se elimini questa immagine, quelle funzionalità verranno immediatamente ripristinate.",
@@ -154,7 +154,9 @@
154154
"selectAllOnPage": "Seleziona tutto nella pagina",
155155
"selectAllOnBoard": "Seleziona tutto nella bacheca",
156156
"exitBoardSearch": "Esci da Ricerca bacheca",
157-
"exitSearch": "Esci dalla ricerca"
157+
"exitSearch": "Esci dalla ricerca",
158+
"go": "Vai",
159+
"jump": "Salta"
158160
},
159161
"hotkeys": {
160162
"keyboardShortcuts": "Tasti di scelta rapida",
@@ -571,10 +573,6 @@
571573
},
572574
"useCpuNoise": "Usa la CPU per generare rumore",
573575
"iterations": "Iterazioni",
574-
"isAllowedToUpscale": {
575-
"useX2Model": "L'immagine è troppo grande per l'ampliamento con il modello x4, utilizza il modello x2",
576-
"tooLarge": "L'immagine è troppo grande per l'ampliamento, seleziona un'immagine più piccola"
577-
},
578576
"imageActions": "Azioni Immagine",
579577
"cfgRescaleMultiplier": "Moltiplicatore riscala CFG",
580578
"useSize": "Usa Dimensioni",
@@ -630,7 +628,9 @@
630628
"enableNSFWChecker": "Abilita controllo NSFW",
631629
"enableInvisibleWatermark": "Abilita filigrana invisibile",
632630
"enableInformationalPopovers": "Abilita testo informativo a comparsa",
633-
"reloadingIn": "Ricaricando in"
631+
"reloadingIn": "Ricaricando in",
632+
"informationalPopoversDisabled": "Testo informativo a comparsa disabilitato",
633+
"informationalPopoversDisabledDesc": "I testi informativi a comparsa sono disabilitati. Attivali nelle impostazioni."
634634
},
635635
"toast": {
636636
"uploadFailed": "Caricamento fallito",
@@ -951,7 +951,7 @@
951951
"deleteBoardOnly": "solo la Bacheca",
952952
"deleteBoard": "Elimina Bacheca",
953953
"deleteBoardAndImages": "Bacheca e Immagini",
954-
"deletedBoardsCannotbeRestored": "Le bacheche eliminate non possono essere ripristinate",
954+
"deletedBoardsCannotbeRestored": "Le bacheche eliminate non possono essere ripristinate. Selezionando \"Elimina solo bacheca\" le immagini verranno spostate nella bacheca \"Non categorizzato\".",
955955
"movingImagesToBoard_one": "Spostare {{count}} immagine nella bacheca:",
956956
"movingImagesToBoard_many": "Spostare {{count}} immagini nella bacheca:",
957957
"movingImagesToBoard_other": "Spostare {{count}} immagini nella bacheca:",
@@ -972,7 +972,8 @@
972972
"addPrivateBoard": "Aggiungi una Bacheca Privata",
973973
"noBoards": "Nessuna bacheca {{boardType}}",
974974
"hideBoards": "Nascondi bacheche",
975-
"viewBoards": "Visualizza bacheche"
975+
"viewBoards": "Visualizza bacheche",
976+
"deletedPrivateBoardsCannotbeRestored": "Le bacheche cancellate non possono essere ripristinate. Selezionando 'Cancella solo bacheca', le immagini verranno spostate nella bacheca \"Non categorizzato\" privata dell'autore dell'immagine."
976977
},
977978
"controlnet": {
978979
"contentShuffleDescription": "Rimescola il contenuto di un'immagine",
@@ -1516,6 +1517,30 @@
15161517
"paragraphs": [
15171518
"Metodo con cui applicare l'adattatore IP corrente."
15181519
]
1520+
},
1521+
"scale": {
1522+
"heading": "Scala",
1523+
"paragraphs": [
1524+
"La scala controlla la dimensione dell'immagine di uscita e si basa su un multiplo della risoluzione dell'immagine di ingresso. Ad esempio, un ampliamento 2x su un'immagine 1024x1024 produrrebbe in uscita a 2048x2048."
1525+
]
1526+
},
1527+
"upscaleModel": {
1528+
"paragraphs": [
1529+
"Il modello di ampliamento ridimensiona l'immagine alle dimensioni di uscita prima che vengano aggiunti i dettagli. È possibile utilizzare qualsiasi modello di ampliamento supportato, ma alcuni sono specializzati per diversi tipi di immagini, come foto o disegni al tratto."
1530+
],
1531+
"heading": "Modello di ampliamento"
1532+
},
1533+
"creativity": {
1534+
"heading": "Creatività",
1535+
"paragraphs": [
1536+
"La creatività controlla quanta libertà è concessa al modello quando si aggiungono dettagli. Una creatività bassa rimane vicina all'immagine originale, mentre una creatività alta consente più cambiamenti. Quando si usa un prompt, una creatività alta aumenta l'influenza del prompt."
1537+
]
1538+
},
1539+
"structure": {
1540+
"heading": "Struttura",
1541+
"paragraphs": [
1542+
"La struttura determina quanto l'immagine finale rispecchierà il layout dell'originale. Una struttura bassa permette cambiamenti significativi, mentre una struttura alta conserva la composizione e il layout originali."
1543+
]
15191544
}
15201545
},
15211546
"sdxl": {

invokeai/frontend/web/public/locales/ja.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@
109109
"drop": "ドロップ",
110110
"dropOrUpload": "$t(gallery.drop) またはアップロード",
111111
"deleteImage_other": "画像を削除",
112-
"deleteImageBin": "削除された画像はOSのゴミ箱に送られます。",
113112
"deleteImagePermanent": "削除された画像は復元できません。",
114113
"download": "ダウンロード",
115114
"unableToLoad": "ギャラリーをロードできません",

invokeai/frontend/web/public/locales/ko.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
"gallerySettings": "갤러리 설정",
7171
"deleteSelection": "선택 항목 삭제",
7272
"featuresWillReset": "이 이미지를 삭제하면 해당 기능이 즉시 재설정됩니다.",
73-
"deleteImageBin": "삭제된 이미지는 운영 체제의 Bin으로 전송됩니다.",
7473
"assets": "자산",
7574
"problemDeletingImagesDesc": "하나 이상의 이미지를 삭제할 수 없습니다",
7675
"noImagesInGallery": "보여줄 이미지가 없음",

invokeai/frontend/web/public/locales/nl.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@
9797
"noImagesInGallery": "Geen afbeeldingen om te tonen",
9898
"deleteImage_one": "Verwijder afbeelding",
9999
"deleteImage_other": "",
100-
"deleteImageBin": "Verwijderde afbeeldingen worden naar de prullenbak van je besturingssysteem gestuurd.",
101100
"deleteImagePermanent": "Verwijderde afbeeldingen kunnen niet worden hersteld.",
102101
"assets": "Eigen onderdelen",
103102
"autoAssignBoardOnClick": "Ken automatisch bord toe bij klikken",
@@ -467,10 +466,6 @@
467466
},
468467
"imageNotProcessedForControlAdapter": "De afbeelding van controle-adapter #{{number}} is niet verwerkt"
469468
},
470-
"isAllowedToUpscale": {
471-
"useX2Model": "Afbeelding is te groot om te vergroten met het x4-model. Gebruik hiervoor het x2-model",
472-
"tooLarge": "Afbeelding is te groot om te vergoten. Kies een kleinere afbeelding"
473-
},
474469
"patchmatchDownScaleSize": "Verklein",
475470
"useCpuNoise": "Gebruik CPU-ruis",
476471
"imageActions": "Afbeeldingshandeling",

invokeai/frontend/web/public/locales/ru.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@
100100
"loadMore": "Показать больше",
101101
"noImagesInGallery": "Изображений нет",
102102
"deleteImagePermanent": "Удаленные изображения невозможно восстановить.",
103-
"deleteImageBin": "Удаленные изображения будут отправлены в корзину вашей операционной системы.",
104103
"deleteImage_one": "Удалить изображение",
105104
"deleteImage_few": "Удалить {{count}} изображения",
106105
"deleteImage_many": "Удалить {{count}} изображений",
@@ -567,10 +566,6 @@
567566
"ipAdapterNoImageSelected": "изображение IP-адаптера не выбрано"
568567
}
569568
},
570-
"isAllowedToUpscale": {
571-
"useX2Model": "Изображение слишком велико для увеличения с помощью модели x4. Используйте модель x2",
572-
"tooLarge": "Изображение слишком велико для увеличения. Выберите изображение меньшего размера"
573-
},
574569
"cfgRescaleMultiplier": "Множитель масштабирования CFG",
575570
"patchmatchDownScaleSize": "уменьшить",
576571
"useCpuNoise": "Использовать шум CPU",

0 commit comments

Comments
 (0)