Nodes/comfyui-benchmark/Benchmark Workflow
ComfyUI Node

Benchmark Workflow

The 10-second node that finally tells you what your GPU was doing

By Comfy-Org·Created about a year ago·Updated 7 months ago· 16
Benchmark Workflow
      capture_benchmarktrue
      file_prefix
      file_postfix

      Ever answered "which sampler is faster on my card?" by eyeballing the console it/s and hoping? Comfy-Org - the same people who make ComfyUI itself - got tired of that and shipped comfyui-benchmark, an official extension that instruments your whole run and writes a real benchmark file. The Benchmark Workflow node is the small control knob that sits on the graph and tells that machinery when to save and what to name the file.

      The first thing to understand, because it trips everyone up: this node has no output sockets. There's nothing to wire out of it. It's a marker node - a control surface, not part of the data flow. Drop it anywhere on your graph, leave it dangling, and it does its job.

      How it works

      The extension is a hook machine. On import it patches ComfyUI's internals - comfy.samplers, the model patcher, VAE encode/decode, model loading - and wraps each with a timer. Every CLIP encode, every sampler step, every VAE decode gets an elapsed-time entry. On top of that it spawns a background thread that polls nvidia-smi every 0.25 seconds (default) for VRAM, GPU utilization, and power draw, plus psutil for system RAM. When the run finishes it dumps everything as JSON to ComfyUI/outputs/benchmarks/.

      When it saves is governed by config.yaml, which the extension auto-generates on first run. Key option: require_node (default false). With it off, every workflow you run gets benchmarked whether or not this node exists - the node is purely optional. Flip require_node: true in the config and the node becomes the gatekeeper: benchmarks only save when it's on the graph with capture on.

      The inputs that matter

      There are only three, all on the node's widget:

      • capture_benchmark (boolean, default true) - the master switch. The extension literally scans the workflow for a BenchmarkWorkflow node with this set to true; flip it off and no benchmark file is written for that graph.
      • file_prefix - prepended to the benchmark filename (e.g. sdxl_base_).
      • file_postfix - appended after the timestamp (e.g. _fp8).

      That's the whole trick for organizing results: name your runs by config so comfyui-benchmark/benchmark_20260216_120000.json becomes sdxl_base_benchmark_20260216_120000_fp8.json.

      Installing it

      Real install, from the README, is trivial - this is a first-party tool with no model downloads and no heavy dependencies:

      cd ComfyUI/custom_nodes
      git clone https://github.com/Comfy-Org/comfyui-benchmark
      

      Then restart ComfyUI (or install it via ComfyUI Manager by searching "comfyui-benchmark"). Runtime deps are pyyaml and psutil, which ComfyUI already ships. The visualization script is separate:

      pip install -r visualize_requirements.txt   # plotly
      python visualize_benchmark.py <benchmark_file.json>
      

      That opens an interactive Plotly view with the operations timeline, VRAM, GPU util, and power curves. If you want a static PNG instead of a browser, you'll also need pip install kaleido - the README's one quiet gotcha.

      Common gotchas

      • NVIDIA-only telemetry. VRAM, GPU utilization, and power graphs require a working nvidia-smi. On AMD, Intel, or Apple Silicon you still get the operations timeline, RAM, and timings - just no GPU power/VRAM curves.
      • Numbers lie on the first run. The community's benchmark discipline (and this writer's) is: run once to warm caches, then average three runs. The first execution includes model load and page-cache misses and will make your card look slower than it is.
      • Config changes are read at the start of each execution - no restart needed to tweak check_interval or iteration_times.

      It's not going to make your images better. But when you're deciding between fp8 and GGUF Q8, or whether a new sampler is worth the switch, it replaces gut feeling with a timestamped JSON file you can actually compare. For an official tool that's the rare kind of boring that saves real time.

      Category_for_testing/benchmark

      Inputs (3)

      NameTypeDefaultDescription
      capture_benchmarkBOOLEANtrue
      file_prefixSTRING
      file_postfixSTRING

      Outputs (0)

      No outputs