ComfyUI Node

Generic File Loader v1.0 - Akki

Load the latest version of a shot's data file

By routhakash·Created about a year ago·Updated 9 months ago· 8
Generic File Loader v1.0 - Akki
    • text_content
    project_path
    file_subfolderDATA
    shot_name
    filename_prefixGenericOutput
    extension

    The Generic File Loader v1.0 is a small utility that does exactly one thing: given a project path, a subfolder, a shot name, a filename prefix, and an extension, it finds and loads the latest matching text file and returns it as a string. It's the read half of the Generic File Saver's write half, and together they're how the AkkiNodes pipeline passes data between stages without you hand-editing files.

    Why "latest" matters

    The naming convention is the clever bit. Files saved by the Generic File Saver look like GenericOutput_1A_2025-07-24_0003.txt - prefix, shot name, date, zero-padded counter. The loader builds a regex for that pattern, finds every version of the file for that shot, reverse-sorts, and grabs the newest. So you can iterate: re-run a stage, save a new version, and every downstream node automatically picks up the freshest file on the next pass. No stale-data traps, no clearing out old files by hand.

    Inputs and outputs

    Required inputs, all strings:

    • project_path - relative to ComfyUI's output directory (e.g., AKKILLM/Project01).
    • file_subfolder - defaults to DATA.
    • shot_name - e.g., 1A. Gets sanitized for the filename search.
    • filename_prefix - defaults to GenericOutput, matching the saver's default.
    • extension - pick from txt, csv, md, json, log.

    One output: text_content, a STRING you can wire straight into any node that consumes text - prompt fields, the LLM agent nodes, whatever.

    Install and gotchas

    Pack install: ComfyUI Manager search "AkkiNodes LLM Suite", or git clone https://github.com/routhakash/AkkiNodes-LLM-Suite-for-ComfyUI into custom_nodes, run install.bat as admin on Windows, restart.

    Two gotchas worth knowing. First, if nothing matches, the node doesn't raise - it returns an ERROR: Could not load file. Check console. string as text_content. That's deliberate (so the workflow keeps running) but it means a miss silently poisons whatever consumes the text, so watch for ERROR: strings in your outputs. Second, the "latest by reverse sort" trick depends on the filename convention holding up - if you renamed a file by hand or saved one with a different prefix, it won't be found. Keep the naming to the saver and this stays boring and reliable, which is exactly what you want from a file loader.

    CategoryAkkiNodes/FileIO

    Inputs (5)

    NameTypeDefaultDescription
    project_pathSTRING
    file_subfolderSTRINGDATA
    shot_nameSTRING
    filename_prefixSTRINGGenericOutput
    extensionCOMBO5 options: txt, csv, md, json, log

    Outputs (1)

    NameTypeDescription
    text_contentSTRING