ComfyUI Node

Profiler Timing

Timing data you can wire into the graph, not just read off a badge

By phazei·Created 5 months ago·Updated 22 days ago· 33
Profiler Timing
  • any
  • node_link
  • passthrough
  • elapsed
  • node_time
node_ids

Most profiling in ComfyUI is passive: badges appear over nodes after a run, you squint at them, you move on. Profiler Timing is the version that hands the numbers to you on output wires, so you can log them, condition on them, or feed them into whatever comes next. It's part of the phazei/ComfyUI-Enhancement-Utils pack, and it's the programmatic half of the pack's node profiler - the one the author calls the feature he's most proud of.

The profiler itself is clever under the hood: it monkey-patches ComfyUI's execution pipeline to record each node's wall-clock time, keyed by execution ID, and stores it server-side so badges survive navigation and refresh. This node is the way you reach into that same data from inside a workflow - you wire it in, and it reads the timing state at the moment it executes.

How it works

The node sits inline in your graph, and that placement is the whole trick. ComfyUI executes nodes in dependency order, so by connecting your data through anypassthrough, you guarantee this node runs exactly when you want it to measure. It reads two things from the profiler's internal state: elapsed, the wall-clock seconds since execution started (unique to wherever this instance sits in the graph), and node_time, the execution time of specific nodes you point it at.

Inputs and outputs

  • any - connect your data flow through here to place the node inline; it passes through unchanged.
  • node_link - connect any output from a node to measure that node's time. The data itself is ignored; only the source node's identity matters.
  • node_ids - instead of wiring, type comma-separated IDs (e.g. 43,32:234,54). Plain IDs resolve subgraph-first, then root; a subgraph container ID returns the sum of everything inside it. Both node_link and node_ids add together.
  • passthrough - your any data, unchanged and type-matched.
  • elapsed - FLOAT, seconds since execution started.
  • node_time - FLOAT, summed execution time of the resolved node(s), in seconds.

Installing it

Same pack, same drill. ComfyUI Manager, search "Enhancement Utils", or:

cd ComfyUI/custom_nodes
git clone https://github.com/phazei/ComfyUI-Enhancement-Utils.git
cd ComfyUI-Enhancement-Utils
pip install -r requirements.txt

Restart. Look under utils - and note the profiler badges are on by default; there's a "Node Profiler - Enabled" toggle in Settings if you want the timing without the chrome.

Where people get burned

  • node_time returns 0.0 for cached or unresolved nodes. If a node was skipped by caching, it has no timing entry - you get a clean zero, not an error. Treat 0.0 as "didn't run this time," not a bug.
  • node_link can't resolve nodes inside new-style LiteGraph subgraphs. The source comments call this out directly: link resolution reads the original prompt, which doesn't contain those ephemeral subgraph nodes. If you're profiling inside a subgraph, use node_ids as the fallback.
  • Caching is by design. The node deliberately doesn't invalidate ComfyUI's cache, so a cached run returns the previous run's values. That's intentional - a profiling node shouldn't force re-execution just to measure - but it means "old numbers" on a cached rerun is expected behavior.
Categoryutils

Inputs (3)

NameTypeDefaultDescription
anyCOMFY_MATCHTYPE_V3Connect any output here to place this node inline in the workflow. The data passes through unchanged.
node_linkopt*Connect any output from a node to measure that node's execution time. The data itself is ignored.
node_idsoptSTRINGComma-separated node IDs to look up (e.g. "43,32:234,54"). Plain IDs are resolved relative to the current subgraph first, then root. Subgraph container IDs return the total of all nodes inside.

Outputs (3)

NameTypeDescription
passthroughCOMFY_MATCHTYPE_V3The 'any' input forwarded unchanged.
elapsedFLOATSeconds since execution started.
node_timeFLOATExecution time in seconds for the resolved node(s). Summed if multiple IDs are provided.