From d2aaeb0f138320cb2b1481d00c79ee63d7cfe81b Mon Sep 17 00:00:00 2001 From: City <125218114+city96@users.noreply.github.com> Date: Tue, 17 Sep 2024 15:26:39 +0200 Subject: [PATCH] Always init tenc on offload device #83 needs updated ComfyUI as well to fix it, issue was with the direct load logic in model management putting the model on the GPU before the weights were loaded, at which point the loading would overwrite the weights with the CPU ones --- nodes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nodes.py b/nodes.py index 6380f85..3533b89 100644 --- a/nodes.py +++ b/nodes.py @@ -327,7 +327,10 @@ class CLIPLoaderGGUF: clip = comfy.sd.load_text_encoder_state_dicts( clip_type = clip_type, state_dicts = clip_data, - model_options = {"custom_operations": GGMLOps}, + model_options = { + "custom_operations": GGMLOps, + "initial_device": comfy.model_management.text_encoder_offload_device() + }, embedding_directory = folder_paths.get_folder_paths("embeddings"), ) clip.patcher = GGUFModelPatcher.clone(clip.patcher)