ComfyUI Node

Frame Selector

Pull any frame range out of a video batch — the node that makes 're-render frames 40–80' easy

By baicai99·Created 2 years ago·Updated about a year ago· 15
Frame Selector
  • images
  • selected_images
  • num_frames
start_frame0
end_frame1
addition_value0

By the time your video reaches ComfyUI's graph, it's not a video anymore. It's one big IMAGE tensor where every frame is a slice of the same batch, and if you want to do anything to part of it - re-render frames 40 to 80, run a different denoise on the first 16, fix the section where the hand touches the object - you have to cut that range out, process it, and splice it back. Frame Selector is the "cut that range out" node, and it's the flagship of the small ComfyUI-FrameSkipping pack.

The mechanism is dead simple, which is the point. Feed it a batch of images plus a start_frame and end_frame, and it returns images[start_frame : end_frame + addition_value]. That's it - a zero-indexed, end-exclusive slice, pure torch, no dependencies, so fast it may as well be free. The addition_value input is the author's way of saying "start at the end, then keep going N more frames": default 0 gives you exactly start to end, set it to 5 and you get five extra frames past end_frame. If you came from AnimateDiff workflows you'll recognize the use case instantly - the pack's author built it to re-render a specific chunk of a clip where a hand's texture changes on touching an object, rather than splitting the video into two blunt halves.

For a beginner, two inputs matter. start_frame and end_frame are 0-indexed positions in the batch - frame 0 is the first frame, so frames 1 through 10 means start=1, end=10. addition_value stays at 0 until you need to extend past your end. On the output side you get two things: selected_images (the slice - wire it into whatever sampler pass you're re-running) and num_frames (an INT you can wire into other nodes that need to know the frame count). That second output is the pack's whole philosophy in one wire: the author is obsessive about keeping image and mask counts in sync, and this is how you prove the slice came out the size you expected.

Here's the failure mode that will bite you: if start_frame, or end_frame + addition_value, lands past the total frame count, the node returns an empty batch with num_frames = 0. No error, no warning - your downstream nodes just quietly get zero frames. It's the classic "my video disappeared" moment, and the fix is always "your end frame is too big." Check num_frames first, then check your math.

One honest note before you install: ComfyUI's core ImageFromBatch does a chunk of this job (batch_index + length). Frame Selector's win is the start/end mental model plus that wired num_frames output. If you already live in ImageFromBatch you can fake most of this - but for the "which frames do I reprocess" workflow, this reads a lot more naturally.

Install is one step: ComfyUI Manager → search "ComfyUI-FrameSkipping", or git clone https://github.com/baicai99/ComfyUI-FrameSkipping into your custom_nodes folder, then restart. No models to download, no pip requirements beyond what ComfyUI already ships. It lives under the "baicai" menu.

Categorybaicai

Inputs (4)

NameTypeDefaultDescription
start_frameINT00–10000
end_frameINT11–10000
imagesIMAGE
addition_valueINT00–10000

Outputs (2)

NameTypeDescription
selected_imagesIMAGE
num_framesINT