Compare Files ๐
Diff two JSON or TOML files inside your workflow
- STRING
A small, sharp utility: give it two files and it tells you what's different between them. It's scoped to structured formats - JSON and TOML - so it compares them as data structures, not as raw text, which means it surfaces the actual key/value differences rather than drowning you in whitespace noise. If you juggle config files or serialized settings in a ComfyUI pipeline, this is the "what changed?" button.
Part of ComfyUI-MieNodes (ComfyUI_MieNodes), MieMieeeee's utility pack, in the Common group.
Why you'd use it
Most people won't need this every day, and that's fine - it's a specialist. Where it earns its keep is anywhere you keep structured config or metadata on disk and want to know how two versions differ. Compare a training config against a known-good baseline. Check whether an export actually changed. Verify that two runs produced the same settings blob. It pairs naturally with the pack's SaveAnythingAsFile node: save a JSON/TOML state at two points, then diff them here.
Because it parses the files as JSON or TOML before comparing, it's comparing meaning, not formatting. Reorder keys or reindent a file and a plain text diff screams; a structural diff stays quiet and only reports the values that genuinely moved. That's the right behavior for config work, and it's the kind of file-wrangling the KB's LoRA-training doc reminds us is a real part of the job - a lot of training and dataset work is managing text and config artifacts around the model.
The inputs and outputs that matter
All required:
file1_path- path to the first file. The defaultX://path/to/file1is a placeholder; use a real path.file2_path- path to the second file. Same deal.file_format-jsonortoml. This tells the node how to parse both files, so it has to match what they actually are.
It's an output node, and it has a single STRING output carrying the differences as text. Wire that into a show node to read the diff, or into SaveAnythingAsFile to log it.
Installing it
ComfyUI Manager โ search ComfyUI-MieNodes โ install โ restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/MieMieeeee/ComfyUI-MieNodes
then restart. No model download - it's a filesystem tool. Nodes appear under the ๐ MieNodes menu.
Common issues
Format has to match the files. Set file_format to what the files really are. Point it at a .toml while it's set to json and the parse fails - the node can't diff what it can't read.
It's json/toml only. There's no txt option here. This isn't a general text diff; it's a structured-data diff. For plain text you'd compare some other way. If you want to diff arbitrary text, that's outside this node's scope.
Local disk, real paths. Like the pack's other file nodes, it reads from the ComfyUI machine's filesystem, so it's built for a local install with your files on disk. On serverless/cloud ComfyUI there may be no persistent files to compare, and the placeholder paths obviously won't resolve - swap in real ones.
Malformed files. If either file has a syntax error (a broken JSON brace, bad TOML), the parse will fail before any comparison happens. Make sure both files are valid first.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| file1_path | STRING | X://path/to/file1 | โ |
| file2_path | STRING | X://path/to/file2 | โ |
| file_format | COMBO | 2 options: json, toml |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | โ |