|
|
|
@ -1,5 +1,4 @@
|
|
|
|
|
import os.path
|
|
|
|
|
import time
|
|
|
|
|
import urllib.parse
|
|
|
|
|
import urllib.request
|
|
|
|
|
|
|
|
|
@ -119,8 +118,6 @@ def get_comfyui_used(server_address):
|
|
|
|
|
# https://wailikeji.blog.csdn.net/article/details/140035515
|
|
|
|
|
# 清理GPU显存
|
|
|
|
|
def clear_comfyui_cache(server_address):
|
|
|
|
|
# 显示显卡使用率
|
|
|
|
|
#print('清理显存前:' + get_comfyui_used(server_address))
|
|
|
|
|
# 打开文件并读取内容
|
|
|
|
|
file_path = r'../JSON/clearGPU.json'
|
|
|
|
|
if not os.path.exists(file_path):
|
|
|
|
@ -130,10 +127,6 @@ def clear_comfyui_cache(server_address):
|
|
|
|
|
# 清理
|
|
|
|
|
queue_prompt(server_address, "cleanGpuRam", prompt_data)
|
|
|
|
|
|
|
|
|
|
# 显示显卡使用率
|
|
|
|
|
#time.sleep(2)
|
|
|
|
|
#print('清理显存后:' + get_comfyui_used(server_address))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 生成图像
|
|
|
|
|
def generate_clip(server_address, prompt_data, client_id, output_path, myfilter):
|
|
|
|
@ -204,7 +197,6 @@ def clear_webui_cache(webui_address):
|
|
|
|
|
if res.status_code == 200:
|
|
|
|
|
jo = json.loads(res.text)
|
|
|
|
|
if jo['success']:
|
|
|
|
|
#print("显存清理成功!")
|
|
|
|
|
pass
|
|
|
|
|
else:
|
|
|
|
|
print("显存清理失败!")
|
|
|
|
|