ComfyUI Node: insert

Class Name

Basic data handling: ListInsert

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

insert Description

ListInsert node inserts an item at a specified index in a list, aiding dynamic data management.

insert:

The ListInsert node is designed to enhance your data manipulation capabilities by allowing you to insert an item into a specific position within a list. This node is particularly useful when you need to modify lists dynamically, such as adding new elements at precise locations without disrupting the existing order. By leveraging this node, you can efficiently manage and organize data, ensuring that your lists are structured exactly as needed for your creative projects. The primary function of this node is to take a list, an index, and an item, and return a new list with the item inserted at the specified index, making it a versatile tool for data handling tasks.

insert Input Parameters:

list

This parameter represents the list into which you want to insert an item. It serves as the base structure that will be modified by the node. The list can contain any type of elements, and the node will create a copy of this list to perform the insertion, ensuring that the original list remains unchanged. 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 new item should be inserted. It is an integer value, with a default of 0, meaning that if no index is specified, the item will be inserted at the beginning of the list. If the index is greater than the length of the list, the item will be appended to the end. This parameter allows you to control the exact placement of the new item within the list.

item

This parameter is the element you wish to insert into the list. It can be of any data type, providing flexibility to insert various types of data into your list. The item will be placed at the position specified by the index parameter, allowing you to customize the content and order of your list according to your needs.

insert Output Parameters:

list

The output is a new list that includes the item inserted at the specified index. This list reflects the changes made by the node, showing the updated order and content after the insertion. The output list is a copy of the original list with the new item added, ensuring that the original list remains unaltered. This allows you to work with the modified list while preserving the initial data structure.

insert Usage Tips:

  • Use the index parameter to strategically place new items in your list, ensuring that the order of elements aligns with your project requirements.
  • If you want to add an item to the end of the list, you can specify an index that is equal to or greater than the length of the list, which will automatically append the item.

insert Common Errors and Solutions:

IndexError: list index out of range

  • Explanation: This error occurs when the specified index is outside the bounds of the list.
  • Solution: Ensure that the index is within the valid range of the list. If you intend to append the item, use an index equal to or greater than the list's length.

TypeError: 'NoneType' object is not subscriptable

  • Explanation: This error may occur if the list parameter is not properly initialized or is set to None.
  • Solution: Verify that the list parameter is correctly defined and contains a valid list before using the node.

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

insert