Nodes/ComfyUI-CoCoTools/JSON Value Finder
ComfyUI Node

JSON Value Finder

Pull one value out of a metadata JSON, nothing else

By Conor-Collins·Created 2 years ago·Updated about a year ago· 33
JSON Value Finder
    • value
    json_directory
    key_to_find

    Sometimes you don't want the whole story - you just want one number. JSON Value Finder (class JSONValueFinderNode) is the lean sibling of the pack's JSON tools: give it a directory and a key name, and it returns the value for that key as a string. No schema ceremony, no fixed field list, just "find this key, give me what it's worth."

    That's genuinely useful when your JSON receipts are getting pulled into workflows that only care about a single field. Say the saved metadata for a batch includes a config value, a model name, or a per-image seed tucked inside a larger record. The pack's JSON Reader is hard-wired to three specific fields (seed, positive, negative) - useful, but inflexible. This node is the "grab whatever I ask for" escape hatch.

    How it works

    Two inputs, both plain strings:

    • json_directory - the directory where the JSON file lives
    • key_to_find - the key whose value you want, e.g. seed or positive_prompt

    The output is value (STRING): whatever was stored under that key. One node, one key, one value. That's the entire design.

    Where it fits

    It slots into the same receipt-and-log workflows as the pack's JSON writer and reader, but for targeted lookups rather than full reconstruction. If you're walking a folder of outputs and just need to pull the seed or a config flag out of each saved JSON before processing further, this is the lightest way to do it - no need to drag three outputs around when you only wanted one.

    An honest caveat: the value always comes out as a string, even if the JSON stored a number. That's fine for display and file naming, but if you're feeding it into a numeric input you'll need a string-to-number conversion node in between.

    Installing it

    This node ships in ComfyUI-CoCoTools, which is deprecated. The README marks it unmaintained and redirects to ComfyUI-CoCoTools_IO; the original repo URL has been 404ing on GitHub since at least August 2026, and the successor doesn't include these JSON tools. Install via ComfyUI Manager (search ComfyUI-CoCoTools) if it still resolves, or manually:

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

    Then install the pack requirements - from the python_embeded/ folder on the Windows portable build:

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

    Restart ComfyUI afterward.

    Gotchas

    • One key at a time. Want two fields? You need two instances of the node. That's the trade-off for its simplicity.
    • A key that doesn't exist in the file comes back as an empty string, which is easy to mistake for a legitimate empty value. Check your JSON if you're getting blanks.
    • It's unmaintained software. If you're leaning on this for a serious pipeline, the honest advice is that any small script or a maintained utility pack can do this one job forever - this node is the convenient-but-abandoned version.
    CategoryCOCO Tools/JSON Tools

    Inputs (2)

    NameTypeDefaultDescription
    json_directorySTRING
    key_to_findSTRING

    Outputs (1)

    NameTypeDescription
    valueSTRING