Temp fix for disable smart memory

Model management seems to expect `unpatch_model` to put model on specified device after unpatching. Needs different way to avoid patch reload.
This commit is contained in:
City
2024-09-03 05:28:49 +02:00
parent 69f0daffc5
commit 6dbb4ba989
+3 -1
View File
@@ -176,7 +176,9 @@ class GGUFModelPatcher(comfy.model_patcher.ModelPatcher):
patches = getattr(p, "patches", [])
if len(patches) > 0:
p.patches = []
return super().unpatch_model(device_to=None, unpatch_weights=unpatch_weights)
# TODO: Find another way to not unload after patches
device_to = device_to if comfy.model_management.DISABLE_SMART_MEMORY else None
return super().unpatch_model(device_to=device_to, unpatch_weights=unpatch_weights)
def load(self, *args, force_patch_weights=False, **kwargs):
# always call `patch_weight_to_device` even for lowvram