Select Images π₯π ₯π π ’(SelectImages)
This node receives an input of type IMAGE, which is typically a tensor with a shape of `[batch_size, height, width, channels]`, representing a batch of images.
Select Images
The Select Images π₯π
₯π
π
’ node receives an input of type IMAGE, which is typically a tensor with a shape of [batch_size, height, width, channels], representing a batch of images.
The Select Images node is a tool for filtering specific frames or images from a set. Its core function is to extract corresponding images from an image batch (usually a tensor containing multiple images) based on user-specified indices. This allows users to flexibly select and process specific parts of an image sequence.
Node Functionality
This node receives an input of type IMAGE, which is typically a tensor with a shape of [batch_size, height, width, channels], representing a batch of images. Users specify the indices of the images to be selected via a string parameter indexes, which supports single indices, multiple indices separated by commas, and continuous ranges indicated by hyphens. Internally, the node parses this string and determines how to handle invalid indices or empty results based on the err_if_missing and err_if_empty parameters.
Node Parameter Description - Select Images π₯π ₯π π ’
Connection Inputs (Inputs)
| Parameter Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
image | IMAGE | Yes | - | - | image (input parameter): Input a batch containing multiple images. The node will select the specified images from it. |
Control Parameters (Parameters)
| Parameter Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
indexes | STRING | Yes | 0 | - | indexes (input parameter): Specifies the indices of the images to select. The format can be like "0,2,4" or "1-5". Indices start from 0. |
err_if_missing | BOOLEAN | Yes | True | - | err_if_missing (input parameter): When set to True, the node will report an error if a specified index is out of the range of the input images. |
err_if_empty | BOOLEAN | Yes | True | - | err_if_empty (input parameter): When set to True, the node will report an error if the selection result based on the indices is empty (no images). |
Output
| Parameter Name | Data Type | Description |
|---|---|---|
| IMAGE | IMAGE | IMAGE (output parameter): Outputs the filtered batch of images based on the specified indices. |
Usage Scenarios
In a video frame processing workflow, you can use this node to select only the 1st, 3rd, and 5th frames from an image sequence loaded by a Load Image node for subsequent stylization processing. Alternatively, after generating a set of variant images, use this node to extract only the images you consider to be of the best quality for further upscaling or compositing operations.
Notes
Please note that the input indexes string must conform to specific format specifications, such as "0,2,4" or "1-5". If a specified index exceeds the actual range of the input image batch and err_if_missing is set to True, the node will report an error. Similarly, if the selection result is empty and err_if_empty is True, an error will also occur.
Select Images π₯π ₯π π ’ Node Source Code Link
The Select Images π₯π ₯π π ’ node is from the ComfyUI-VideoHelperSuite node package.
Comments
Sign in with GitHub to join the discussion.