From abe5c6a6c90a3f8a53a097614bf749de506c6df7 Mon Sep 17 00:00:00 2001 From: City <125218114+city96@users.noreply.github.com> Date: Wed, 28 Aug 2024 20:23:08 +0200 Subject: [PATCH] Fix weights not being copied for lowvram patch This can probably be improved since the weights themselves never need to be copied as they cannot be changed anyway. --- nodes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodes.py b/nodes.py index 1deb9ec..70823f4 100644 --- a/nodes.py +++ b/nodes.py @@ -120,7 +120,7 @@ class GGUFModelPatcher(comfy.model_patcher.ModelPatcher): if device_to is not None: out_weight = weight.to(device_to, copy=True) else: - out_weight = weight.clone() + out_weight = weight.to(weight.device, copy=True) # make sure patches are copied if self.patch_on_device: patches = move_patch_to_cuda(patches, self.load_device)