Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Add total and free ram to /system_stats.

comfyanonymous5718ef69bb35
diff --git a/server.py b/server.py
index 9321e4d08..482185f62 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,