From 04076f9a25bd9a8487b713e63626efe34c2de39d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com> Date: Sat, 6 Jul 2024 16:30:34 +0800 Subject: [PATCH] 'commit' --- BaiHu/Util/SDUtil.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/BaiHu/Util/SDUtil.py b/BaiHu/Util/SDUtil.py index 97a3a33a..231253e6 100644 --- a/BaiHu/Util/SDUtil.py +++ b/BaiHu/Util/SDUtil.py @@ -120,7 +120,7 @@ def get_comfyui_used(server_address): # 清理GPU显存 def clear_comfyui_cache(server_address): # 显示显卡使用率 - print('清理显存前:' + get_comfyui_used(server_address)) + #print('清理显存前:' + get_comfyui_used(server_address)) # 打开文件并读取内容 file_path = r'../JSON/clearGPU.json' if not os.path.exists(file_path): @@ -131,8 +131,8 @@ def clear_comfyui_cache(server_address): queue_prompt(server_address, "cleanGpuRam", prompt_data) # 显示显卡使用率 - time.sleep(2) - print('清理显存后:' + get_comfyui_used(server_address)) + #time.sleep(2) + #print('清理显存后:' + get_comfyui_used(server_address)) # 生成图像 @@ -190,12 +190,8 @@ def get_webui_used(webui_server): if res.status_code == 200: jo = json.loads(res.text) total = jo[0].replace('total', '').replace(' ', '').replace(':', '').replace('GB', '') - # free = jo[1].replace('free', '').replace(' ', '').replace(':', '').replace('GB', '') used = jo[2].replace('used', '').replace(' ', '').replace(':', '').replace('GB', '') - used_lv = round(1.0 * (float(used)) / float(total) * 100, 2) - # print("显存:" + total + "GB,已使用:" + used + "GB,使用率:" + str(used_lv) + '%') else: - # print("调用集成的获取显卡显存代码失败!") pass return total, used @@ -208,7 +204,8 @@ def clear_webui_cache(webui_address): if res.status_code == 200: jo = json.loads(res.text) if jo['success']: - print("显存清理成功!") + #print("显存清理成功!") + pass else: print("显存清理失败!") else: