ComfyUI Node: enumerate

Class Name

Basic data handling: SetEnumerate

Category
Basic/SET
Author
StableLlama (Account age: 861days)
Extension
Basic data handling
Latest Updated
2026-05-07
Github Stars
0.04K

How to Install Basic data handling

Install this extension via the ComfyUI Manager by searching for Basic data handling
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Basic data handling 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

enumerate Description

Transforms a set into indexed tuples, enabling ordered processing with customizable start index.

enumerate:

The SetEnumerate node is designed to transform a set of elements into a list of indexed tuples, effectively enumerating each element within the set. This node is particularly useful when you need to assign a unique index to each element in a set, which is inherently unordered. By providing an index alongside each element, you can maintain a consistent reference to each item, which is beneficial for tasks that require ordered processing or when integrating with systems that rely on indexed data. The node's ability to specify a starting index allows for flexible enumeration, making it adaptable to various scenarios where custom indexing is required.

enumerate Input Parameters:

set

The set parameter is the primary input for the SetEnumerate node, representing the collection of elements you wish to enumerate. This parameter accepts a set of any data type, allowing for a diverse range of elements to be processed. The function of this parameter is to provide the unordered collection that will be transformed into an indexed list. There are no specific minimum or maximum values for this parameter, as it can contain any number of elements, including an empty set. The impact of this parameter on the node's execution is direct, as it determines the elements that will be included in the output list of tuples.

start

The start parameter is an optional integer that specifies the initial index value for the enumeration process. By default, this parameter is set to 0, meaning the first element in the set will be indexed as 0. However, you can customize this starting index to any integer value, which can be particularly useful when integrating with other systems or processes that require specific index offsets. The start parameter influences the numbering of the output tuples, allowing for greater control over the indexing scheme used in the enumeration.

enumerate Output Parameters:

LIST

The output of the SetEnumerate node is a LIST of tuples, where each tuple consists of an index and a corresponding value from the input set. This output is crucial for maintaining a structured and ordered representation of the originally unordered set. Each tuple provides a consistent reference to an element, facilitating tasks that require ordered data processing or integration with systems that utilize indexed data structures. The list format ensures compatibility with various data handling and manipulation operations, making it a versatile output for further processing.

enumerate Usage Tips:

  • To ensure consistent results, be aware that the order of elements in the output list is arbitrary due to the unordered nature of sets. If order matters, consider using a list instead of a set.
  • Utilize the start parameter to align the enumeration with existing indexed data or to create custom index offsets that suit your specific application needs.

enumerate Common Errors and Solutions:

TypeError: 'set' object is not iterable

  • Explanation: This error occurs if the input provided is not a set or if the set contains non-iterable elements.
  • Solution: Ensure that the input is a valid set and that all elements within the set are iterable.

ValueError: invalid literal for int() with base 10

  • Explanation: This error might occur if the start parameter is not an integer or is improperly formatted.
  • Solution: Verify that the start parameter is an integer and is correctly specified in the input parameters.

enumerate Related Nodes

Go back to the extension to check out more related nodes.
Basic data handling
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.