1
mirror of https://github.com/comfyanonymous/ComfyUI.git synced 2025-08-02 23:14:49 +08:00

utils.set_attr can now be used to set any attribute.

The old set_attr has been renamed to set_attr_param.
This commit is contained in:
comfyanonymous
2024-03-02 17:27:23 -05:00
parent dce3555339
commit 1abf8374ec
3 changed files with 10 additions and 8 deletions

View File

@@ -287,13 +287,13 @@ class ControlLora(ControlNet):
for k in sd:
weight = sd[k]
try:
comfy.utils.set_attr(self.control_model, k, weight)
comfy.utils.set_attr_param(self.control_model, k, weight)
except:
pass
for k in self.control_weights:
if k not in {"lora_controlnet"}:
comfy.utils.set_attr(self.control_model, k, self.control_weights[k].to(dtype).to(comfy.model_management.get_torch_device()))
comfy.utils.set_attr_param(self.control_model, k, self.control_weights[k].to(dtype).to(comfy.model_management.get_torch_device()))
def copy(self):
c = ControlLora(self.control_weights, global_average_pooling=self.global_average_pooling)