ComfyUI > Nodes > ComfyUI_MieNodes > Compare Files 🐑

ComfyUI Node: Compare Files 🐑

Class Name

CompareFiles|Mie

Category
🐑 MieNodes/🐑 Common
Author
mie (Account age: 1888days)
Extension
ComfyUI_MieNodes
Latest Updated
2025-04-17
Github Stars
0.05K

How to Install ComfyUI_MieNodes

Install this extension via the ComfyUI Manager by searching for ComfyUI_MieNodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI_MieNodes 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 Files 🐑 Description

Facilitates file comparison, identifies/report differences, supports JSON/TOML, deep comparison method, human-readable results.

Compare Files 🐑| Compare Files 🐑:

The CompareFiles| Compare Files 🐑 node is designed to facilitate the comparison of two files, specifically focusing on identifying and reporting differences between them. This node is particularly useful for users who need to ensure consistency or track changes between two versions of a file. It supports files in JSON and TOML formats, making it versatile for various data structures. By leveraging this node, you can easily pinpoint discrepancies, which is crucial for tasks such as version control, data validation, and ensuring data integrity. The node processes the files by loading their contents, converting any sets to lists for uniformity, and then utilizing a deep comparison method to detect differences. The results are formatted into a human-readable string that highlights the variations, providing a clear and concise summary of the differences between the two files.

Compare Files 🐑| Compare Files 🐑 Input Parameters:

file1_path

This parameter specifies the path to the first file that you want to compare. It is a string input, and the default value is set to "X://path/to/file1". The file should be in either JSON or TOML format, as these are the supported formats for comparison. The accuracy of the comparison heavily relies on the correct specification of this path, as it determines the first dataset to be analyzed.

file2_path

This parameter indicates the path to the second file for comparison. Similar to file1_path, it is a string input with a default value of "X://path/to/file2". The file must also be in JSON or TOML format. This parameter is crucial as it provides the second dataset against which the first file is compared, allowing the node to identify any differences.

file_format

This parameter defines the format of the files being compared, with options being "json" or "toml". It is essential to specify the correct format to ensure the node can accurately parse and compare the files. The choice of format affects how the data is read and processed, and incorrect specification can lead to errors in comparison.

Compare Files 🐑| Compare Files 🐑 Output Parameters:

STRING

The output of this node is a string that describes the differences between the two files. This output is generated after the node performs a deep comparison of the file contents, highlighting any discrepancies in a clear and structured manner. The output is valuable for understanding the specific changes or differences between the files, aiding in tasks such as debugging, data validation, and version control.

Compare Files 🐑| Compare Files 🐑 Usage Tips:

  • Ensure that both files are in the same format (either JSON or TOML) before attempting to compare them, as this is crucial for accurate results.
  • Use absolute paths for file1_path and file2_path to avoid any issues related to file location and ensure the node can access the files without errors.
  • Regularly update the file paths and formats in the node settings to match the files you are working with, especially if you frequently switch between different datasets.

Compare Files 🐑| Compare Files 🐑 Common Errors and Solutions:

Unsupported format. Please choose 'json' or 'toml'.

  • Explanation: This error occurs when the specified file_format is not recognized by the node. The node only supports JSON and TOML formats for comparison.
  • Solution: Verify that the file_format parameter is set to either "json" or "toml". Ensure that both files are in the specified format.

Failed to compare files: <error_message>

  • Explanation: This error indicates that an exception occurred during the file comparison process, possibly due to issues with file paths, formats, or content.
  • Solution: Check that the file paths are correct and that the files exist at the specified locations. Ensure that the files are properly formatted and contain valid JSON or TOML data. If the issue persists, review the error message for more specific details on the problem.

Compare Files 🐑 Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI_MieNodes
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 Playground, enabling artists to harness the latest AI tools to create incredible art.