ComfyUI Node: index

Class Name

Basic data handling: DataListIndex

Category
Basic/Data List
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

index Description

DataListIndex node locates the index of a value in a list, returning -1 if not found.

index:

The DataListIndex node is designed to help you find the position of a specific value within a list. This node is particularly useful when you need to determine the index of the first occurrence of a value, allowing you to efficiently locate elements within your data. By providing optional parameters to specify a range within the list, you can narrow down your search to a specific segment, enhancing the node's flexibility and precision. If the value is not found, the node returns -1, ensuring you have a clear indication of the value's absence. This functionality is essential for tasks that require precise data manipulation and retrieval, making it a valuable tool in your data handling toolkit.

index Input Parameters:

list

This parameter represents the list in which you want to search for a specific value. It accepts any type of list, allowing you to work with diverse data sets. The list serves as the primary data structure for the search operation, and its contents determine the scope of the search.

value

The value parameter specifies the item you are searching for within the list. It can be of any data type, matching the types present in the list. The node will return the index of the first occurrence of this value, making it crucial for identifying specific elements.

start

This optional parameter defines the starting index for the search within the list. By default, it is set to 0, meaning the search begins at the start of the list. Adjusting this parameter allows you to skip over initial elements and focus on a specific portion of the list.

end

The end parameter is optional and sets the endpoint for the search. By default, it is set to -1, which indicates that the search should continue to the end of the list. Specifying an end index allows you to limit the search to a particular segment, providing greater control over the search range.

index Output Parameters:

index

The index output parameter returns the position of the first occurrence of the specified value within the list. If the value is found, it provides the zero-based index, which is essential for accessing or modifying elements at that position. If the value is not present, it returns -1, indicating that the search was unsuccessful.

index Usage Tips:

  • Use the start and end parameters to limit the search to a specific section of the list, which can improve performance when dealing with large data sets.
  • If you expect the value might not be present in the list, be prepared to handle the -1 return value to avoid errors in subsequent operations.

index Common Errors and Solutions:

ValueError: list.index(x): x not in list

  • Explanation: This error occurs when the specified value is not found within the list.
  • Solution: Ensure that the value you are searching for exists in the list. You can also handle the -1 return value to manage cases where the value is absent.

TypeError: 'NoneType' object is not subscriptable

  • Explanation: This error might occur if the list or value parameters are not properly initialized or passed as None.
  • Solution: Verify that both the list and value parameters are correctly provided and not None. Ensure that the list is a valid list object and the value is appropriately defined.

index 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.

index