Skip to content

Commit

Permalink
Add total and free ram to /system_stats.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Sep 22, 2024
1 parent 13ecf10 commit 5718ef6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,12 +490,17 @@ async def view_metadata(request):
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,
Expand Down

0 comments on commit 5718ef6

Please sign in to comment.