ComfyUI > Nodes > Basic data handling > create from LISTs

ComfyUI Node: create from LISTs

Class Name

Basic data handling: DictCreateFromLists

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

create from LISTs Description

DictCreateFromLists node pairs elements from two lists into a dictionary, handling differing lengths.

create from LISTs:

The DictCreateFromLists node is designed to facilitate the creation of a dictionary by pairing elements from two separate lists: one containing keys and the other containing values. This node is particularly useful when you have data organized in parallel lists and need to combine them into a single dictionary structure. The node intelligently handles lists of differing lengths by only pairing elements up to the length of the shorter list, ensuring that no mismatches occur. This functionality is essential for efficiently managing and organizing data, allowing you to transform list-based data into a more structured and accessible format.

create from LISTs Input Parameters:

keys

The keys parameter is a list that contains the keys for the dictionary you wish to create. Each element in this list will serve as a key in the resulting dictionary. The order of keys in this list is crucial as it determines the pairing with the corresponding values from the values list. There are no specific minimum or maximum values for this parameter, but it should be noted that the number of keys should ideally match the number of values to ensure a complete dictionary. If the list of keys is shorter than the list of values, only the keys up to the length of the shorter list will be used.

values

The values parameter is a list that contains the values for the dictionary you wish to create. Each element in this list will serve as a value in the resulting dictionary, paired with the corresponding key from the keys list. Similar to the keys parameter, the order of values is important as it determines the pairing with the keys. There are no specific minimum or maximum values for this parameter, but it should be noted that the number of values should ideally match the number of keys to ensure a complete dictionary. If the list of values is shorter than the list of keys, only the values up to the length of the shorter list will be used.

create from LISTs Output Parameters:

DICT

The output of the DictCreateFromLists node is a dictionary, denoted as DICT. This dictionary is constructed by pairing each key from the keys list with the corresponding value from the values list. The resulting dictionary provides a structured and easily accessible format for your data, allowing for efficient data retrieval and manipulation. The dictionary will only contain as many key-value pairs as the length of the shorter input list, ensuring that all pairs are valid and complete.

create from LISTs Usage Tips:

  • Ensure that both the keys and values lists are correctly aligned in terms of the order of elements to avoid mismatched key-value pairs in the resulting dictionary.
  • If you anticipate that the lists might be of different lengths, consider pre-processing the lists to ensure they are of equal length or handle the potential truncation of pairs in your workflow.

create from LISTs Common Errors and Solutions:

Mismatched list lengths

  • Explanation: When the keys and values lists are of different lengths, the node will only create pairs up to the length of the shorter list, potentially leaving some elements unpaired.
  • Solution: Verify that both lists are of the same length before using the node, or handle the truncation of pairs in your workflow to ensure all necessary data is included.

Invalid key or value types

  • Explanation: If the elements in the keys or values lists are not of a type that can be used in a dictionary (e.g., unhashable types for keys), the node may not function as expected.
  • Solution: Ensure that all elements in the keys list are of a hashable type (e.g., strings, numbers) and that the values list contains valid data types for dictionary values.

create from LISTs 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.

create from LISTs