ComfyUI Node: set item

Class Name

Basic data handling: ListSetItem

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

set item Description

ListSetItem node replaces an item in a list at a specified index with a new value for precise updates.

set item:

The "Basic data handling: ListSetItem" node is designed to modify a list by replacing an existing item at a specified position with a new value. This node is particularly useful when you need to update elements within a list without altering the entire structure. By allowing you to specify the exact index and the new value, it provides precise control over list modifications, making it an essential tool for tasks that require dynamic data manipulation. This capability is beneficial in scenarios where lists are used to store sequences of data that need to be updated frequently, such as in iterative processes or when managing collections of items that change over time.

set item Input Parameters:

list

This parameter represents the list you want to modify. It serves as the primary data structure that will be altered by the node. The list can contain any type of elements, and its contents will be copied to create a new list with the specified modifications. There are no specific minimum or maximum values for this parameter, as it can be any list of elements.

index

The index parameter specifies the position within the list where the replacement should occur. It is an integer value, with a default of 0, indicating the first position in the list. The index must be within the bounds of the list; otherwise, an error will occur. This parameter is crucial for determining which element in the list will be replaced by the new value.

value

This parameter is the new value that will replace the existing item at the specified index in the list. It can be of any data type, allowing for flexibility in the types of elements that can be inserted into the list. The value parameter is essential for updating the list with the desired data.

set item Output Parameters:

list

The output is a new list that reflects the changes made by replacing the item at the specified index with the new value. This output maintains the original list's structure, with only the specified modification applied. The updated list is returned as a tuple containing the modified list, ensuring that the original list remains unchanged.

set item Usage Tips:

  • Ensure that the index you specify is within the bounds of the list to avoid errors. You can use the length of the list to determine valid index values.
  • Use this node when you need to update specific elements in a list without affecting the entire list, which is useful in iterative processes or when managing dynamic data collections.

set item Common Errors and Solutions:

IndexError: Index <index> out of range for LIST of length <length>

  • Explanation: This error occurs when the specified index is outside the valid range of the list. The index must be a valid position within the list, from 0 to the length of the list minus one.
  • Solution: Verify that the index is within the bounds of the list. You can check the list's length and ensure the index is a valid position before attempting to set the item.

set item 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.

set item