diff --git a/BaiHu/Tools/TestComfyUIApi.py b/BaiHu/Tools/TestComfyUIApi.py index 5f806d2c..b9419626 100644 --- a/BaiHu/Tools/TestComfyUIApi.py +++ b/BaiHu/Tools/TestComfyUIApi.py @@ -1,16 +1,9 @@ from Util import ConfigUtil from Util.ComfyUIUtil import * - # 打开配置文件 config = ConfigUtil.getConfig() server_address = config.get('comfyui', 'server_address') -# 显示显卡使用率 -print('清理显存前:' + getUse(server_address)) - # 清理GPU缓存 clearGPU(server_address) - -# 显示显卡使用率 -print('清理显存后:' + getUse(server_address)) diff --git a/BaiHu/Util/ComfyUIUtil.py b/BaiHu/Util/ComfyUIUtil.py index d7faa39d..384c2908 100644 --- a/BaiHu/Util/ComfyUIUtil.py +++ b/BaiHu/Util/ComfyUIUtil.py @@ -102,6 +102,8 @@ def getUse(server_address): # 清理GPU显存 def clearGPU(server_address): + # 显示显卡使用率 + print('清理显存前:' + getUse(server_address)) # 打开文件并读取内容 file_path = r'../JSON/clearGPU.json' if not os.path.exists(file_path): @@ -111,6 +113,9 @@ def clearGPU(server_address): # 清理 queue_prompt(server_address, "cleanGpuRam", prompt_data) + # 显示显卡使用率 + print('清理显存后:' + getUse(server_address)) + # 生成图像 def generate_clip(server_address, prompt_data, client_id, output_path, myfilter): diff --git a/BaiHu/Util/__pycache__/ComfyUIUtil.cpython-310.pyc b/BaiHu/Util/__pycache__/ComfyUIUtil.cpython-310.pyc index 3e85484d..b520b841 100644 Binary files a/BaiHu/Util/__pycache__/ComfyUIUtil.cpython-310.pyc and b/BaiHu/Util/__pycache__/ComfyUIUtil.cpython-310.pyc differ