Nodes/ComfyUI_MieNodes/Get File Info ๐Ÿ‘
ComfyUI Node

Get File Info ๐Ÿ‘

Size, timestamps and a content hash for one file

By MieMieeeeeยทCreated about a year agoยทUpdated 21 days agoยท 225
Get File Info ๐Ÿ‘
    • file_info
    โ—„file_pathinput/abcโ–บ
    โ—„hash_algorithmsha256โ–บ

    Point this at a single file and it returns a dictionary of facts about it - size, timestamps, and a content hash if you want one. It's the single-file counterpart to the pack's folder-listing node, and where it earns its keep is verification: proving a download finished, confirming two files are byte-for-byte identical, or recording exactly which file a run consumed.

    It's part of ComfyUI-MieNodes (ComfyUI_MieNodes), MieMieeeee's utility pack, under ๐Ÿ‘ Common.

    Why you'd reach for it

    The recurring question in any file-touching workflow is "is this the file I think it is, and is it whole?" A hash answers both. It's a fingerprint computed from the file's bytes: same hash means same content, and a mismatch against an expected value means the file changed or the download truncated. That's how you'd catch a half-finished model pull, or verify a downloaded checkpoint matches the sha256 the model card published.

    The rest of the info - size and timestamps - is the boring-but-useful stuff you'd otherwise pull up in a file explorer. Having it as a node means a workflow can branch on it: skip a step if the file's already there and the right size, log the fingerprint of every input, that kind of thing.

    How it works

    You give it a file_path and pick a hash_algorithm. The node stats the file and, unless you set the algorithm to None, reads it through and computes the digest. The output is a DICT - a structured object, not a flat string - so downstream nodes that understand dictionaries can pull individual fields out of it, and you can also just display the whole thing to read it.

    Note the default here is sha256, not None like its folder-scanning sibling. That's a sensible choice for a single file: you're usually calling this because you want the fingerprint, and hashing one file is cheap. If you genuinely only need size and timestamps, switch it to None to skip the read.

    The inputs and outputs that matter

    Two required inputs:

    • file_path (STRING) - the file to inspect. The default input/abc is a placeholder; give it a real path.
    • hash_algorithm (enum: md5 / sha1 / sha256 / None, default sha256) - pick sha256 for trustworthy verification, md5 for a quick-and-cheap fingerprint, or None to skip hashing.

    Output is file_info (DICT). Feed it to a Show Any node to read the fields, or into a node that consumes dictionaries.

    Installing it

    ComfyUI Manager โ†’ search ComfyUI-MieNodes โ†’ install โ†’ restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MieMieeeee/ComfyUI-MieNodes
    

    then restart. No model download. Nodes appear under ๐Ÿ‘ MieNodes.

    Common issues & troubleshooting

    The output is a DICT, so a plain text node may render it oddly. Use a Show Any-style node that handles arbitrary types; a strict STRING input will complain. If you need one field as a string for downstream string plumbing, extract it rather than wiring the whole dict.

    Hashing a huge model file takes a moment. sha256 over a multi-gigabyte checkpoint reads the entire file. That's normal, not a freeze. Set hash_algorithm to None if you only wanted the size.

    File not found. As with the rest of these utilities, a relative path resolves against wherever ComfyUI launched, which is rarely your workflow folder - use an absolute path. For scanning a whole directory instead of one file, reach for GetDirectoryFilesInfo; for just the filename, GetFileBasename.

    Category๐Ÿ‘ MieNodes/๐Ÿ‘ Common

    Inputs (2)

    NameTypeDefaultDescription
    file_pathSTRINGinput/abcโ€”
    hash_algorithmCOMBOsha2564 options: md5, sha1, sha256, None

    Outputs (1)

    NameTypeDescription
    file_infoDICTโ€”