Skip to content

Commit 98db8f3

Browse files
feat(app): clean up DiskImageStorage types
1 parent f465a95 commit 98db8f3

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

invokeai/app/services/image_files/image_files_disk.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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
@@ -19,18 +19,12 @@
1919
class DiskImageFileStorage(ImageFileStorageBase):
2020
"""Stores images on disk"""
2121

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

33-
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)
3428
self.__thumbnails_folder = self.__output_folder / "thumbnails"
3529
# Validate required output folders at launch
3630
self.__validate_storage_folders()

0 commit comments

Comments
 (0)