XAV Load JSON File
Load a real JSON file off disk and into your workflow
- json_ref
This is the pack's front door. You have a JSON file - a config, an API response you dumped earlier, a dataset manifest, structured output from an LLM node that you saved to disk - and you want its contents inside the graph so you can navigate it, edit it, or feed bits of it into generation. Give this node a path, and it hands you a json_ref for the whole parsed object.
One input: file_path, a plain string. Type or paste an absolute path, or a path relative to wherever ComfyUI is running. There's no file browser here - it's just text. A sensible convention is to drop your JSON into ComfyUI/input/ (the same directory image loads read from) and reference it there. If the file doesn't exist, you get a clear error: JSON file not found: <path>. If it exists but isn't valid JSON, Python's parser throws and the node fails.
The interesting part is the caching, and it cuts both ways. The first time you load a given path, the node parses the file and stashes the object in a process-wide cache. Every later run in the same session grabs the cached copy instantly instead of touching disk again. That's where the README's "10 MB JSON in microseconds" claim comes from - parse once, reuse forever. It genuinely is fast.
The flip side: "reuse forever" means stale data. Edit the JSON file while ComfyUI is running and the node keeps serving the old parsed copy. There's no reload button and no force-refresh flag on this node. Restart ComfyUI to pick up changes. If you're iterating on a config file that feeds the rest of your graph, budget for that restart, or you'll chase phantom values that stopped existing on disk an hour ago.
Everything downstream is the usual json_ref story, so let's get it straight once: that output is a string handle into an in-memory cache, not the data itself. You can't read it, you can't type it back in (the input is forceInput, meaning it must be wired), and it dies when ComfyUI does - a ref won't survive a restart. So build your whole load → navigate → read → save chain in one workflow rather than expecting a ref to hold across sessions.
What you do with it once loaded: feed it into XAV Navigate JSON to dig into nested structures, read leaves out with XAV JSON to Primitives, or pass pieces to XAV Set JSON Value From Ref to reuse a loaded block inside something you're building. In a metadata-heavy workflow - parsing generation info or sidecar files, or recombining stored outputs - this is the node everything else hangs off.
The failure modes, in the order you'll actually hit them:
- Path typo → the "JSON file not found" error. Most common, easiest fix.
- File edited mid-session → stale data until restart. There's no reload flag.
- Expecting readable JSON out → it's a ref. Convert or save.
Install is genuinely zero-dependency - the pack uses only Python's standard library (json, os, uuid), no pip install, no models. ComfyUI Manager → Install Custom Nodes → search "ComfyUI XAV JSON Nodes", or:
cd ComfyUI/custom_nodes
git clone https://github.com/XAV-Games/ComfyUI-XAVJsonNodes
Restart ComfyUI and the whole pack appears under Add Node → XAV/json. (The README's clone command contains a your-username placeholder - use the real repo URL above.)
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| file_path | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| json_ref | STRING | — |