Video Helper Suite πŸŽ₯πŸ…₯πŸ…—πŸ…’/imagegenerated

Select Every Nth Image πŸŽ₯πŸ…₯πŸ…—πŸ…’(SelectEveryNthImage)

This node receives a tensor containing multiple images as input and uses two integer parameters to control the filtering logic.

Select Every Nth Image

images
IMAGE
count
select_every_nth
INT
skip_first_images
INT
VideoHelperSuite

The Select Every Nth Image πŸŽ₯πŸ…₯πŸ…—πŸ…’ node receives a tensor containing multiple images as input and controls the filtering logic through two integer parameters.

The Select Every Nth Image node is a tool for filtering image sequences. Its core function is to selectively extract a subset of images from a continuous image sequence based on specified interval rules. This helps users quickly streamline or resample image data.

Node Function

This node receives a tensor containing multiple images as input and controls the filtering logic through two integer parameters. Its internal mechanism uses slicing operations: it first skips a specified number of starting images, then selects one image every N images. Ultimately, it outputs a new, shorter image sequence and simultaneously returns the number of images contained in the new sequence.

Node Parameter Description - Select Every Nth Image πŸŽ₯πŸ…₯πŸ…—πŸ…’

Connection Inputs (Inputs)

Parameter NameData TypeRequiredDefault ValueRange/OptionsDescription
imagesIMAGEYes--images (input parameter): Input an image sequence tensor. The node will filter images from this sequence.

Control Parameters (Parameters)

Parameter NameData TypeRequiredDefault ValueRange/OptionsDescription
select_every_nthINTYes11 - BIGMAX (step: 1)select_every_nth (input parameter): Sets the interval for image selection. Must be an integer greater than or equal to 1. For example, setting it to 2 selects every second image.
skip_first_imagesINTYes00 - BIGMAX (step: 1)skip_first_images (input parameter): Sets the number of images to skip before starting selection. Must be an integer greater than or equal to 0.

Output

Parameter NameData TypeDescription
IMAGEIMAGEIMAGE (output parameter): Outputs the new image sequence obtained after filtering.
countINTcount (output parameter): Outputs the total number of images contained in the new image sequence.

Usage Scenarios

In practical workflows, this node is commonly used for processing video or animation frame sequences. For example, when you have a high-frame-rate video image sequence but only need a subset of keyframes for creating a time-lapse effect, you can connect this node and set select_every_nth to the desired interval (e.g., 10) to extract one frame every 10 frames. Another common scenario is when, after batch processing images, you need to skip initial test frames and only select subsequent stable output images for composition.

Notes

Please note that the input images parameter must be a valid image sequence tensor. The value of skip_first_images cannot exceed the total length of the input sequence; otherwise, it will result in an empty output sequence.

The Select Every Nth Image πŸŽ₯πŸ…₯πŸ…—πŸ…’ node is from the ComfyUI-VideoHelperSuite node package.

Comments

Sign in with GitHub to join the discussion.

Loading comments…