ComfyUI Node

GU TimerON

Start the stopwatch before your sampler runs — GU TimerON

By alexguryev·Created 4 months ago·Updated 23 days ago· 2
GU TimerON
  • any_i
  • any_o

ComfyUI doesn't tell you how long a generation took, and sometimes you want that number on a wire - burned into the saved image's info block, or into a filename, or just sitting in a preview so you can compare sampler settings. GU TimerON is half of the stopwatch that gives it to you. Drop it in your pipeline, and the moment it runs it stamps a start time into the pack's internal state. Its partner, GU TimerOFF, later stops the clock and hands you the elapsed time as a string. On its own it does almost nothing visible; as a pair it's a timing instrument.

The author's usage note is a one-liner: "Place before sampler!" That's the whole installation strategy. You put TimerON upstream of the work you want to measure - typically just before the KSampler - and TimerOFF after it.

How it works

Mechanically it's a pass-through wearing a watch. The node takes a single wildcard any_i input and returns it unchanged as any_o, so it slots into an existing wire without disturbing the data flow - you can chain it right before the sampler's model or latent input and the generation is unaffected. Its real job happens in the background: it records time.time() into a module-level global that TimerOFF reads.

The subtle bit is that a plain pass-through would get cached and skipped by ComfyUI on the second run - which would break the clock, because the start time wouldn't update. So the node's IS_CHANGED returns NaN, the standard ComfyUI idiom for "always execute, every run." That's the same trick the plumbing layer uses for any node that must fire each time regardless of caching. It works, but it has a cost: an always-dirty node poisons the cache for anything downstream of it, so don't scatter timers around a huge graph for fun.

The inputs and output

  • any_i - any type, forced to a connection; this is what gets passed through. Usually you hang it off the sampler's input line (model or latent) so it runs at the right moment.
  • any_o - the same value, forwarded untouched. Wire it into the sampler.

That's the whole surface. No widgets, no settings. Pair it with TimerOFF, which is where the actual timing output lives.

Installing it

This node comes with GU_Nodepack:

cd ComfyUI/custom_nodes
git clone https://github.com/alexguryev/ComfyUI-GU_Nodepack

Restart ComfyUI, or install via ComfyUI Manager → search "GU_Nodepack". Dependencies are psutil, requests, and gu-funclib via pip; nothing else.

Gotchas

TimerON and TimerOFF talk through a single shared global, so they're a matched set - one TimerON feeding one TimerOFF, in the same queue run. If you start two timers or run the pair across an interrupted run, the pairing gets weird and TimerOFF may report nonsense (an empty string and zero seconds). And because of the always-execute design, don't put this node in a spot that runs more often than you intend. Windows is the tested platform, and the pack is built for single-user ComfyUI - the shared-global timer is exactly the kind of thing that could race on a multi-user server.

CategoryGU_Nodepack

Inputs (1)

NameTypeDefaultDescription
any_i*

Outputs (1)

NameTypeDescription
any_o*