From b0615bdfd41e6367f84b376913bcaa78fe19f57d Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Wed, 6 Mar 2024 23:18:00 +1100 Subject: [PATCH] fix(nodes): correctly serialize outputs In order for delete by match to work, we need the whole invocation output to be stringified. For some reason, the serialization of the output was set to only include the `type` field. It should instead include the whole output. I don't understand how this ever worked unless pydantic had different serialization behaviour in v1 (though it appears to have been the same). Closes #5805 --- .../app/services/invocation_cache/invocation_cache_memory.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/invokeai/app/services/invocation_cache/invocation_cache_memory.py b/invokeai/app/services/invocation_cache/invocation_cache_memory.py index aa955e3ec4..d15269caf9 100644 --- a/invokeai/app/services/invocation_cache/invocation_cache_memory.py +++ b/invokeai/app/services/invocation_cache/invocation_cache_memory.py @@ -61,9 +61,7 @@ class MemoryInvocationCache(InvocationCacheBase): self._delete_oldest_access(number_to_delete) self._cache[key] = CachedItem( invocation_output, - invocation_output.model_dump_json( - warnings=False, exclude_defaults=True, exclude_unset=True, include={"type"} - ), + invocation_output.model_dump_json(warnings=False, exclude_defaults=True, exclude_unset=True), ) def _delete_oldest_access(self, number_to_delete: int) -> None: