diff --git a/BaiHu/Tools/TestComfyUIApi.py b/BaiHu/Tools/TestComfyUIApi.py index b9419626..a5453949 100644 --- a/BaiHu/Tools/TestComfyUIApi.py +++ b/BaiHu/Tools/TestComfyUIApi.py @@ -6,4 +6,4 @@ config = ConfigUtil.getConfig() server_address = config.get('comfyui', 'server_address') # 清理GPU缓存 -clearGPU(server_address) +clear_cache(server_address) diff --git a/BaiHu/Util/ComfyUIUtil.py b/BaiHu/Util/ComfyUIUtil.py index 384c2908..9d40990d 100644 --- a/BaiHu/Util/ComfyUIUtil.py +++ b/BaiHu/Util/ComfyUIUtil.py @@ -94,14 +94,14 @@ def getUse(server_address): used_vram = vram_total - vram_free used_vram_str = str(int((vram_total - vram_free) / 1024 / 1024 / 1024 + 0.5)) used_lv = round(1.0 * (used_vram) / vram_total * 100, 2) - return "显存共:" + vram_total_str + "GB,已使用:" + used_vram_str + "GB,使用率:" + str(used_lv) + "% " + return "显存共" + vram_total_str + "GB,已使用" + used_vram_str + "GB,使用率:" + str(used_lv) + "% " # 如何清空Comfyui的gpu缓存 # https://wailikeji.blog.csdn.net/article/details/140035515 # 清理GPU显存 -def clearGPU(server_address): +def clear_cache(server_address): # 显示显卡使用率 print('清理显存前:' + getUse(server_address)) # 打开文件并读取内容 diff --git a/BaiHu/Util/__pycache__/ComfyUIUtil.cpython-310.pyc b/BaiHu/Util/__pycache__/ComfyUIUtil.cpython-310.pyc index b520b841..432fa4ed 100644 Binary files a/BaiHu/Util/__pycache__/ComfyUIUtil.cpython-310.pyc and b/BaiHu/Util/__pycache__/ComfyUIUtil.cpython-310.pyc differ