Nodes/Visual Filename Manager (Studio Leiel)/Timer Anchor (Studio Leiel)
ComfyUI Node

Timer Anchor (Studio Leiel)

Render time in your filename, but only for the part you care about

By StudioLeiel·Created 25 days ago·Updated 14 days ago· 0
Timer Anchor (Studio Leiel)
  • any
  • any

Your Visual Filename Manager can already bake render time into the filename via an elapsed chip - but that measures from the start of the whole workflow to the moment the node runs. If you've got a slow VAE decode, a second upscale pass, or a refiner after the main sampling, "total workflow time" tells you nothing about which part is slow. Timer Anchor (Studio Leiel) exists to fix exactly that: it's a pass-through node that re-defines "start" as wherever you place it.

Put one right before your sampler and the elapsed chip now times sampling alone. Put one at the start of an upscale stage and you've got a stopwatch on that stage. It's the pack's smallest node and arguably its most useful debug tool.

How it works

The mechanism is deliberately simple, and reading the source is satisfying. The node takes any input, calls _mark_start("Timer Anchor"), and passes the input straight through:

  • A module-level store (living on Python's builtins, so it survives double-imports) records time.perf_counter() at the moment the anchor runs.
  • The elapsed token in the Studio or Filename Template nodes reads the same store and computes the difference.
  • The pack also patches ComfyUI's PromptExecutor on load, which is what gives you "total workflow time" with no extra nodes - the anchor just narrows the window by overwriting the start point.

Because it returns NaN from IS_CHANGED, it fires every single run - a pass-through that skipped a run would silently freeze your timer at the previous value. And it never fails: if anything goes wrong it swallows the error and just passes your data through, because the one thing worse than a wrong timer is a dead render pipeline.

Inputs and outputs

  • Input: any - a * wildcard socket. Wire it into anything: an image, a latent, a conditioning, a model. It doesn't look at the value at all; the node's only job is to be after whatever you're timing and before the thing you want to time.
  • Output: any - the exact same value, untouched.

That's the whole schema. If you just want render time in your filename, leave it out entirely - the elapsed chip works with no extra nodes. Add the anchor only when you want a narrower window or you're profiling.

Install

Same pack, same steps:

cd ComfyUI/custom_nodes
git clone https://github.com/studioleiel/comfyui-visual-filename-manager

or ComfyUI Manager → search "Visual Filename Manager" → install, restart, hard-refresh the browser. Zero dependencies.

Troubleshooting

  • Timer Anchor has never run in the report → restart ComfyUI fully. The timer hook is Python-side; a frontend refresh won't reload it. This is the single most common complaint with this pack and it's almost always "I only refreshed the browser."
  • Time reads near zero → the Studio node ran before your sampler because it has no image dependency. Connect its run_after input to the image line feeding Save Image to force ordering.
  • Preview shows 50.4 → not a bug. The preview can't know the real duration until the render finishes, so it shows a placeholder; the saved file has the true number.
  • Timer looks wrong after the anchor → remember the anchor overwrites the start time for every elapsed in the workflow, not just the ones after it. One anchor per workflow unless you're deliberately doing something exotic.

The honest take: for a node this small, the "wow" isn't the node itself - it's that the whole timing system (the executor hook, the shared store, the bypass-safe resolution) is baked into one little pack instead of being six disconnected utilities. If you're profiling ComfyUI stages to decide what to optimize, this plus the report output from the main node is a genuinely nice little instrumentation rig.

CategoryStudio Leiel

Inputs (1)

NameTypeDefaultDescription
any*

Outputs (1)

NameTypeDescription
any*