ComfyUI > Nodes > ComfyUI-UniversalToolkit > Get Image or Mask Range From Batch (UTK)

ComfyUI Node: Get Image or Mask Range From Batch (UTK)

Class Name

GetImageRangeFromBatch_UTK

Category
UniversalToolkit/Tools
Author
whmc76 (Account age: 1110days)
Extension
ComfyUI-UniversalToolkit
Latest Updated
2026-03-16
Github Stars
0.07K

How to Install ComfyUI-UniversalToolkit

Install this extension via the ComfyUI Manager by searching for ComfyUI-UniversalToolkit
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-UniversalToolkit in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Get Image or Mask Range From Batch (UTK) Description

Extracts specified image/mask range from batches, enhancing data processing efficiency.

Get Image or Mask Range From Batch (UTK):

The GetImageRangeFromBatch_UTK node is designed to efficiently extract a specified range of images or masks from a batch. This node is particularly useful when working with large datasets where you need to isolate a subset of images or masks for further processing or analysis. By allowing you to specify a starting index and the number of frames to extract, this node provides flexibility and control over the data you are working with. Whether you are dealing with image sequences or mask batches, this node ensures that you can easily access the exact portion of data you need, streamlining your workflow and enhancing productivity.

Get Image or Mask Range From Batch (UTK) Input Parameters:

start_index

The start_index parameter determines the starting point from which images or masks will be extracted from the batch. It accepts integer values, with a default of 0. The minimum value is -1, which indicates that the extraction should start from the end of the batch, while the maximum value is 4096. This parameter is crucial for defining the beginning of the range you wish to extract, allowing you to target specific segments of your data.

num_frames

The num_frames parameter specifies the number of images or masks to extract from the starting index. It accepts integer values, with a default of 1, and ranges from a minimum of 1 to a maximum of 4096. This parameter is essential for determining the size of the data subset you want to work with, enabling you to extract precisely the number of frames needed for your task.

images

The images parameter is an optional input that represents the batch of images from which you want to extract a range. This parameter is used when you are working with image data and provides the source from which the specified range will be extracted.

masks

The masks parameter is an optional input that represents the batch of masks from which you want to extract a range. This parameter is used when you are working with mask data and provides the source from which the specified range will be extracted.

Get Image or Mask Range From Batch (UTK) Output Parameters:

image

The image output parameter provides the extracted range of images from the input batch. This output is crucial for accessing the specific subset of images you need for further processing or analysis, ensuring that you have the right data at your disposal.

mask

The mask output parameter provides the extracted range of masks from the input batch. This output is essential for accessing the specific subset of masks you need, allowing you to focus on the relevant data for your task.

Get Image or Mask Range From Batch (UTK) Usage Tips:

  • To extract images from the end of a batch, set the start_index to -1. This will automatically calculate the starting point from the end of the batch.
  • Ensure that the num_frames parameter does not exceed the total number of images or masks in the batch to avoid errors.

Get Image or Mask Range From Batch (UTK) Common Errors and Solutions:

ValueError: "至少需要提供图像或遮罩输入"

  • Explanation: This error occurs when neither images nor masks are provided as input to the node.
  • Solution: Ensure that you provide at least one of the inputs, either images or masks, to the node.

ValueError: "图像起始索引 <start_index> 超出范围 [0, <max_index>]"

  • Explanation: This error indicates that the specified start_index for images is out of the valid range.
  • Solution: Adjust the start_index to be within the valid range of the image batch indices.

ValueError: "遮罩起始索引 <start_index> 超出范围 [0, <max_index>]"

  • Explanation: This error indicates that the specified start_index for masks is out of the valid range.
  • Solution: Adjust the start_index to be within the valid range of the mask batch indices.

Get Image or Mask Range From Batch (UTK) Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-UniversalToolkit
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Get Image or Mask Range From Batch (UTK)