ComfyUI Node

Save Json

Write a JSON value to disk, no path, no fuss

By zcfrank1st·Created 3 years ago·Updated 2 years ago· 7
Save Json
  • json_content
    filenametoolbox

    SaveJson does exactly what it says: give it a JSON value and a filename, and it writes that value out to disk when the prompt runs. It's the persistence half of this pack's two-node core - where PreviewJson lets you look at a value once and forget it, SaveJson is for the value you want to keep around after the run finishes: a config you generated, metadata you extracted, the shape of an API response you want to inspect later without re-running the workflow.

    It's a genuinely small node, and that's the point. If you've gone looking for a JSON output node and landed on something with twenty options - output directories, pretty-print toggles, overwrite policies - SaveJson is the opposite of that. Two fields, nothing else.

    How it works

    There are two required inputs: filename, a plain string that defaults to "toolbox", and json_content, typed JSON. On execution, it takes whatever's wired into json_content and writes it to a file named after filename. It has no outputs and is flagged as an output node - same as PreviewJson, it's a terminal step you put at the end of a branch, not something you chain further work off of.

    Worth knowing going in: the README doesn't spell out the exact write location, or what happens on a second run with the same filename - whether it overwrites cleanly or appends a counter. Neither does the node's schema; there's no output_dir field to redirect it, so you don't get to choose the folder from the graph. The pragmatic move is to run it once, then go check your ComfyUI output folder to see where the file actually landed before you build a workflow that depends on the exact path.

    As with PreviewJson, the input wants the JSON type specifically - not a plain string that merely looks like JSON. If your JSON is coming from a node that only outputs STRING (which covers a lot of the text-based JSON tools out there), it won't wire directly into json_content. This pack's own TestJsonPreview node takes anything and hands back a properly-typed JSON output, which is the easiest fix if you hit that wall.

    The inputs and outputs that matter

    • filename (required, string, default "toolbox") - the name for the saved file. Change this from the default, or every run without a custom name risks writing over the last one.
    • json_content (required, type JSON) - the value to save. Needs to come from a node that outputs JSON, not STRING.

    No outputs - this is a sink, not a pass-through. Put it at the end of whatever chain produces the data you want to keep.

    How to install it

    Search Comfyui-Toolbox in ComfyUI Manager, or install manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/zcfrank1st/Comfyui-Toolbox.git
    

    Restart ComfyUI. No requirements.txt, no models to fetch - the whole pack is lightweight enough that this is the entire install.

    Common issues & troubleshooting

    Can't connect json_content. Same type story as PreviewJson: the socket is JSON, not STRING. A node that outputs a JSON-formatted string won't plug in directly - bridge it through TestJsonPreview first, or use a source that natively emits JSON.

    Files keep overwriting each other. The default filename is the literal string "toolbox". If you never touch that field, every save with the default name is competing for the same file (or something close to it, depending on how the pack handles collisions, which isn't documented). Give it a distinct name per workflow, or per run if you need history.

    Can't find the saved file. There's no path input on this node, so you can't point it at a custom directory from the graph. Check your standard ComfyUI output location first - that's the most likely place a save-type node like this writes to by default.

    Node missing after install. Confirm the repo cloned straight into ComfyUI/custom_nodes/Comfyui-Toolbox and that you did a full restart, not just a page refresh - ComfyUI only scans for new custom node folders on startup.

    Categorytoolbox

    Inputs (2)

    NameTypeDefaultDescription
    filenameSTRINGtoolbox
    json_contentJSON

    Outputs (0)

    No outputs