Nodes/ComfyCollectorNodes/Load JSON File Path (CCN)
ComfyUI Node

Load JSON File Path (CCN)

Load JSON File Path (CCN)

By valkymaera·Created 4 months ago·Updated 10 days ago· 1
Load JSON File Path (CCN)
    • json_string
    • filename
    file_path

    Load JSON File Path (CCN) is the unrestricted sibling of Load JSON File (CCN). Where that node makes you pick from JSON files sitting inside ComfyUI's input folder, this one takes a raw filesystem path and reads whatever JSON you point it at - anywhere on disk. Same outputs, same validation, different access control. If you're pulling configuration or template JSON from a project folder, a shared network drive, or just somewhere outside the ComfyUI sandbox, this is the one you want.

    It exists because the dropdown-only approach has a hard ceiling: it can only see files under the input directory. The moment your JSON lives in D:\projects\render_configs\scene.json or /srv/data/workflows/template.json, a dropdown is useless. This node's single required input, file_path, is a plain STRING - type or wire the absolute path and it reads the file, verifies it parses as JSON, and returns it.

    The mechanism is dead simple under the hood: strip whitespace, check the path exists, read the file as UTF-8, validate with json.loads, return. The validation is worth emphasizing because it's the difference between a useful utility and a foot-gun - if the file isn't valid JSON, the node refuses to hand you garbage, prints the parse error to the console, and returns an empty string (with the filename) so your workflow degrades visibly rather than silently feeding a broken blob into a sampler or a metadata embedder.

    It also carries the same IS_CHANGED behavior as its sibling: keyed on file modification time, so editing the JSON on disk invalidates the cache and the node re-reads it on the next run. No manual "refresh" step. That's the property that makes it pleasant to iterate against while you're still editing the config.

    Outputs:

    • json_string - the file contents as a string. Feed this into anything that accepts STRING, or a JSON-parsing node if you need structured data.
    • filename - just the basename of the file (not the full path), for display or tracking.

    Install

    This is part of ComfyCollectorNodes, installable through ComfyUI Manager (search "ComfyCollectorNodes") or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/valkymaera/ComfyCollectorNodes
    

    Restart ComfyUI and it appears under ComfyCollectorNodes → Utils as "Load JSON File Path (CCN)". No extra dependencies, no model downloads - the pack is pure Python plus what ComfyUI already ships, MIT-licensed.

    Common issues

    Most problems here are path problems, and they're all predictable. Absolute paths only - if you type a relative path it'll be resolved against wherever ComfyUI happens to be running, not against your workflow folder. Backslashes on Windows can get mangled if the path passes through string handling; forward slashes work fine there too. And the classic one: the path must exist when the node runs, or it returns empty strings and logs "File not found" to the console - easy to miss when you're debugging and the node quietly hands you nothing. Also note this node takes a static string widget, not a folder-picker. If you want a graphical file browser, that's a different pack's feature; here you get predictability over convenience, and honestly for a JSON loader that's the right trade.

    CategoryComfyCollectorNodes/Utils

    Inputs (1)

    NameTypeDefaultDescription
    file_pathSTRING

    Outputs (2)

    NameTypeDescription
    json_stringSTRING
    filenameSTRING