ComfyUI Node: Robust Image Range Extractor

Class Name

RobustImageRangeExtractor

Category
VLM/Utility
Author
fblissjr (Account age: 4014days)
Extension
Shrug-Prompter: Unified VLM Integration for ComfyUI
Latest Updated
2025-09-30
Github Stars
0.02K

How to Install Shrug-Prompter: Unified VLM Integration for ComfyUI

Install this extension via the ComfyUI Manager by searching for Shrug-Prompter: Unified VLM Integration for ComfyUI
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Shrug-Prompter: Unified VLM Integration for ComfyUI 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

Robust Image Range Extractor Description

Efficiently extracts image ranges from batches, handling out-of-bounds indices for robust performance.

Robust Image Range Extractor:

The RobustImageRangeExtractor is designed to efficiently extract a range of images from a batch, handling edge cases gracefully to ensure robust performance. This node is particularly useful in scenarios where you need to work with sequences of images, such as video frames, and want to avoid errors when indices are out of bounds. It ensures that even if the requested range exceeds the available data, a valid output is still provided, making it highly reliable for iterative processes or loops. By managing boundary conditions effectively, it prevents common pitfalls associated with image extraction, such as accessing non-existent indices, and provides a seamless experience for users working with image sequences.

Robust Image Range Extractor Input Parameters:

images

This parameter represents the batch of images from which you want to extract a range. It is expected to be a 4D tensor with dimensions corresponding to batch size, height, width, and channels. The node will operate on this input to extract the specified range of images.

num_frames

This integer parameter specifies the number of frames you wish to extract from the batch. It has a default value of 1 and a minimum value of 1, ensuring that at least one frame is always extracted. The number of frames directly impacts the size of the output image range.

start_index

An optional integer parameter that determines the starting index for the extraction process. It defaults to 0 and has a minimum value of 0, ensuring that the extraction starts from a valid position within the batch. Adjusting this parameter allows you to control where the extraction begins.

masks

This optional parameter allows you to provide a mask tensor that corresponds to the images. If provided, the node will extract the corresponding range of masks alongside the images. If not provided, a dummy mask will be created to ensure compatibility with the output format.

Robust Image Range Extractor Output Parameters:

IMAGE

This output represents the extracted range of images from the input batch. It is a subset of the original images, determined by the num_frames and start_index parameters. The output ensures that even if the requested range exceeds the available data, a valid image range is returned.

MASK

The mask output corresponds to the extracted range of images. If a mask was provided as an input, this output will contain the relevant portion of the mask. If no mask was provided, a dummy mask is generated to maintain consistency in the output format.

Robust Image Range Extractor Usage Tips:

  • Ensure that the images input is a 4D tensor to avoid dimension-related errors.
  • Use the start_index parameter to control the starting point of your extraction, especially when working with large batches.
  • If you do not have a mask to provide, the node will automatically generate a dummy mask, so you can focus on the image extraction without worrying about mask compatibility.

Robust Image Range Extractor Common Errors and Solutions:

Expected 4D tensor (B,H,W,C), got <images.dim()>D

  • Explanation: This error occurs when the input images tensor does not have four dimensions, which is required for the node to function correctly.
  • Solution: Ensure that your input tensor is 4D, with dimensions representing batch size, height, width, and channels.

No valid indices

  • Explanation: This message indicates that the calculated indices for extraction are not valid, possibly due to an incorrect start_index or num_frames value.
  • Solution: Check the start_index and num_frames parameters to ensure they are within the valid range for your batch size. Adjust them as necessary to obtain a valid range of indices.

Robust Image Range Extractor Related Nodes

Go back to the extension to check out more related nodes.
Shrug-Prompter: Unified VLM Integration for ComfyUI
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.

Robust Image Range Extractor