Nodes/Anymatix/Anymatix Save Json
ComfyUI Node

Anymatix Save Json

Dump anything — tensors included — to a JSON file so something downstream can read it

By Anymatix·Created about a year ago·Updated 2 days ago· 0
Anymatix Save Json
  • json
    output_pathanymatix/results
    filename_prefixdata
    save_json

    ComfyUI is full of data that isn't an image: prompt metadata, seed values, object detections, coordinates, counts. Most of the time it lives in a graph and dies when the graph does. AnymatixSaveJson is the node that writes that kind of thing to disk as a clean, indented JSON file - and unlike most JSON savers, it'll take nearly anything as input and figure out how to serialise it.

    That last point is the node's real trick. The input slot is typed *, meaning any data type can be wired in. The serialiser then walks whatever it receives with a sensible set of rules: primitives pass through, dicts get stringified keys, lists and tuples recurse, and - the part you actually care about - tensors get flattened. Anything with .tolist() becomes a Python list, anything with .item() gets unwrapped to a scalar, and anything that can move to CPU and become a numpy array gets converted. So you can wire a tensor of frame counts or a list of detection boxes straight in and get a readable JSON file out, no manual conversion node in between. If it meets something it genuinely can't serialise, it raises rather than silently writing garbage - a deliberate "loud over wrong" choice.

    Inputs

    • json (*) - whatever you want saved. Number, string, dict, list, tensor - all fine.
    • output_path (default anymatix/results) - subdirectory under ComfyUI's output folder.
    • filename_prefix (default data) - base name; the file is always <prefix>.json.
    • save_json (true/false, default true) - the toggle that's supposed to gate saving. Honest note: in the current build the save function accepts it but doesn't actually consult it - the file is written either way. Don't rely on it as a switch.

    No outputs; it's an output node. If you want to check what happened, the log line "Data saved to: <path>" is your confirmation.

    Install

    Part of the anymatix-comfy-nodes pack, under the "Anymatix" category. ComfyUI Manager: search "anymatix-comfy-nodes", install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Anymatix/anymatix-comfy-nodes
    

    No special dependencies for this node beyond what the pack already declares.

    Why you'd bother

    Outside the Anymatix app (which reads these files back as results), the honest use case is debugging and hand-off. Saving a prompt, seed, and parameter set alongside each generated image is the classic one - it's how you reconstruct exactly what made a frame you like. The counterintuitive direction is also useful: save coordinates or metadata to JSON, read it with a tiny script, and let non-ComfyUI tooling take over. Where people get burned: forgetting the output lands in output/anymatix/results by default, and that folder is swept by the pack's cache GC (24h TTL for results unless you change ANYMATIX_CACHE_TTL_RESULTS). If the JSON matters later, write it to your own output path or copy it out promptly.

    CategoryAnymatix

    Inputs (4)

    NameTypeDefaultDescription
    json*
    output_pathSTRINGanymatix/results
    filename_prefixSTRINGdata
    save_jsonCOMBO2 options: true, false

    Outputs (0)

    No outputs