ComfyUI > Nodes > Basic data handling > exclude keys

ComfyUI Node: exclude keys

Class Name

Basic data handling: DictExcludeKeys

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

exclude keys Description

Filters out specified keys from a dictionary, aiding in data cleaning and preparation tasks.

exclude keys:

The DictExcludeKeys node is designed to streamline the process of managing dictionary data by allowing you to create a new dictionary that excludes specific keys. This node is particularly useful when you need to filter out unwanted data from a dictionary, ensuring that only the relevant key-value pairs are retained. By providing a list of keys to exclude, the node efficiently processes the input dictionary and returns a modified version without the specified keys. This functionality is essential for data cleaning and preparation tasks, where certain keys may not be needed for further processing or analysis. The node's implementation ensures optimal performance by choosing the most efficient method to exclude keys based on the size of the input dictionary and the list of keys to exclude.

exclude keys Input Parameters:

input_dict

The input_dict parameter is the dictionary from which you want to exclude certain keys. It serves as the primary data source for the node's operation. The dictionary can contain any number of key-value pairs, and the node will process it to remove the specified keys. There are no minimum or maximum size constraints for this dictionary, allowing flexibility in handling various data sizes.

keys_to_exclude

The keys_to_exclude parameter is a list of keys that you want to remove from the input_dict. This list determines which key-value pairs will be excluded from the resulting dictionary. The list can contain any number of keys, including keys that do not exist in the input_dict, in which case they will simply be ignored. There are no restrictions on the content of this list, providing you with the freedom to specify any keys you wish to exclude.

exclude keys Output Parameters:

DICT

The output parameter is a dictionary that contains all the key-value pairs from the input_dict except those with keys specified in the keys_to_exclude list. This resulting dictionary is a refined version of the input, tailored to exclude unwanted data. The output maintains the same type as the input dictionary, ensuring consistency in data handling and further processing.

exclude keys Usage Tips:

  • Use the DictExcludeKeys node when you need to clean up a dictionary by removing unnecessary or irrelevant keys, especially in data preprocessing stages.
  • For optimal performance, ensure that the list of keys to exclude is as precise as possible, avoiding unnecessary entries that do not exist in the input dictionary.

exclude keys Common Errors and Solutions:

Empty input_dict or keys_to_exclude

  • Explanation: If either the input_dict or keys_to_exclude is empty, the node will return the original dictionary without any modifications.
  • Solution: Ensure that both the input_dict and keys_to_exclude contain relevant data before executing the node to achieve the desired filtering effect.

Non-existent keys in keys_to_exclude

  • Explanation: If the keys_to_exclude list contains keys that do not exist in the input_dict, these keys will be ignored, and the node will proceed without errors.
  • Solution: Verify the keys in the keys_to_exclude list to ensure they are present in the input_dict if you expect them to be removed. This will help in understanding the node's behavior and the resulting output.

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

exclude keys