JSON Diff
What actually changed between two JSON blobs
- diff_json
- diff_lines
- summary_json
If you've ever stared at two JSON payloads that are supposed to be identical and wondered where they diverged, you know the feeling this node exists to kill. MKRJSONDiff takes two JSON strings and reports exactly which paths changed - added, removed, modified - plus a human-readable line list. It lives in the pack's network/addon lane, which tells you its intended job: debugging the JSON that flows between the plan nodes, runtime nodes, and host add-ons when a webhook or bridge isn't behaving.
How it works
You give it json_old and json_new (both default {}), and it recursively walks both structures, building a change list with a dotted path for every difference. The recursion handles nested objects and arrays, so a change buried three levels deep shows up as something like settings.machine.nozzle_diameter. Malformed input doesn't crash it - a bad JSON string degrades to an empty object with a warning in the summary.
Inputs
json_old- the "before" payload.json_new- the "after" payload.
That's it. Two text boxes. This is a pure function; no side effects, no network.
Outputs
diff_json- the structured report: a schema tag, achange_count, and achangesarray where each entry carries the change type and the path.diff_lines- the same information as readable text, one change per line, formatted likeADDED settings.machine.nameorREMOVED payload.version. If nothing changed, it saysNO CHANGES. This is the output you'd feed a Show Text node.summary_json- the change count and any parse warnings.
Installing it
Part of the pack:
# ComfyUI Manager: search "MKRShift Nodes", install, restart.
# or:
cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes
# restart ComfyUI
No extra dependencies, no models.
Where it fits in a workflow
The most useful setup is a plan-vs-received comparison. Build a plan with MKRHTTPWebhookPlan, then on the receiving side compare the payload that actually arrived against what you intended - the diff tells you instantly whether the mismatch is in your code or on the wire. Same trick applies to the pack's bridge nodes (Blender, Nuke, TouchDesigner return plans): diff the payload a host add-on sent against what the node produced, and the drift is right there as a list of paths instead of a wall of JSON eyeballing.
The honest take
This is a small, focused utility - don't expect pretty side-by-side UI or semantic diffing. It reports structural changes, and it reports them with dumb honesty: if a key moved location in the object, that reads as remove + add, not "moved." For a debug node that's fine; you mostly want the paths and a count. Where it earns its keep is as the difference-detector between two runs or two endpoints when a workflow silently misbehaves. The diff_lines output is the quick win - one line per change, no parsing required to understand it. And if you're used to diffing JSON with external tools, this is the graph-native version that keeps the comparison inside your workflow and reproducible.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| json_old | STRING | {} | — |
| json_new | STRING | {} | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| diff_json | STRING | — |
| diff_lines | STRING | — |
| summary_json | STRING | — |