From 452179fe4fd5171be4b78acadf2859d068295474 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Tue, 3 Dec 2024 13:57:18 -0500 Subject: [PATCH] Make ModelPatcher class clone function work with inheritance. --- 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 4ae3ad25..fb651242 100644 --- a/comfy/model_patcher.py +++ b/comfy/model_patcher.py @@ -243,7 +243,7 @@ class ModelPatcher: return self.model.lowvram_patch_counter def clone(self): - n = ModelPatcher(self.model, self.load_device, self.offload_device, self.size, weight_inplace_update=self.weight_inplace_update) + n = self.__class__(self.model, self.load_device, self.offload_device, self.size, weight_inplace_update=self.weight_inplace_update) n.patches = {} for k in self.patches: n.patches[k] = self.patches[k][:]