Nodes/ComfyUI-ArchiGraph/JSON Save πŸ¦β€πŸ”₯
ComfyUI Node

JSON Save πŸ¦β€πŸ”₯

Persist your graph's data between runs

By vincentfsΒ·Created 2 years agoΒ·Updated 9 months agoΒ· 3
JSON Save πŸ¦β€πŸ”₯
  • input
  • file_path
β—„filename_noExtunknownβ–Ί

ComfyUI forgets everything the moment the queue empties. If you want a batch of results - detected points, generated filenames, per-item measurements - to survive into your next session, you need to write them somewhere. That's this node's entire job: take any dictionary, list, or tuple flowing through your graph and dump it as a pretty-printed .json file that the pack's JSON Load node can bring back later.

The inputs

  • input (*): whatever you want persisted. Dict, list, tuple - all work. The node's description has a genuinely useful detail: nparrays and tensors get converted to lists automatically, so you can save detection results (which often live in numpy arrays) without manual conversion. If you hand it something that isn't JSON-serializable and isn't an array/tensor, it raises a TypeError rather than guessing.
  • filename_noExt (default "unknown"): the name, minus extension - .json is appended for you. The default unknown is a trap: save two things without renaming and the second silently overwrites the first. Name your outputs.

How it works

It writes to a dedicated folder, ComfyUI/output/jsons, with 4-space indent so the file is actually readable when you open it to debug. The output is file_path - a STRING with the absolute path - which is the useful bit: wire that into a print node or a log, and you know exactly where your data landed without hunting.

It's an output node (marked as such), so it terminates a branch of your graph, which is exactly right - its job is "dump and be done."

The workflow

The pattern this enables: run a detection batch β†’ collect the results (points, counts, filenames) β†’ JSON Save. Tomorrow, JSON Load reads the same structure back and you iterate on it without re-running the expensive detection. It's the pack's answer to "why did I lose that data when I closed ComfyUI?"

Install

ComfyUI Manager β†’ search ComfyUI-ArchiGraph, or:

cd ComfyUI/custom_nodes
git clone https://github.com/vincentfs/ComfyUI-ArchiGraph

Restart and run the pack's install script once. Pure Python json - no OpenCV, no models.

Gotchas

  • Files go to output/jsons, not your input folder. Look there first when something "didn't save."
  • The unknown default filename means overwriting is the default behavior until you set a name.
  • Nested arrays and tensors convert to lists, but a tensor inside a dict converts too - just don't expect to get your tensor back; JSON Load returns plain lists.

A simple, honest persistence node. The counterpart to JSON Load, and together they're the only durable data story this pack offers - which is all most workflows need.

CategoryπŸ¦β€πŸ”₯ ArchiGraph/πŸ› οΈ Utils

Inputs (2)

NameTypeDefaultDescription
input*Input dictionary/list/tuple to save as JSON.
filename_noExtSTRINGunknownFilename without extension (extension .json will be added automatically).

Outputs (1)

NameTypeDescription
file_pathSTRINGβ€”