ComfyUI Node

StFist - GPU Monitor

A live VRAM readout you can actually wire into your graph

By strawberryPunch·Created about a year ago·Updated about a year ago· 22
StFist - GPU Monitor
    • status
    • usage_percent
    • used_mb
    • total_mb
    • gpu_name
    monitoring_enabledOn
    update_interval1.0
    history_length60
    warning_threshold80
    refresh_trigger0

    This is the honest half of the StrawberryFist VRAM Optimizer pack. The "optimizer" sibling is a wrapper around torch.cuda.empty_cache() (more on that in its own article); the GPU Monitor just tells you what's actually sitting in your card - to the megabyte, in real time, in numbers you can feed to other nodes. No exaggeration needed, because the thing it does, it does fine.

    You find it under StrawberryFist - system in the node menu. Drop it on the canvas and it starts a background thread that polls your GPU on an interval and prints a running dashboard to the ComfyUI terminal - memory bar, current usage percent, and a warning line when you cross your threshold. It's the sort of node you add during a long queue when you're watching VRAM creep and wondering whether the next image is going to OOM.

    How it works

    Under the hood it uses GPUtil, the only real dependency this pack ships (alongside PyTorch, which you already have). GPUtil doesn't talk to the driver directly - it parses nvidia-smi output, so if nvidia-smi works, this works. A daemon thread polls once per update_interval (default 1 second), appends each reading to a rolling history capped at history_length (default 60 entries), and checks it against warning_threshold (default 80%). Because the node's IS_CHANGED always returns a fresh value, it re-executes on every queue run and refreshes its outputs continuously.

    One honest caveat: it reads the first GPU only (gpus[0] in the code). Multi-GPU rigs get the primary card and nothing else - the README lists multi-GPU support as "planned," so don't hold your breath.

    Inputs and outputs that matter

    You mostly set three things:

    • update_interval (0.1–10s) - how often to poll. Default 1s is fine; drop it to 0.1 only if you're debugging something frantic.
    • warning_threshold (50–95%) - where the terminal starts shouting at you.
    • monitoring_enabled - the off switch. The thread only runs while this is On.

    refresh_trigger is a manual "poke it" control: change the number and it forces an immediate update instead of waiting for the interval.

    The outputs are where this node earns its keep, because they're real numbers, not just terminal decoration:

    • status (STRING) - a human-readable report, including average/max/min across the recent history and a trend line.
    • usage_percent (FLOAT), used_mb (FLOAT), total_mb (FLOAT) - the numbers themselves.
    • gpu_name (STRING) - e.g. "NVIDIA GeForce RTX 4090".

    Wire used_mb and total_mb into a Show Text node and you've got a live VRAM HUD in your workflow. That's the whole party trick, and it's a good one.

    Installing it

    Same story as the whole pack: ComfyUI Manager → search "StrawberryFist VRAM Optimizer" → Install → restart. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/strawberryPunch/vram_optimizer
    

    Restart ComfyUI after either route. GPUtil gets installed automatically on first run - there are no model files and no heavy dependencies to download, which is a relief in a custom-node ecosystem that's otherwise dependency hell.

    Common issues

    • Zeros everywhere / "Cannot get GPU information" - GPUtil either isn't installed or can't parse nvidia-smi. The code falls back to a mock that returns an empty GPU list, so you get 0.0 outputs instead of a crash. Check pip show GPUtil and that nvidia-smi runs in your terminal.
    • Monitoring "not updating" - usually means the interval is set too high or monitoring got toggled Off mid-run; bump the interval down and check the terminal log.
    • Readings never change - you're on a multi-GPU box and the node is watching card 0 while you work on card 1. That's the single-GPU limitation, not a bug.

    Is it essential? No. If you already run nvidia-smi -l 1 in a side terminal you're getting 90% of the value. But if you want the readout inside ComfyUI, wired into the graph and prettily logged, this is the least fussy way to get it.

    CategoryStrawberryFist - system

    Inputs (5)

    NameTypeDefaultDescription
    monitoring_enabledCOMBOOnEnable/disable real-time GPU monitoring
    update_intervalFLOAT1.00.1–10Monitoring update interval (seconds)
    history_lengthINT6010–300Number of history entries to keep
    warning_thresholdFLOAT8050–95Warning threshold (%)
    refresh_triggerINT00–9999Change value to trigger immediate update

    Outputs (5)

    NameTypeDescription
    statusSTRING
    usage_percentFLOAT
    used_mbFLOAT
    total_mbFLOAT
    gpu_nameSTRING