Select Every Nth π
Thin a video before the expensive part
- images
- images
Select Every Nth π keeps one frame in every nth of an IMAGE batch and drops the rest - the fastest way to make a video's frame count work for the stage you're about to hit. Halve a 120-frame clip before a VRAM-hungry VAE decode or an upscale pass and you've cut the work in half. Thin a seed sweep of previews down to the samples you actually want to look at. When a stage's cost scales with frame count, this is the throttle you pull before it.
It sits in a batch-surgery family with the pack's Split Batch and Merge Batches, and it fills the gap between "load everything" and "process everything." The alternative is usually re-decoding the video with a different every_nth on the loader, which is slower and forces you back upstream. This node operates on whatever batch is already on the wire, so you can thin at any point in the graph.
How it works
Three inputs: images (the BHWC IMAGE batch to thin), nth (keep one frame in every nth; default 2, minimum 1), and offset (how many frames to skip before the first kept frame; default 0). The math is one slice - frames[offset::nth] - so it's essentially free. The frame numbering is one-based like the rest of the pack: nth = 2, offset = 0 keeps frames 1, 3, 5; offset = 1 keeps 2, 4, 6. Kept frames come out on the images output in their original order.
offset is the detail that makes it useful beyond a plain decimate: it shifts which frame of each block survives. If your video alternates bright and dark frames, offset 0 and offset 1 give you two visibly different thinned clips from the same source - handy when you want to compare which cadence to keep.
Install
ComfyUI Manager is the easy route: search for ComfyUI-AusBoss under Custom Nodes and hit Install, then restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ausboss/ComfyUI-AusBoss.git
Restart ComfyUI and Select Every Nth π sits under π AusBoss/Utility. No extra Python dependencies. Minimum ComfyUI 0.27.1, and hard-refresh with Ctrl+Shift+R after frontend updates.
Common issues
Two bounds to respect. nth below 1 errors (fair enough - "every 0th frame" is nonsense), and offset has to be less than the total frame count; if you try to skip past the end of the batch it stops with a message naming the count. The bigger thing to remember is that thinning is lossy by design - you are discarding motion between the kept frames. That's perfect for a cheap preview pass or a heavy per-frame stage, but if you thin and then save video, the clip will visibly stutter. For the actual export, keep the full frame rate and do the heavy work on a thinned branch that only feeds the stages that need it.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | The BHWC IMAGE batch to thin out. | |
| nth | INT | 21β4096 | Keep one frame in every nth: 2 keeps every other frame. |
| offset | INT | 00β2147483647 | Frames to skip before the first kept frame. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | The kept frames, in their original order. |