1.2.1: install runtime filename hook lazily, no import-time side effect

This commit is contained in:
Zar4X
2026-09-04 13:09:44 +08:00
parent b25cfdb359
commit 5c7cb7f575
4 changed files with 9 additions and 6 deletions
+1 -1
View File
@@ -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`
-3
View File
@@ -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"
+7 -1
View File
@@ -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:
+1 -1
View File
@@ -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]