Nodes/ComfyUi-MpiNodes/Mpi Json Save
ComfyUI Node

Mpi Json Save

Write a dictionary to disk at a path you choose

By MadPonyInteractive·Created 11 months ago·Updated 5 days ago· 3
Mpi Json Save
  • json
  • path
path

Mpi Json Save is the write-side partner to Mpi Json Load: it takes a dictionary and writes it to a JSON file at a full path of your choosing. If you're building a workflow that persists settings, caches prompt presets, or hands data to another tool, this is how the graph writes structured data back out to disk. And it hands the path back to you as a path output so you can pass it along - the pack's habit of echoing values so a host app can chain them.

Two required inputs: json (type JSON, force-input, so it has to come from a wire - you can't type a dict into a widget) and path, a full file path like /home/you/workflows/config.json. The tooltip on path is the whole spec: "Full path to json file to save." There's no filename dropdown and no default, so you're responsible for the complete destination.

Under the hood it's json.dump(data, f, indent=4) wrapped in a try/except - nicely formatted output, and a failure just prints [MpiNodes] Error saving JSON to <path> to the console rather than killing the run. That error handling is friendly but it's also the trap: if the parent directory doesn't exist, the write silently fails. The code opens the file with plain open(path, "w"); it does not create folders for you. So make sure the directory is already there before you point this at a fresh subfolder, and get into the habit of checking the console for that error line when a "saved" file doesn't show up. If you're feeding this from an upstream MpiJsonLoad, a round trip through the pack is exactly as easy as it sounds: load, transform, save, all by path, all outside the sandboxed input/ folder.

Where this node shines is the automation story. It doesn't care about ComfyUI's output conventions - you can write anywhere the engine has permission, which is exactly the freedom a desktop host app (this pack is the engine under Mad Pony Interactive's Cubric Vision) needs to stage files for the next run. In a plain manual workflow, it's still the cleanest way to snapshot a run's parameters: gather your numbers, pack them into a dict with the pack's packer, and save them off for later comparison.

Installing: ComfyUI Manager → search "ComfyUi-MpiNodes" → install → restart, or

cd ComfyUI/custom_nodes
git clone https://github.com/MadPonyInteractive/ComfyUi-MpiNodes

No pip requirements, no models. Pure Python from the Mad Pony Interactive utility pack. If you remember one thing beyond "make the folder first," it's that the path output lets you hand the written location straight to the next node - the file you just made is the file you then reference, with zero guesswork about where it landed.

CategoryMpiNodes/JSON

Inputs (2)

NameTypeDefaultDescription
jsonJSONDictionary to save to JSON file
pathSTRINGFull path to json file to save

Outputs (1)

NameTypeDescription
pathSTRING