diff --git a/README.md b/README.md index 605c321..d30f6c6 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,13 @@ python main.py --listen --port 8188 --enable-compress-response-body button, to force a rebuild. - An nginx reverse proxy can cache `object_info` at the HTTP layer too, but this pack does it in-process so no extra service, container, or port is needed. +- **New files in the `input` folder** are picked up by a **refresh button** by + default (same as new models) — they do *not* trigger an automatic rebuild on + restart. To auto-detect them on restart instead, set + `TENACIOUSLOAD_WATCH_INPUT=1`. Only do this if your input folder is fairly + static: on a busy input folder (e.g. a video workflow that adds clips + constantly) the input dir changes on nearly every restart, which would + invalidate the cache and force a slow rebuild each time — defeating the point. ## Installing / updating other custom nodes This pack is a quiet neighbour: diff --git a/__init__.py b/__init__.py index b1c78d7..124a3ef 100644 --- a/__init__.py +++ b/__init__.py @@ -362,15 +362,19 @@ def _current_node_signature(): except Exception as e: # pragma: no cover log.warning("Tenaciousload: custom_nodes code hash failed: %s", e) 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 = "" + # Optionally fold in the input-dir mtime so new files in the input folder + # show up after a restart. OFF BY DEFAULT: on a high-churn input folder + # (e.g. a video workflow that constantly adds clips) it changes on nearly + # every restart, invalidating the cache and forcing a slow rebuild — which + # defeats the whole point. Enable with TENACIOUSLOAD_WATCH_INPUT=1 only if + # your input folder is fairly static. Otherwise use a refresh button for new + # input files, same as for new models. + inp = "" + if os.environ.get("TENACIOUSLOAD_WATCH_INPUT", "").strip().lower() in ("1", "true", "yes", "on"): + try: + inp = str(os.path.getmtime(folder_paths.get_input_directory())) + except Exception: + inp = "" return f"{len(keys)}:{h.hexdigest()}:{code}:{inp}"