Sampling Timer
Per-combination timing and a progress bar that actually means something
- guider
- samples
- value
Sweeping parameters is fun until the queue is ten videos deep and you have no idea whether it's halfway done or stuck, and no idea which combination is the slow one. Sampling Timer is SweepGrid's answer to both: it wraps the guider feeding a Sampler Custom Advanced and times each individual sampling call, and - optionally - turns ComfyUI's progress bar into a real "2 / 10 combinations sampled" readout. It's the node you add not to make output better but to make the process bearable.
How it works
The node has a mode switch, start or stop, and they're used as a pair. In start mode it takes the guider and wraps it in a TimedGuider object - a pass-through that forwards every attribute to the real guider, but intercepts sample() and measures it with perf_counter_ns, bracketed by ComfyUI's device synchronization call so you're timing actual GPU work, not the queue's idle time. It returns the wrapped guider, and you feed that into Sampler Custom Advanced exactly where the plain guider would go.
In stop mode it takes the sampler's samples output, matches the list item by index, and returns that combination's rounded integer milliseconds. That number can drive a Format Text label - the pack's demo workflows put each clip's sampling time right on its grid cell, which is the single most useful trick in the whole pack when you're deciding whether the 6-step version is worth it.
There's a third input, total (INT, force-input) - connect Build Sweep Combinations.count into it and the Start node drives ComfyUI's native progress bar with text like 2 / 10 combinations sampled, advancing once per successful guider.sample call. That's the "did the whole sweep" bar, distinct from the sampler's own per-step bar. If you only want timing, leave total disconnected and skip the Stop node entirely.
What it does - and doesn't - measure
Timing covers the complete guider.sample call: model prep, wrappers, sampling, cleanup. It excludes VAE decode, interpolation, grid construction, saving - everything outside that call. Two real gotchas: it only works with Sampler Custom Advanced; KSampler and other monolithic nodes aren't instrumented, so this node is strictly for custom-sampler workflows. And ComfyUI's cache is unchanged - a cached (already-run) sampler keeps its recorded duration and doesn't advance progress, because no sampling actually runs. Start feeds exactly one sampling node; Stop's samples input must be connected directly to the sampler output, not through reroutes or list helpers.
Install
Shared pack install: ComfyUI Manager → "ComfyUI-SweepGrid" → Install, restart. Needs ComfyUI 0.31.0+ (it leans on comfy_execution internals and the newer node API), no extra pip packages, no model files.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | COMBO | start | 2 options: start, stop |
| guider | GUIDER | — | |
| samplesopt | LATENT | — | |
| totalopt | INT | 1–10000 | Connect Build Sweep Combinations.count to show aggregate sampling progress. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| value | * | — |