Nodes/MF-PipoNodes/MF Load Data (json/csv/xml/yaml)
ComfyUI Node

MF Load Data (json/csv/xml/yaml)

Load a JSON, CSV, XML or YAML file into your workflow as a string

By MomentFactory·Created 11 months ago·Updated 7 months ago· 1
MF Load Data (json/csv/xml/yaml)
    • data
    file_pathoutput
    filenamedata.json

    ComfyUI treats almost everything as a string, and disk is full of files that want to be strings inside your workflow. MF Load Data (json/csv/xml/yaml) (MF_ReadData) is the "open this file and hand me its contents" node from the MF PipoNodes pack (pierreb-mf / Moment Factory) - it reads a file, auto-detects the format from the extension, and outputs the contents as a formatted STRING. The killer use case: load a config or state file from a previous run and resume right where you left off.

    How it works

    Two required inputs:

    • file_path - the directory, default "output". Relative to where ComfyUI runs (usually the ComfyUI root), so the default resolves to ComfyUI/output.
    • filename - the full filename with extension, default "data.json".

    One output: data (STRING).

    Format detection is purely by extension, and each format gets cleaned up before it reaches you:

    | Extension | What you get | |---|---| | .json | Parsed and re-dumped with 2-space indentation (readable, sorted keys preserved) | | .xml | Parsed, indented XML as a string | | .csv | Converted to a JSON array (list of objects if headers exist) | | .yaml / .yml | Parsed via PyYAML and output as JSON | | anything else | Raw text, untouched |

    So a .csv doesn't come back as CSV - it comes back as JSON. That's a deliberate choice so the output drops into other string-processing nodes without CSV-parsing headaches, but if you expected a pipe-delimited dump, it'll surprise you.

    Where it earns its keep

    The best pattern is pairing it with MF Save Data from the same pack - the writer serializes your settings or LLM output, and this node reads it back on the next run:

    MF Save Data (settings.yaml) ──▶ output/settings.yaml
    MF Read Data (output, settings.yaml) ──▶ data ──▶ your workflow
    

    That's the "resume from checkpoint" flow: persist state at the end of a run, reload it at the start of the next. It's also the obvious way to feed an LLM a saved conversation or to load a prompt list you keep as a text file.

    Install

    cd ComfyUI/custom_nodes/
    git clone https://github.com/pierreb-mf/ComfyUI-MF-PipoNodes
    cd ComfyUI-MF-PipoNodes
    pip install -r requirements.txt
    

    Restart after (or ComfyUI Manager → "MF PipoNodes"). YAML support needs pyyaml, which is in the pack's requirements, so installs get it automatically.

    Gotchas

    • Missing file = a warning string, not an error. Like most of this pack, MF_ReadData returns "File not found: <path>" as the data output rather than failing. That string can silently end up as a prompt or config if you don't check it.
    • Directory and filename are separate inputs. file_path is the folder, filename is the file. MF Save Data returns a full filepath - you'll need to split it into these two fields, or keep both nodes on the same defaults.
    • YAML reads require pyyaml. If it's missing, the node raises instead of degrading - the pack prints a warning at startup when PyYAML isn't importable.
    CategoryMF_PipoNodes/Data

    Inputs (2)

    NameTypeDefaultDescription
    file_pathSTRINGoutput
    filenameSTRINGdata.json

    Outputs (1)

    NameTypeDescription
    dataSTRING