diff --git a/BaiHu/Tools/TestComfyUIApi.py b/BaiHu/Tools/TestComfyUIApi.py index 5acf8cdf..191f513f 100644 --- a/BaiHu/Tools/TestComfyUIApi.py +++ b/BaiHu/Tools/TestComfyUIApi.py @@ -24,4 +24,6 @@ if float(used) > 20: # 休息2分钟以保证SD重启完成 time.sleep(2 * 60) else: - print("显存占用正常,无法重新启动SD!") + # 清理一下缓存即可 + clear_webui_cache(webui_address) + print("显存占用正常,无需重新启动SD,清理一下缓存...") diff --git a/BaiHu/Util/SDUtil.py b/BaiHu/Util/SDUtil.py index 8665b2d4..f7be27e2 100644 --- a/BaiHu/Util/SDUtil.py +++ b/BaiHu/Util/SDUtil.py @@ -176,9 +176,10 @@ def get_webui_used(webui_server): # 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) + '%') + # print("显存:" + total + "GB,已使用:" + used + "GB,使用率:" + str(used_lv) + '%') else: - print("调用集成的获取显卡显存代码失败!") + # print("调用集成的获取显卡显存代码失败!") + pass return total, used