ComfyUI Node

JSON

Save a machine-readable receipt of every generation

By Conor-Collins·Created 2 years ago·Updated about a year ago· 33
JSON
    • json_file_path
    positive_prompt
    negative_prompt
    id_number
    seed
    output_path

    Every ComfyUI image already bakes a JSON copy of its own workflow into the PNG metadata. So why does this node exist? Because that metadata lives in the image, and it's a pain to query when you've rendered a few hundred variants. JSON (class JSONNode) takes the handful of settings that actually define a generation - positive prompt, negative prompt, an id, and the seed - and writes them out to a standalone JSON file at a path you choose. That file is your machine-readable receipt: a record of what produced each image, sitting on disk where a script, a batch, or a future workflow can reach it.

    It's one of the pack's "JSON-based scaling tools for file/path management," which is exactly the right way to think about it. This isn't a creative node. It's bookkeeping for pipeline work - the kind of node you add when you stop clicking Generate for fun and start running batches for a living.

    How it works

    Wire in the four fields you care about and give it a destination:

    • positive_prompt, negative_prompt - the two prompt strings, straight from your conditioning or from any prompt text node
    • id_number - a string identifier for this record (the author left it as a string, so use something like "batch_003" or the image name)
    • seed - the seed you actually generated with
    • output_path - where the JSON file gets written, as a plain full path

    The node writes a JSON file containing those values and hands you json_file_path on the output side. That output is what makes this a proper ComfyUI citizen: you can wire it into a display node, log it, or feed it straight into another node that takes a file path.

    Where it fits

    The obvious pairing is with the pack's own JSON Reader, which reads a JSON this node wrote and returns the seed and both prompts. That round-trip is the killer app: generate a batch with a log of every seed and prompt, then later rebuild any single image by feeding the saved seed back into a KSampler. If you're already using Walk Folder to iterate a folder of images, writing a JSON receipt per image alongside it keeps your output folder self-documenting.

    Installing it

    The pack is deprecated - the README says so at the top, and the author has moved the EXR/image side to ComfyUI-CoCoTools_IO. As of August 2026 the original repo URL returns 404 on GitHub, so expect no updates and no fixes. If ComfyUI Manager still resolves it (search ComfyUI-CoCoTools), let Manager do the install. Otherwise, from your custom_nodes folder:

    git clone https://github.com/Conor-Collins/coco_tools
    

    Then install the pack's requirements. On the Windows portable build the README's own recipe runs from the python_embeded/ folder:

    python.exe -m pip install -r ./ComfyUI/custom_nodes/ComfyUI-CoCoTools/requirements.txt
    

    Then restart ComfyUI. The requirements pull in the usual numpy/OpenCV/Pillow stack plus OpenImageIO, which is heavy but fine for this node.

    Gotchas

    • Make sure output_path points at a directory that already exists. A file-writing node can't create the folder for you; a typo in the path silently produces nothing useful.
    • This writes a specific schema, not a general-purpose JSON tool. Keep the reader and writer paired or you'll be hand-editing files.
    • Because it's deprecated, treat the saved JSONs as the durable artifact, not the node. The files are plain JSON - anything can read them long after the pack is gone.
    CategoryCOCO Tools/JSON Tools

    Inputs (5)

    NameTypeDefaultDescription
    positive_promptSTRING
    negative_promptSTRING
    id_numberSTRING
    seedINT
    output_pathSTRING

    Outputs (1)

    NameTypeDescription
    json_file_pathSTRING