From f3d5cc001f9835ffb6d93f9f2547731783d708e8 Mon Sep 17 00:00:00 2001 From: tazlin Date: Tue, 12 Mar 2024 10:56:30 -0400 Subject: [PATCH] fix: try disabling grad on chkpoint load --- hordelib/nodes/node_model_loader.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/hordelib/nodes/node_model_loader.py b/hordelib/nodes/node_model_loader.py index 1615ac6b..111f2cee 100644 --- a/hordelib/nodes/node_model_loader.py +++ b/hordelib/nodes/node_model_loader.py @@ -94,12 +94,13 @@ def load_checkpoint( SharedModelManager.manager._models_in_ram = {} ckpt_path = folder_paths.get_full_path("checkpoints", ckpt_name) - result = comfy.sd.load_checkpoint_guess_config( - ckpt_path, - output_vae=True, - output_clip=True, - embedding_directory=folder_paths.get_folder_paths("embeddings"), - ) + with torch.no_grad(): + result = comfy.sd.load_checkpoint_guess_config( + ckpt_path, + output_vae=True, + output_clip=True, + embedding_directory=folder_paths.get_folder_paths("embeddings"), + ) SharedModelManager.manager._models_in_ram[horde_in_memory_name] = result, will_load_loras