Spaces:
Runtime error
Runtime error
update
Browse files- sam2edit.py +2 -0
sam2edit.py
CHANGED
@@ -137,9 +137,11 @@ def create_demo():
|
|
137 |
print("To Use:", config_dict[condition_model], "Current:", default_controlnet_path)
|
138 |
if default_controlnet_path!=config_dict[condition_model]:
|
139 |
print("Change condition model to:", config_dict[condition_model])
|
|
|
140 |
global pipe
|
141 |
pipe = obtain_generation_model(config_dict[condition_model])
|
142 |
default_controlnet_path = config_dict[condition_model]
|
|
|
143 |
|
144 |
with torch.no_grad():
|
145 |
if use_blip and (enable_auto_prompt or len(prompt) == 0):
|
|
|
137 |
print("To Use:", config_dict[condition_model], "Current:", default_controlnet_path)
|
138 |
if default_controlnet_path!=config_dict[condition_model]:
|
139 |
print("Change condition model to:", config_dict[condition_model])
|
140 |
+
del pipe
|
141 |
global pipe
|
142 |
pipe = obtain_generation_model(config_dict[condition_model])
|
143 |
default_controlnet_path = config_dict[condition_model]
|
144 |
+
torch.cuda.empty_cache()
|
145 |
|
146 |
with torch.no_grad():
|
147 |
if use_blip and (enable_auto_prompt or len(prompt) == 0):
|