From 5718ef69bb355011314ea232fdfbe552e9a0fb20 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Sun, 22 Sep 2024 03:41:48 -0400 Subject: [PATCH] Add total and free ram to /system_stats. --- server.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server.py b/server.py index 9321e4d0..482185f6 100644 --- a/server.py +++ b/server.py @@ -490,12 +490,17 @@ class PromptServer(): async def system_stats(request): device = comfy.model_management.get_torch_device() device_name = comfy.model_management.get_torch_device_name(device) + cpu_device = comfy.model_management.torch.device("cpu") + ram_total = comfy.model_management.get_total_memory(cpu_device) + ram_free = comfy.model_management.get_free_memory(cpu_device) vram_total, torch_vram_total = comfy.model_management.get_total_memory(device, torch_total_too=True) vram_free, torch_vram_free = comfy.model_management.get_free_memory(device, torch_free_too=True) system_stats = { "system": { "os": os.name, + "ram_total": ram_total, + "ram_free": ram_free, "comfyui_version": get_comfyui_version(), "python_version": sys.version, "pytorch_version": comfy.model_management.torch_version,