Nodes/MF-PipoNodes/MF Load Log File
ComfyUI Node

MF Load Log File

Read your batch log back into the graph instead of scrolling the console

By MomentFactory·Created 11 months ago·Updated 7 months ago· 1
MF Load Log File
    • log_content
    log_file_path/tmp/ComfyUI/output
    log_file_namelogfile

    If you've run a long batch of generations, you know the ritual: stare at the ComfyUI console hoping your print() calls don't scroll off, or dig through output/ guessing which file was step 47. MF Load Log File (the node class is MF_LogReader) is the reading half of a two-node logging pair - it reads a text file back into your graph as a string, so the log becomes data you can actually use instead of a wall of terminal text.

    It's a small pack from Pierre Biet (pierreb-mf) at Moment Factory - "MF PipoNodes" in ComfyUI Manager. The whole pack is lightweight: no models, no heavy dependencies, and almost no community footprint yet, which is worth knowing because it means this is a "read the source" sort of pack rather than one with war stories floating around Reddit.

    How it works

    MF_LogReader takes two optional inputs:

    • log_file_path - the directory holding the log (defaults to your ComfyUI output directory).
    • log_file_name - the filename. The default is logfile, and the node silently appends .txt if you don't type it, so the default target is output/logfile.txt.

    On execution it reads the whole file and does two things: it displays the contents in a live widget right on the node, and it returns a single log_content (STRING) output you can wire anywhere - into a text encoder, into an LLM, or into MF Save Data for archiving.

    Two details matter. First, the node returns ⚠️ Log file not found: <path> as the output string if the file is missing - it doesn't crash the workflow, it hands you a warning string that will silently become part of whatever you feed it into. Second, the node uses an IS_CHANGED that always returns NaN, so it re-runs every execution rather than being skipped by ComfyUI's caching. That's exactly what you want from a reader: new entries show up without you having to force the node.

    The wiring

    MF Save Log File ──▶ (output/logfile.txt)
                               │
    MF Load Log File ◀─────────┘
       └─ log_content ──▶ LLM / text encoder / Show Data
    

    The classic move from the pack's README: log every LLM interaction with MF Save Log File, then read the accumulated history back in with MF Load Log File to give the model context on the next turn. It works the same for generation tracking - timestamps plus a seed per entry make a decent audit trail.

    Install

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

    Then restart ComfyUI. Easier: ComfyUI Manager → search "MF PipoNodes" → Install → restart. The only real dependencies are aiohttp and pyyaml, both of which most installs already have.

    Gotchas

    • Reader and writer must agree on the path. Both default to output/logfile.txt, so they match out of the box - but if you customize save_log_path on the writer side and forget the reader, you'll get the "not found" warning string and wonder why nothing changed.
    • Always execute the writer first. The reader can't invent a file. Run the writer once to create it.
    • The output is a string, not a file handle - if you're feeding it to a text encoder, mind the length, since a long log becomes a very long prompt.
    CategoryMF_PipoNodes/Logging

    Inputs (2)

    NameTypeDefaultDescription
    log_file_pathoptSTRING/tmp/ComfyUI/output
    log_file_nameoptSTRINGlogfile

    Outputs (1)

    NameTypeDescription
    log_contentSTRING