Don't keep cached outputs for removed nodes.

This commit is contained in:
comfyanonymous 2023-04-26 02:05:57 -04:00
parent 54251ad85e
commit 951c0c2bbe
1 changed files with 9 additions and 0 deletions

View File

@ -152,6 +152,15 @@ class PromptExecutor:
self.server.client_id = None self.server.client_id = None
with torch.inference_mode(): with torch.inference_mode():
#delete cached outputs if nodes don't exist for them
to_delete = []
for o in self.outputs:
if o not in prompt:
to_delete += [o]
for o in to_delete:
d = self.outputs.pop(o)
del d
for x in prompt: for x in prompt:
recursive_output_delete_if_changed(prompt, self.old_prompt, self.outputs, x) recursive_output_delete_if_changed(prompt, self.old_prompt, self.outputs, x)