Nodes/ComfyUI-JNodes/Get VRAM Info
ComfyUI Node

Get VRAM Info

Read used, free, and total GPU memory inside your graph

By JaredTherriault·Created 3 years ago·Updated about a month ago· 91
Get VRAM Info
    • used_mb
    • free_mb
    • total_mb

    This node reports your GPU memory as three numbers - used, free, and total, all in megabytes - measured at the point in the graph where it runs. It's a diagnostic instrument. When you're fighting out-of-memory errors and trying to work out which step is eating your VRAM, you drop this in at a few places and read the numbers to see how much headroom you've actually got before and after the expensive nodes. No more guessing whether the upscale or the second model is the one pushing you over.

    It's most useful paired with tuning. You're deciding whether a bigger resolution will fit, or whether you can afford to keep two models resident, and instead of trial-and-error-until-it-crashes you check the free number and make an informed call. On a card where you live close to the ceiling, that visibility is genuinely handy.

    How it works

    When it executes, it queries the GPU's memory state and returns a snapshot. The key word is snapshot - it reflects the situation at that exact moment in the run, so where you place it in the execution order determines what it sees. Put it after a heavy load and you'll see the load reflected in the used/free split; put it before, and you won't.

    The inputs and outputs that matter

    No inputs. Three outputs, all INT, all in MB:

    • used_mb - how much VRAM is currently allocated.
    • free_mb - how much is available. This is the one you watch to know if the next step fits.
    • total_mb - your card's total, a fixed ceiling worth having on screen for context.

    Wire these into a preview/display node to read them, into a metadata writer to log them with the output, or into math/comparison nodes if you want the graph to react to them.

    How to install it

    ComfyUI Manager, search JNodes, install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/JaredTherriault/ComfyUI-JNodes
    pip install -r ComfyUI-JNodes/requirements.txt
    

    No models.

    Common issues & troubleshooting

    The numbers don't add up to what nvidia-smi shows. Different tools measure different things - PyTorch's reserved cache, other processes on the card, driver overhead. Treat this as ComfyUI's view of the GPU, useful for relative before/after comparisons within a run more than as an absolute match to system tools.

    Free memory looks lower than expected right after a step. That's often PyTorch holding its cache. If you want to see how much you'd actually reclaim, put an Empty Cuda Cache node before this one and compare - the freed number tells you how much the cache was sitting on.

    It reads the same everywhere in my graph. Placement determines timing, but ComfyUI's execution order isn't always what the visual layout suggests. If two readings look identical when they shouldn't, make sure each node is genuinely on the execution path at the point you think it is, not resolved together.

    Multi-GPU. On a machine with more than one card, this reports the device ComfyUI is using. If you're running on a specific GPU, that's the one you're reading.

    Categoryutils

    Inputs (0)

    No inputs

    Outputs (3)

    NameTypeDescription
    used_mbINT
    free_mbINT
    total_mbINT