From 3e4755ed148e35744c79879875ccac03d92da786 Mon Sep 17 00:00:00 2001 From: lpbb Date: Tue, 19 Sep 2023 14:05:51 +0200 Subject: [PATCH] porting the cast of the temp_weight to the gpu --- comfy/model_patcher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy/model_patcher.py b/comfy/model_patcher.py index 85bf5bd2a..4788a4988 100644 --- a/comfy/model_patcher.py +++ b/comfy/model_patcher.py @@ -154,7 +154,7 @@ class ModelPatcher: self.backup[key] = weight.to(self.offload_device) if device_to is not None: - temp_weight = weight.float().to(device_to, copy=True) + temp_weight = weight.to(device_to, copy=True).float() else: temp_weight = weight.to(torch.float32, copy=True) out_weight = self.calculate_weight(self.patches[key], temp_weight, key).to(weight.dtype)