Nodes/Mememage/Mememage Find Record
ComfyUI Node

Mememage Find Record

Find a record by identifier even when the filename is garbage

By sememtac·Created 3 months ago·Updated 2 months ago· 1
Mememage Find Record
    • record
    • identifier
    • found
    identifier
    folder
    subfolder

    Mememage Find Record is the local resolver: given an identifier, it finds the record on disk whose identifier field matches - by content, not by filename. That last bit is the whole point, because Mememage Save Record lets you name files anything you like (the bar links image to record, not the name). A record saved as dawn_soul.json might hold the identifier mememage-1a2b3c4d5e6f7a8b, and Find Record will still find it.

    How it finds things

    It searches in two passes, and the ordering is what makes it fast and correct:

    1. Fast path. It tries the obvious name first: <root>/<identifier>.json - and only returns it if the file's content identifier actually matches. That's the common case (Save Record's default name), so it's one stat and done.
    2. Content scan. If the fast path misses, it globs every *.json in the folder, parses each, and returns the one whose identifier field matches. Newest wins on ties. Corrupt or unrelated JSON files are skipped silently. This is what makes custom filenames work.

    Inputs:

    • identifier - the record to find. Wire Mememage Decode's identifier here and you've built the start of the decode→verify chain.
    • folder - the folder to search (📁 button). Blank = ComfyUI's output folder (+ subfolder).
    • subfolder - a subfolder under the output folder; ignored when folder is set.

    Outputs:

    • record - the found record JSON, wired into Verify / Unlock / a Preview.
    • identifier - echoed through.
    • found - boolean. False (with an empty record) when nothing matches - never a crash. Wire it into a Switch to branch the graph on whether the record exists.

    Why you'd reach for it

    It's the star of the "prove this image" chain: Decode.identifier → Find Record → Verify. You decode a bar out of an image found in the wild, Find Record digs the matching .json out of your archive even if you renamed the file, and Verify decides. It's also the local twin of Mememage Fetch Record - same lookup, but over the network instead of disk. Use the fast path's contract to your advantage: if you name records with their identifier, the whole thing is one lookup; custom names cost a folder scan.

    Installing it

    Part of mememage-comfy - one install, all nodes. ComfyUI Manager → search "Mememage" → Install → restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/sememtac/mememage-comfy
    <ComfyUI-python> -m pip install mememage
    

    Restart; it's under Mememage/Records. No models or keys.

    Common issues

    • "It can't find a record I know is there." Check what folder it's scanning. Blank folder = the output folder (+ subfolder); if you saved to a custom folder, set folder explicitly. Also, it only scans one folder level for *.json - a record in a sub-subfolder won't be found unless you point at it.
    • "It found the wrong record." Ties break by newest modification time. If two files claim the same identifier, the newer one wins - which is almost certainly what you want, but it's worth knowing the tiebreak exists.
    • found stays False on a bare image. Decode returns an empty identifier for an image with no bar, and Find Record with an empty identifier returns found = False immediately. That's the graceful "nothing to look up" path, not a bug.
    CategoryMememage/Records

    Inputs (3)

    NameTypeDefaultDescription
    identifieroptSTRINGThe record to find — its `identifier` field must match. Wire Decode's identifier here.
    folderoptSTRINGFolder to search (use the 📁 button). Blank = ComfyUI's output folder (+ subfolder).
    subfolderoptSTRINGSubfolder under the output folder, if Save Record used one. Ignored when `folder` is set.

    Outputs (3)

    NameTypeDescription
    recordSTRING
    identifierSTRING
    foundBOOLEAN