ComfyUI Node: from keys

Class Name

Basic data handling: DictFromKeys

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

from keys Description

DictFromKeys node creates a dictionary from a list of keys with a uniform default value.

from keys:

The DictFromKeys node is designed to facilitate the creation of a dictionary from a list of keys, with each key being associated with a specified default value. This node is particularly useful when you need to initialize a dictionary with a predefined set of keys, ensuring that each key is mapped to a uniform value. If no specific value is provided, the node defaults to using None as the value for all keys. This functionality is beneficial for setting up data structures where the keys are known in advance, but the values are either uniform or not yet determined. By automating the dictionary creation process, this node simplifies tasks that involve initializing dictionaries, making it easier to manage and manipulate data in your projects.

from keys Input Parameters:

keys

The keys parameter is a required input that specifies the list of keys to be used in the dictionary. Each element in this list will become a key in the resulting dictionary. This parameter is crucial as it defines the structure of the dictionary by determining which keys will be present. There are no specific minimum or maximum values for this parameter, but it should be a list of valid keys that you intend to use in your dictionary.

value

The value parameter is an optional input that determines the default value to be associated with each key in the dictionary. If this parameter is not provided, the node will use None as the default value for all keys. This parameter allows you to initialize all keys with a specific value, which can be useful for setting a baseline or placeholder value in your dictionary. The flexibility of this parameter enables you to customize the initial state of your dictionary according to your needs.

from keys Output Parameters:

DICT

The output of the DictFromKeys node is a dictionary, denoted as DICT. This dictionary contains all the keys specified in the input parameter, each associated with the default value provided (or None if no value was specified). The resulting dictionary is a structured data object that can be used in subsequent operations or nodes, allowing you to efficiently manage and manipulate data within your workflow.

from keys Usage Tips:

  • Use the DictFromKeys node when you need to quickly initialize a dictionary with a known set of keys, especially when the values are uniform or not yet determined.
  • If you want all keys to have the same initial value, specify the value parameter to set this default value across the dictionary.

from keys Common Errors and Solutions:

Invalid key type

  • Explanation: The keys provided are not valid types for dictionary keys.
  • Solution: Ensure that all keys in the keys list are of a type that can be used as a dictionary key, such as strings, numbers, or tuples.

Missing keys parameter

  • Explanation: The keys parameter is required but was not provided.
  • Solution: Provide a list of keys in the keys parameter to create the dictionary.

Unsupported value type

  • Explanation: The value parameter contains a type that is not supported.
  • Solution: Ensure that the value parameter is of a type that can be used as a dictionary value, such as a string, number, or object.

from keys 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.

from keys