Spaces:
Runtime error
Runtime error
Update
Browse files
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 |
-
|
|
|
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 hasattr(self.pipe, 'controlnet'):
|
94 |
+
del self.pipe.controlnet
|
95 |
torch.cuda.empty_cache()
|
96 |
gc.collect()
|
97 |
model_id = CONTROLNET_MODEL_IDS[task_name]
|