|
|
@ -206,9 +206,11 @@ def restart_server(webui_address):
|
|
|
|
|
|
|
|
|
|
|
|
# 清理一下SD
|
|
|
|
# 清理一下SD
|
|
|
|
def release_sd(webui_address,comfyui_address):
|
|
|
|
def release_sd(webui_address,comfyui_address):
|
|
|
|
|
|
|
|
# comfyui的显存先清理一下
|
|
|
|
|
|
|
|
clear_comfyui_cache(comfyui_address)
|
|
|
|
|
|
|
|
|
|
|
|
# 获取使显存数量
|
|
|
|
# 获取使显存数量
|
|
|
|
total, used = get_webui_used(webui_address)
|
|
|
|
total, used = get_webui_used(webui_address)
|
|
|
|
clear_comfyui_cache(comfyui_address)
|
|
|
|
|
|
|
|
# 显存占用超过20GB
|
|
|
|
# 显存占用超过20GB
|
|
|
|
if float(used) > 20:
|
|
|
|
if float(used) > 20:
|
|
|
|
print("显存占用高达" + used + "GB,准备重启SD...")
|
|
|
|
print("显存占用高达" + used + "GB,准备重启SD...")
|
|
|
|