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 1
1
# Copyright (c) 2022 Kyle Schouviller (https://github.com/kyle0654) and the InvokeAI Team
2
2
from pathlib import Path
3
3
from queue import Queue
4
- from typing import Dict , Optional , Union
4
+ from typing import Optional , Union
5
5
6
6
from PIL import Image , PngImagePlugin
7
7
from PIL .Image import Image as PILImageType
19
19
class DiskImageFileStorage (ImageFileStorageBase ):
20
20
"""Stores images on disk"""
21
21
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
-
28
22
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 ] ()
31
25
self .__max_cache_size = 10 # TODO: get this from config
32
26
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 )
34
28
self .__thumbnails_folder = self .__output_folder / "thumbnails"
35
29
# Validate required output folders at launch
36
30
self .__validate_storage_folders ()
You can’t perform that action at this time.
0 commit comments