ComfyUI Node: VLM Result Iterator

Class Name

VLMResultIterator

Category
VLM/Results
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

VLM Result Iterator Description

Efficiently iterates VLM responses by index, enhancing performance and reducing memory usage.

VLM Result Iterator:

The VLMResultIterator is a specialized node designed to efficiently iterate over a collection of responses without duplicating data. This node is particularly useful when you need to access specific elements within a collection, such as responses from a virtual language model (VLM), without the overhead of copying the entire dataset. By providing a streamlined method to retrieve results by index, the VLMResultIterator enhances performance and reduces memory usage, making it an ideal choice for applications where efficiency is paramount. Its primary function, get_result, allows you to access a response at a given index, determine the total number of responses, and check if there are more responses available. This node is categorized under "VLM/Results," emphasizing its role in handling and processing VLM outputs.

VLM Result Iterator Input Parameters:

collection

The collection parameter is a required input that specifies the source of the responses. It is expected to be of type VLM_COLLECTION, which typically contains a list of responses generated by a virtual language model. This parameter is crucial as it provides the data set from which the iterator will retrieve individual responses. The collection serves as the foundation for the node's operation, and its content directly impacts the results produced by the iterator.

index

The index parameter is an integer that determines which response to retrieve from the collection. It has a default value of 0, with a minimum value of 0, ensuring that the index is always within a valid range. This parameter allows you to specify the exact position of the response you wish to access, enabling precise control over the data retrieval process. By adjusting the index, you can navigate through the collection and extract specific responses as needed.

VLM Result Iterator Output Parameters:

text

The text output parameter provides the actual response retrieved from the collection at the specified index. This output is a string that represents the content of the response, allowing you to access and utilize the specific data point you are interested in. The text output is essential for applications that require direct interaction with individual responses.

total_count

The total_count output parameter is an integer that indicates the total number of responses available in the collection. This information is valuable for understanding the size of the dataset and for planning further iterations or processing steps. Knowing the total_count helps you manage the scope of your operations and ensures that you do not attempt to access responses beyond the available range.

has_more

The has_more output parameter is a boolean value that signifies whether there are additional responses available beyond the current index. If has_more is true, it indicates that you can continue iterating through the collection to access more responses. This output is useful for controlling loops or iterative processes, as it provides a clear indication of when to stop retrieving data.

VLM Result Iterator Usage Tips:

  • Use the index parameter to navigate through the collection efficiently, starting from 0 and incrementing as needed to access subsequent responses.
  • Check the has_more output to determine if additional responses are available, which can help you manage loops and avoid out-of-range errors.
  • Utilize the total_count output to understand the size of the collection and plan your data processing strategy accordingly.

VLM Result Iterator Common Errors and Solutions:

IndexError: list index out of range

  • Explanation: This error occurs when the specified index is greater than or equal to the total_count of responses in the collection.
  • Solution: Ensure that the index is within the valid range by checking the total_count output before attempting to access a response. Adjust the index accordingly to prevent accessing out-of-range elements.

TypeError: 'NoneType' object is not subscriptable

  • Explanation: This error may occur if the collection parameter is not properly initialized or if it does not contain a valid list of responses.
  • Solution: Verify that the collection is correctly set up and contains a valid list of responses. Ensure that the collection parameter is of type VLM_COLLECTION and is not None.

VLM Result Iterator 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.

VLM Result Iterator