GU Calculate Frame Count
Your loader says 300 frames, but you're really working with 150
- real_frames
GU Calculate Frame Count exists for one situation: you've told a video loader to skip frames, and now every downstream node that counts frames is lying to you. The loader happily reports the raw source total, but the number of frames you'll actually process is load_frames / load_nth. This node does that division for you and hands you the real number as an integer, ready to feed a loop, a progress display, or another node that needs to know how much work is coming.
It's a "tell me the truth about my graph" node, not a pixel-touching one. If you've ever wired a video loader into a loop counter and watched it count 300 iterations when only 150 frames were actually loaded, you know exactly why the author built it.
How it works
Three integer inputs, one integer output:
- frames_total - frames in the source video (the tooltip's own words).
- load_frames - how many frames you asked the loader to load.
- load_nth - load every n-th frame.
The math is simple: it computes load_frames / load_nth, and if that lands between zero and frames_total, that's your real_frames output. Otherwise it returns frames_total (which is what happens when load_nth is 1 - no skipping, so the effective count is just the loaded count). A load_nth below 1 is treated as 0 frames, so don't do that.
All three inputs are forceInput, meaning you wire them in rather than typing values. That's the point - they come from the loader upstream, so the number stays honest when you change the skip factor.
Why you'd reach for it
Frame skipping shows up most in the video world - loading a long source with load_nth: 2 to halve the work, or grabbing every 4th frame for a rough pass. Once you do that, anything that assumes "frames == source frames" is wrong: a sampler loop that runs once per frame, a batch-size calculation, an image sequence saver counting output files. Drop this node between the loader's count outputs and the consumer, and the count matches reality.
Install
The pack ships no models and needs no downloads beyond its Python deps. Easiest path is ComfyUI Manager:
- Manager → Custom Nodes Manager → search "GU Nodepack" (the repo is
alexguryev/ComfyUI-GU_Nodepack). - Install, then restart ComfyUI.
Manual, if you prefer:
cd ComfyUI/custom_nodes
git clone https://github.com/alexguryev/ComfyUI-GU_Nodepack
cd ComfyUI-GU_Nodepack
pip install -r requirements.txt # psutil, requests, gu-funclib>=1.9.0
Restart, and the nodes appear under the GU_Nodepack category. Note it's tested on Windows; Linux/macOS is best-effort, and the author warns it's designed for a single-user instance.
Gotchas
The output is a plain integer, so wire it anywhere an INT is accepted. The trap most people hit is the opposite one: they don't have frame skipping and feed this node anyway, expecting it to change something. It's a calculator, not a filter - if load_nth is 1, it just echoes back the loaded count. That's correct behavior. The other gotcha is reading the loader's raw "total frames" widget instead of its actual load-count output; the node can only divide what you feed it, so feed it the numbers that reflect reality.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| frames_total | INT | frames in src video | |
| load_frames | INT | — | |
| load_nth | INT | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| real_frames | INT | — |