multimodalart HF staff commited on
Commit
84774ff
1 Parent(s): 02e329b

Update model.py

Browse files
Files changed (1) hide show
  1. model.py +2 -1
model.py CHANGED
@@ -90,7 +90,8 @@ class Model:
90
  def load_controlnet_weight(self, task_name: str) -> None:
91
  if task_name == self.task_name:
92
  return
93
- del self.pipe.controlnet
 
94
  torch.cuda.empty_cache()
95
  gc.collect()
96
  model_id = CONTROLNET_MODEL_IDS[task_name]
 
90
  def load_controlnet_weight(self, task_name: str) -> None:
91
  if task_name == self.task_name:
92
  return
93
+ if 'controlnet' in self.pipe.__dict__:
94
+ del self.pipe.controlnet
95
  torch.cuda.empty_cache()
96
  gc.collect()
97
  model_id = CONTROLNET_MODEL_IDS[task_name]