main
黄海 1 year ago
parent 04076f9a25
commit 87ea34f6eb

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

Loading…
Cancel
Save