double patch issue fix for lowvram

Potential fix, lowvram weights are called via `patch_weight_to_device` on each run and it was possible to apply the same patch multiple times on subsequent generations.
This commit is contained in:
City
2024-09-05 05:32:01 +02:00
parent 717a0e1d0b
commit b46c206dd7
+3 -1
View File
@@ -147,7 +147,9 @@ class GGUFModelPatcher(comfy.model_patcher.ModelPatcher):
if is_quantized(weight):
out_weight = weight.to(device_to)
patches = move_patch_to_device(patches, self.load_device if self.patch_on_device else self.offload_device)
out_weight.patches.append((calculate_weight, patches, key))
patch = (calculate_weight, patches, key)
if patch not in out_weight.patches:
out_weight.patches.append(patch)
else:
inplace_update = self.weight_inplace_update or inplace_update
if key not in self.backup: