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
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 Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
images | IMAGE | Yes | - | - | images (input parameter): Input an image sequence tensor. The node will filter images from this sequence. |
Control Parameters (Parameters)
| Parameter Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
select_every_nth | INT | Yes | 1 | 1 - 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_images | INT | Yes | 0 | 0 - 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 Name | Data Type | Description |
|---|---|---|
| IMAGE | IMAGE | IMAGE (output parameter): Outputs the new image sequence obtained after filtering. |
| count | INT | count (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.
Select Every Nth Image π₯π ₯π π ’ Node Source Code Link
The Select Every Nth Image π₯π ₯π π ’ node is from the ComfyUI-VideoHelperSuite node package.
Comments
Sign in with GitHub to join the discussion.