🐛 Fix build cn model (#409)

* 🐛 Fix build cn model

* compatible
pull/444/head
Chenlei Hu 2024-02-19 04:42:26 +00:00 committed by GitHub
parent f279033b91
commit fe02e05d85
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -244,7 +244,8 @@ class AnimateDiffControl:
if unit.module in model_free_preprocessors:
model_net = None
else:
model_net = cn_script.load_control_model(p, unet, unit.model)
control_model = cn_script.load_control_model(p, unet, unit.model)
model_net = control_model.model if isinstance(control_model, tuple) else control_model
model_net.reset()
if model_net is not None and getattr(devices, "fp8", False) and not isinstance(model_net, PlugableIPAdapter):
for _module in model_net.modules():