File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
invokeai/app/services/image_files Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change 11# Copyright (c) 2022 Kyle Schouviller (https://github.com/kyle0654) and the InvokeAI Team
22from pathlib import Path
33from queue import Queue
4- from typing import Dict , Optional , Union
4+ from typing import Optional , Union
55
66from PIL import Image , PngImagePlugin
77from PIL .Image import Image as PILImageType
1919class 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 ()
You can’t perform that action at this time.
0 commit comments