Commit b31daadc authored by comfyanonymous's avatar comfyanonymous
Browse files

Try to improve memory issues with del.

parent cd85f876
......@@ -222,8 +222,11 @@ class ModelPatcher:
return self.model
def unpatch_model(self):
model_sd = self.model.state_dict()
for k in self.backup:
keys = list(self.backup.keys())
for k in keys:
model_sd[k][:] = self.backup[k]
del self.backup[k]
self.backup = {}
def load_lora_for_models(model, clip, lora_path, strength_model, strength_clip):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment