ComfyUI Node Runs on cloud

Path Exists

Skip renders that already exist

By WASasquatch·Created 3 years ago·Updated 4 days ago· 1,844
Path Exists
    • exists
    • is_file
    • is_directory
    • size_bytes
    • modified_epoch
    • modified
    • resolved
    path

    ComfyUI workflows are stateless in a frustrating way: re-run a queue and it happily re-renders the ten frames you finished an hour ago. Path Exists is the node that lets a graph ask the disk "is this already there?" and branch on the answer - the building block for skipping frames that have already rendered, or checking whether a cache is still valid before rebuilding it.

    It takes one path and answers seven facts about it: whether it exists, whether it's a file or a folder, its size, when it last changed, and the resolved absolute path. Wire the exists boolean into a gate or switch and you've turned a blind re-render into an incremental one.

    What it tells you

    Feed path a file or folder - an absolute path like C:/renders/frame_0001.png, or one relative to the folder ComfyUI was started from. The outputs:

    • exists - true when something is at that path. A folder counts, and so does a zero-byte file.
    • is_file / is_directory - true only for ordinary files / folders. Pair them with exists to tell "a folder is there" from "a file is there."
    • size_bytes - bytes the file holds; 0 for folders, for nothing, and for empty files. So size_bytes > 0 is the test for "a non-empty file is there."
    • modified_epoch - last change as a Unix timestamp; modified is the same moment in local time (2026-08-22 11:57:03). Feed two of these to a compare node to ask "is the cache older than its source?"
    • resolved - the absolute path that was actually probed.

    The two workflows it unlocks

    Skip finished frames. Number Range or a loop drives a frame counter → Path Exists checks frame_%04d.png → a gate lets the sampler run only when exists is false. Re-queue and every finished frame falls through instantly. That pattern pays for itself the first time a 200-frame batch crashes at frame 180.

    Cache invalidation. If a file was built from a source (a resized image, a cached encode), compare modified_epoch of both - the cache is stale when its timestamp is older than the source's. The tooltip names exactly this use: "a cache can be compared against the file it was built from."

    The containment rule, and why it's good

    There's a security boundary worth knowing about: a path outside the folders this pack may read (ComfyUI's input/output/temp, the pack's own state directory, or anything you added under paths.allow_read in config.yaml) is answered as not existing, with the refusal on resolved. So a probe never stops the prompt - it just says no. If your path lives somewhere unusual, add its folder to paths.allow_read and restart.

    Installing

    Path Exists is part of WAS Node Suite v3. ComfyUI Manager → search WAS Node Suite v3, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/WASasquatch/was-node-suite-comfyui
    

    Restart after. Requires ComfyUI 0.14.0+ and Python 3.10+. Nothing extra installs - v3's rewrite runs on ComfyUI's own runtime rather than the old v2 suite's twenty-package dependency stack, which was the historic source of its post-update breakage.

    Honest caveat: this node reports the disk; it doesn't remember it. Between the check and the write, anything can change, and nothing here guarantees the file you're about to save won't be overwritten by a parallel run. For that, pair it with the save node's own overwrite settings rather than treating the check as a lock.

    CategoryWAS Suite/IO

    Inputs (1)

    NameTypeDefaultDescription
    pathSTRINGThe file or folder to look for, such as 'C:/renders/frame_0001.png', or a path relative to the folder ComfyUI was started in. Nothing is opened, read or written; the path is only asked about.

    Outputs (7)

    NameTypeDescription
    existsBOOLEANtrue when something is at that path. A folder counts, and so does a file of 0 bytes. false when nothing is there, and false for a path outside the folders this pack may read.
    is_fileBOOLEANtrue only for an ordinary file. false for a folder and false when nothing is there, so pair it with exists to tell 'a folder is at that path' from 'nothing is'.
    is_directoryBOOLEANtrue only for a folder. false for a file and false when nothing is there. Wire it to a switch that picks between loading a whole folder and loading one file.
    size_bytesINTBytes the file holds. 0 for a folder, 0 when nothing is there, and 0 for an empty file, so 'size_bytes > 0' is the test for a render that finished writing rather than one cut off at the start.
    modified_epochFLOATWhen it last changed, in seconds since 1970, as 1755864000.0. 0.0 when nothing is there. Feed two of these to Compare to tell which of a source and a cache is the newer.
    modifiedSTRINGThe same moment in local time, as '2026-08-22 11:57:03'. Empty when nothing is there. For reading and for naming a file; compare modified_epoch instead of this.
    resolvedSTRINGThe absolute path that was probed. For a path outside the folders this pack may read, nothing is probed and this carries the refusal instead, naming every permitted folder and the config key that would allow it.