Nodes/ComfyUI-Data-Analysis/Pandas Load JSON
ComfyUI Node

Pandas Load JSON

The on-ramp for tabular data in ComfyUI

By HowToSD·Created 2 years ago·Updated about a year ago· 23
Pandas Load JSON
    • DATAFRAME
    file_path

    ComfyUI is a node graph for image generation, but nothing stops you from running a whole data-analysis pipeline in the same canvas. This node is how your data gets in. Feed it a path to a JSON file and it comes out the other side as a DATAFRAME - the custom socket type this pack uses to move pandas DataFrames between nodes. It's the equivalent of Pandas Load CSV, just for JSON.

    The pack around it, ComfyUI-Data-Analysis by Hide Inada (HowToSD), wraps Pandas, Seaborn, and Matplotlib into dozens of nodes. He built it because ComfyUI's node system is genuinely good at structured workflows - he literally wrote a tutorial answering "which MLB player had the most hits per year" with it. JSON loading is the boring-but-essential first step of that.

    How it works

    The mechanism is a one-liner: pd.read_json(file_path). But there's a detail most people miss - the node defines IS_CHANGED to always return NaN, which tells ComfyUI to re-execute it on every run. That means no caching: edit the file, hit run, and the new data flows straight through. Handy when you're iterating on a dataset.

    The inputs that matter

    • file_path - a plain single-line string. This is the only input. Relative paths resolve against your ComfyUI installation directory, not the workflow's folder, so an absolute path is the safer bet.

    The single output is DATAFRAME, which plugs into any other Pandas node in the pack - PandasHead, PandasMax, PandasGroupBy, a Seaborn plot, wherever your pipeline goes next.

    One honest caveat: read_json isn't magic about shape. It parses JSON that looks like records (an array of objects, where keys become columns) cleanly. Deeply nested JSON, or a top-level object with mixed structure, will either flatten into something weird or throw. If your file doesn't parse, that's a data-format problem, not a broken install.

    How to install it

    It ships in the whole pack, so install that once:

    cd ComfyUI/custom_nodes
    git clone https://github.com/HowToSD/ComfyUI-Data-Analysis.git
    mv ComfyUI-Data-Analysis data-analysis   # the README insists on this folder name
    pip install -r requirements.txt
    

    Restart ComfyUI and reload the browser tab. ComfyUI Manager also has it - search "Data analysis" in the Custom Node Manager. Either way, expect pandas, matplotlib, seaborn, scipy, scikit-learn, openpyxl, and lxml to land in your Python environment; none of those ship with a stock ComfyUI. No GPU required, and no model downloads - this is pure CPU data wrangling.

    Common issues

    • "File not found" - you gave a relative path and the file isn't under the ComfyUI install directory. Use an absolute path.
    • Weird columns or a parse error - your JSON isn't in a records shape pandas likes. Restructure it (an array of objects is the safe form) or consider Pandas Load CSV.
    • Old example workflows breaking - that's the folder-rename gotcha above; example workflows reference the data-analysis folder name, so rename the clone or they can't find their assets.

    Worth knowing: as of March 2025 the pack's PyTorch nodes moved to a separate extension (ComfyUI-Pt-Wrapper). You don't need that for this node - plain pandas only.

    CategoryData Analysis

    Inputs (1)

    NameTypeDefaultDescription
    file_pathSTRING

    Outputs (1)

    NameTypeDescription
    DATAFRAMEDATAFRAME