From 377862a06ddd7b0f599a768a305497be8068c07e Mon Sep 17 00:00:00 2001 From: City <125218114+city96@users.noreply.github.com> Date: Fri, 23 Aug 2024 03:23:49 +0200 Subject: [PATCH] Cast to device forgot this --- nodes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nodes.py b/nodes.py index 564eb35..04e69ea 100644 --- a/nodes.py +++ b/nodes.py @@ -101,7 +101,10 @@ class GGUFModelPatcher(comfy.model_patcher.ModelPatcher): calculate_weight = self.calculate_weight if qtype not in [None, gguf.GGMLQuantizationType.F32, gguf.GGMLQuantizationType.F16]: - out_weight = weight.clone() + if device_to is not None: + out_weight = weight.to(device_to, copy=True) + else: + out_weight = weight.clone() out_weight.patches.append((calculate_weight, self.patches[key], key)) else: