ComfyUI Node: compare

Class Name

Basic data handling: DictCompare

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

compare Description

DictCompare node compares two dictionaries to identify unique keys and differing values.

compare:

The DictCompare node is designed to facilitate the comparison of two dictionaries, providing a comprehensive analysis of their differences. This node is particularly useful when you need to determine if two dictionaries are identical, identify keys that are unique to each dictionary, and pinpoint keys that have differing values between the two. By leveraging this node, you can efficiently manage and analyze dictionary data, ensuring that any discrepancies are quickly identified and addressed. This capability is essential for tasks that require data validation, synchronization, or auditing, where understanding the nuances between two sets of data is crucial.

compare Input Parameters:

dict1

dict1 is the first dictionary input for the comparison process. It serves as one of the two data sets that will be analyzed for differences. This parameter does not have a minimum or maximum value, as it can be any dictionary structure. The content of dict1 directly impacts the comparison results, as it is used to identify unique keys and differing values when compared to dict2.

dict2

dict2 is the second dictionary input for the comparison process. Similar to dict1, it is a flexible parameter that can accept any dictionary structure. The comparison between dict1 and dict2 will reveal any keys that are exclusive to dict2, as well as any values that differ from those in dict1. The results of the comparison are contingent upon the contents of dict2.

compare Output Parameters:

are_equal

are_equal is a boolean output that indicates whether the two dictionaries are identical. If True, it means that both dictionaries have the same keys and values. If False, there are differences between the dictionaries, which are detailed in the other output parameters.

only_in_dict1

only_in_dict1 is a list of keys that are present in dict1 but not in dict2. This output helps identify any keys that are unique to the first dictionary, providing insight into what data might be missing or extra in dict2.

only_in_dict2

only_in_dict2 is a list of keys that are present in dict2 but not in dict1. This output highlights keys that are exclusive to the second dictionary, allowing you to understand what additional data dict2 contains compared to dict1.

different_values

different_values is a list of keys that exist in both dictionaries but have different values. This output is crucial for identifying discrepancies in data where the same key is used but the associated values differ, which can be critical for data integrity checks.

compare Usage Tips:

  • Use DictCompare to quickly verify if two datasets are identical, which is particularly useful in data synchronization tasks.
  • Leverage the only_in_dict1 and only_in_dict2 outputs to identify missing or extra data when merging datasets.
  • Utilize the different_values output to pinpoint specific data discrepancies that may require further investigation or correction.

compare Common Errors and Solutions:

TypeError: 'NoneType' object is not iterable

  • Explanation: This error occurs if one of the input parameters is None instead of a dictionary.
  • Solution: Ensure that both dict1 and dict2 are valid dictionaries before passing them to the node.

KeyError: 'key'

  • Explanation: This error might occur if you attempt to access a key that does not exist in one of the dictionaries during manual operations.
  • Solution: Use the different_values output to safely check for keys that exist in both dictionaries before accessing their values.

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

compare