Nodes/Louis Use/📊 Performance Tracker
ComfyUI Node

📊 Performance Tracker

Generation time and peak VRAM, stamped into your PNG — with zero graph changes

By LouisLU1997·Created 4 months ago·Updated 2 months ago· 0
📊 Performance Tracker
  • image
  • image
  • time_str
  • vram_str
  • elapsed_sec
  • vram_gb

"How long did that take, and how much VRAM did it peak?" is a question every ComfyUI user ends up asking - for benchmarking a new checkpoint, deciding whether a workflow fits your GPU, or settling an argument. Core ComfyUI shows a total run time in the console and a rough VRAM number, but capturing it per run, next to the image it belongs to is a different thing.

📊 Performance Tracker (the class name is Louis_use_TimerVRAM) is an image pass-through node that does two things: it measures generation time and peak VRAM, and it injects both into the PNG metadata of whatever you save, through any save node. Drop it between your VAE decode and your saver and you get a permanent, per-image record of how expensive that run was - no console digging, no manual notes.

How it actually works (the clever part)

This is not a stopwatch node. To know which upstream node's runtime to report, the pack patches ComfyUI's executor and progress bar at import time: it records which node is currently executing, and when a progress bar (a sampling pass) completes, it stashes the elapsed time keyed to that node. When TimerVRAM runs, it walks your graph upstream to find the nearest node with a recorded timing and reports that. The IS_CHANGED method returns NaN, so it always executes - a timing node that got cached as "unchanged" would defeat the whole purpose.

For VRAM it reads torch.cuda.max_memory_allocated() (peak allocated during the run) and resets the counter, so the number you get is the peak for this generation.

The outputs

  • image - untouched pass-through.
  • time_str / vram_str - human-readable strings ("生成耗时: 00:42", "显存占用: 12.34 GB"). Wire these into the pack's Show Text node to see them on the canvas.
  • elapsed_sec / vram_gb - raw numbers (FLOAT). Wire these into any math or comparison node if you want to act on them.

And the metadata injection: the node adds louis_gen_time and louis_vram_gb into extra_pnginfo, which ComfyUI passes to every save node in the run - so both the core Save Image and this pack's Batch Image Saver stamp them into the PNG. The image is literally carrying its own benchmark.

Installing it

Part of the Louis Use pack:

cd ComfyUI/custom_nodes
git clone https://github.com/LouisLU1997/ComfyUI-louis-use Louis_use

Or "Louis Use" in ComfyUI Manager, then restart. No dependencies beyond core.

What to know before you trust the numbers

  • The timing is the nearest upstream sampling node's, found by walking the graph - so put the node right after VAEDecode and it captures the full sampling pass. The time_str defaults to "生成耗时: --:--" if no timing was recorded, which happens if nothing upstream had a progress bar.
  • vram_gb reads allocated memory, not total used. It's peak PyTorch allocated, which is the number that matters for "does my model fit," but a card with 24 GB total may show 12 GB and be more than 12 GB actually consumed by non-PyTorch overhead. Useful for relative comparisons, not a full system readout.
  • It patches the executor. The monkey-patching is the mechanism, and it's the kind of thing that can break on a ComfyUI update. If you see errors about execution or comfy.utils after upgrading, this pack is a prime suspect - check whether it's been updated.

For benchmarking runs, A/B tests, or just keeping a record of what each image cost, it's the easiest full-stack answer: one node, and the data lands in the file.

CategoryLouis_use

Inputs (1)

NameTypeDefaultDescription
imageIMAGE

Outputs (5)

NameTypeDescription
imageIMAGE
time_strSTRING
vram_strSTRING
elapsed_secFLOAT
vram_gbFLOAT