From f67c00622f1259598ce1720bbcb483fbe6e5de68 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Wed, 22 Mar 2023 03:48:26 -0400 Subject: [PATCH] Use inference_mode instead of no_grad. --- execution.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/execution.py b/execution.py index 30eeb630..757e0d9f 100644 --- a/execution.py +++ b/execution.py @@ -143,7 +143,7 @@ class PromptExecutor: else: self.server.client_id = None - with torch.no_grad(): + with torch.inference_mode(): for x in prompt: recursive_output_delete_if_changed(prompt, self.old_prompt, self.outputs, x)