Fix issue with get_model_object on patched model.

This commit is contained in:
comfyanonymous 2024-04-04 23:01:02 -04:00
parent 1a0486bb96
commit 1f4fc9ea0c

View File

@ -154,7 +154,10 @@ class ModelPatcher:
if name in self.object_patches: if name in self.object_patches:
return self.object_patches[name] return self.object_patches[name]
else: else:
return comfy.utils.get_attr(self.model, name) if name in self.object_patches_backup:
return self.object_patches_backup[name]
else:
return comfy.utils.get_attr(self.model, name)
def model_patches_to(self, device): def model_patches_to(self, device):
to = self.model_options["transformer_options"] to = self.model_options["transformer_options"]