Nodes/ComfyUI-AusBoss/Select Every Nth πŸ†Ž
ComfyUI Node

Select Every Nth πŸ†Ž

Thin a video before the expensive part

By ausbossΒ·Created about a month agoΒ·Updated 3 days agoΒ· 2
Select Every Nth πŸ†Ž
  • images
  • images
β—„nth2β–Ί
β—„offset0β–Ί

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.

CategoryπŸ†Ž AusBoss/Utility

Inputs (3)

NameTypeDefaultDescription
imagesIMAGEThe BHWC IMAGE batch to thin out.
nthINT21–4096Keep one frame in every nth: 2 keeps every other frame.
offsetINT00–2147483647Frames to skip before the first kept frame.

Outputs (1)

NameTypeDescription
imagesIMAGEThe kept frames, in their original order.