fix: detect new input-folder files across restarts

Same root cause as the node-update bug: the input file list (LoadImage etc. do
os.listdir(input) in INPUT_TYPES) is baked into the cached object_info, which
persists across restarts, so new input files were invisible until a manual
refresh. The input dir is listed non-recursively, so its own mtime reliably
flags add/remove -- fold it (one stat) into the node fingerprint so a restart
picks up new input files. Model folders are nested + on a slow mount, so they
are intentionally not fingerprinted (use a refresh button for new models).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-05 11:59:05 +02:00
parent fcd7c49da5
commit 0d2b5e0819
+10 -1
View File
@@ -362,7 +362,16 @@ def _current_node_signature():
except Exception as e: # pragma: no cover
log.warning("Tenaciousload: custom_nodes code hash failed: %s", e)
code = ""
return f"{len(keys)}:{h.hexdigest()}:{code}"
# input-dir mtime: LoadImage etc. list the input folder (non-recursively) in
# their INPUT_TYPES, so it rides along in object_info. The dir's own mtime
# changes when files are added/removed there, so a restart picks them up.
# (Cheap: one stat. Model folders are on a slow mount + nested, so they are
# NOT fingerprinted here — use a refresh button for new models.)
try:
inp = str(os.path.getmtime(folder_paths.get_input_directory()))
except Exception:
inp = ""
return f"{len(keys)}:{h.hexdigest()}:{code}:{inp}"
def _check_node_signature():