From c1aa2b82eb8cd7158ee2b5c3518cdb03ccf13bc7 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Wed, 20 Sep 2023 18:40:24 +1000 Subject: [PATCH] feat(nodes): default `node_cache_size` in `MemoryInvocationCache` to 0 (fully disabled) --- .../app/services/invocation_cache/invocation_cache_memory.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/invokeai/app/services/invocation_cache/invocation_cache_memory.py b/invokeai/app/services/invocation_cache/invocation_cache_memory.py index 455a78d9d1..4c0eb2106f 100644 --- a/invokeai/app/services/invocation_cache/invocation_cache_memory.py +++ b/invokeai/app/services/invocation_cache/invocation_cache_memory.py @@ -12,13 +12,15 @@ class MemoryInvocationCache(InvocationCacheBase): __cache_ids: Queue __invoker: Invoker - def __init__(self, max_cache_size: int = 512) -> None: + def __init__(self, max_cache_size: int = 0) -> None: self.__cache = dict() self.__max_cache_size = max_cache_size self.__cache_ids = Queue() def start(self, invoker: Invoker) -> None: self.__invoker = invoker + if self.__max_cache_size == 0: + return self.__invoker.services.images.on_deleted(self._delete_by_match) self.__invoker.services.latents.on_deleted(self._delete_by_match)