Visit ComfyUI Online for ready-to-use ComfyUI environment
Retrieve values from dictionary using specified key for data extraction and manipulation in AI workflows.
The Text Dictionary Get node is designed to retrieve the value associated with a specified key from a given dictionary. This node is particularly useful when you need to extract specific information from a dictionary structure, which is a common data format in various applications. By providing a key, the node will return the corresponding value, or a default value if the key is not found. This functionality is essential for tasks that involve dynamic data retrieval and manipulation, making it a valuable tool for AI artists who work with complex data sets and need to streamline their workflows.
The dictionary
parameter is the main input for this node, where you provide the dictionary from which you want to retrieve a value. This parameter accepts a dictionary data type (DICT). The dictionary should contain key-value pairs, where the keys are strings, and the values can be of any data type. This parameter is required for the node to function.
The key
parameter specifies the key whose value you want to retrieve from the dictionary. This parameter accepts a string (STRING) and is required. The key should match one of the keys in the provided dictionary. If the key is not found in the dictionary, the node will return the value specified in the default_value
parameter.
The default_value
parameter is an optional input that specifies the value to return if the specified key is not found in the dictionary. This parameter accepts a string (STRING) and has a default value of an empty string (""). This allows you to handle cases where the key might not exist in the dictionary gracefully.
The output parameter of this node is of type TEXT_TYPE. It returns the value associated with the specified key in the dictionary as a string. If the key is not found, it returns the default_value
provided. This output can be used in subsequent nodes for further processing or display.
default_value
parameter to handle cases where the key might not exist, ensuring your workflow does not break.default_value
to handle missing keys.© Copyright 2024 RunComfy. All Rights Reserved.