diff --git a/README.md b/README.md index d35ee9c..35a2f1e 100644 --- a/README.md +++ b/README.md @@ -105,4 +105,4 @@ The node name may be the class type (`TXTBatchLoader`), the display name, the wo - PyTorch 2.0 or newer - Codecs required by the selected video format -Current package version: `1.2.0` +Current package version: `1.2.1` diff --git a/__init__.py b/__init__.py index 58c9c82..4297a81 100644 --- a/__init__.py +++ b/__init__.py @@ -10,9 +10,6 @@ from .nodes.lora_batch_process import LoraBatchLoader from .nodes.video_batch_process import VideoBatchSaver # type: ignore from .nodes.any_batch_process import AnyBatchGroup, AssetFilter from .nodes.model3d_batch_process import Model3DBatchSaver, Model3DBatchPreview -from .nodes.runtime_filename_format import install_runtime_filename_substitution - -install_runtime_filename_substitution() WEB_DIRECTORY = "./web" diff --git a/nodes/runtime_filename_format.py b/nodes/runtime_filename_format.py index 2ed3604..cb0643a 100644 --- a/nodes/runtime_filename_format.py +++ b/nodes/runtime_filename_format.py @@ -70,6 +70,7 @@ def record_runtime_output( prompt_id=None, ): """Record a node output so a saver can reference it in the same prompt.""" + install_runtime_filename_substitution() aliases = {str(node_type)} if display_name: aliases.add(str(display_name)) @@ -99,6 +100,7 @@ def replace_runtime_placeholders(text, prompt_id=None): if not isinstance(text, str) or "%" not in text: return text + install_runtime_filename_substitution() resolved_prompt_id = prompt_id if prompt_id is not None else _current_prompt_id() with _LOCK: values = {} @@ -120,7 +122,11 @@ def replace_runtime_placeholders(text, prompt_id=None): def install_runtime_filename_substitution(): - """Install the lightweight hook used by all ComfyUI saver nodes.""" + """Install the lightweight hook used by all ComfyUI saver nodes. + + Called lazily from record/replace instead of at import time, so loading + this package never modifies the host application by itself. + """ try: import folder_paths except ImportError: diff --git a/pyproject.toml b/pyproject.toml index 74905ae..577dc2a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "batch-process" description = "A collection of nodes for batch processing texts, images, videos, and LoRAs in ComfyUI" -version = "1.2.0" +version = "1.2.1" license = {file = "LICENSE"} [project.urls]