MCPcopy Create free account
hub / github.com/city96/ComfyUI-GGUF / unpatch_model

Method unpatch_model

nodes.py:69–78  ·  view source on GitHub ↗
(self, device_to=None, unpatch_weights=True)

Source from the content-addressed store, hash-verified

67 comfy.utils.set_attr_param(self.model, key, out_weight)
68
69 def unpatch_model(self, device_to=None, unpatch_weights=True):
70 if unpatch_weights:
71 for p in self.model.parameters():
72 if is_torch_compatible(p):
73 continue
74 patches = getattr(p, "patches", [])
75 if len(patches) > 0:
76 p.patches = []
77 # TODO: Find another way to not unload after patches
78 return super().unpatch_model(device_to=device_to, unpatch_weights=unpatch_weights)
79
80
81 def pin_weight_to_device(self, key):

Callers

nothing calls this directly

Calls 1

is_torch_compatibleFunction · 0.85

Tested by

no test coverage detected