Files
Amatsukast a79fc7d855 fix: make Save Text Sequential mode actually sequential (v2.0.1)
The counter scan built its pattern from the expanded filename_prefix, so a
strftime prefix never matched the previous run: 20260811_141635_(\d+) does
not match 20260811_141634_0001.txt. Every execution restarted at 0001.

The prefix is now a wildcard in the scan. The counter is the highest number
already present in the folder plus one, independent of the prefix, so two
prefixes saved side by side share one rising sequence instead of each
starting over. Only the configured counter position is scanned: reading both
layouts lets a digit-bearing prefix pass for a counter, and 20260811_..._0001
sends the sequence to eight digits under the Front pattern.

The counter was also taken as scan-maximum + 1 with no check that the path
was free, so a name the pattern did not cover was clobbered. It now advances
past occupied names, making Sequential never overwrite as documented.

Separately, separator was the only input never sanitized, and it is joined
into the filename after the traversal check has run on the directory. '/',
'\', '../' and '*' raised FileNotFoundError or OSError mid-write; ':' created
an NTFS alternate data stream, leaving a 0-byte visible file with the text
hidden inside it; '\..\..\..\' wrote outside the output directory. It now
goes through the same forbidden-character filter as filename_prefix, without
the trim and the fallback so that a space and an empty string stay valid.

No node input, output, or widget changed, so saved workflows load unchanged.
2026-08-11 14:43:16 +09:00

65 lines
2.7 KiB
Python

"""ComfyUI-SBTools - Custom Node Collection"""
__version__ = "2.0.1"
from .nodes.birefnet_node import NODE_CLASS_MAPPINGS as BIREFNET_MAPPINGS
from .nodes.birefnet_node import NODE_DISPLAY_NAME_MAPPINGS as BIREFNET_DISPLAY
from .nodes.alpha_to_chroma_key import NODE_CLASS_MAPPINGS as CHROMAKEY_MAPPINGS
from .nodes.alpha_to_chroma_key import NODE_DISPLAY_NAME_MAPPINGS as CHROMAKEY_DISPLAY
from .nodes.variable_prompt import NODE_CLASS_MAPPINGS as VARPROMPT_MAPPINGS
from .nodes.variable_prompt import NODE_DISPLAY_NAME_MAPPINGS as VARPROMPT_DISPLAY
from .nodes.variable_combiner import NODE_CLASS_MAPPINGS as VARCOMB_MAPPINGS
from .nodes.variable_combiner import NODE_DISPLAY_NAME_MAPPINGS as VARCOMB_DISPLAY
from .nodes.variable_folder import NODE_CLASS_MAPPINGS as VARFOLDER_MAPPINGS
from .nodes.variable_folder import NODE_DISPLAY_NAME_MAPPINGS as VARFOLDER_DISPLAY
from .nodes.variable_image_loader import NODE_CLASS_MAPPINGS as VARIMGLOADER_MAPPINGS
from .nodes.variable_image_loader import (
NODE_DISPLAY_NAME_MAPPINGS as VARIMGLOADER_DISPLAY,
)
from .nodes.variable_builder import NODE_CLASS_MAPPINGS as VARBUILDER_MAPPINGS
from .nodes.variable_builder import NODE_DISPLAY_NAME_MAPPINGS as VARBUILDER_DISPLAY
from .nodes.variable_debug import NODE_CLASS_MAPPINGS as VARDEBUG_MAPPINGS
from .nodes.variable_debug import NODE_DISPLAY_NAME_MAPPINGS as VARDEBUG_DISPLAY
from .nodes.match_color import NODE_CLASS_MAPPINGS as MATCHCOLOR_MAPPINGS
from .nodes.match_color import NODE_DISPLAY_NAME_MAPPINGS as MATCHCOLOR_DISPLAY
from .nodes.match_color_balance import NODE_CLASS_MAPPINGS as MATCHCOLORBALANCE_MAPPINGS
from .nodes.match_color_balance import (
NODE_DISPLAY_NAME_MAPPINGS as MATCHCOLORBALANCE_DISPLAY,
)
from .nodes.match_luminance import NODE_CLASS_MAPPINGS as MATCHLUMINANCE_MAPPINGS
from .nodes.match_luminance import NODE_DISPLAY_NAME_MAPPINGS as MATCHLUMINANCE_DISPLAY
from .nodes.save_text import NODE_CLASS_MAPPINGS as SAVETEXT_MAPPINGS
from .nodes.save_text import NODE_DISPLAY_NAME_MAPPINGS as SAVETEXT_DISPLAY
NODE_CLASS_MAPPINGS = {
**BIREFNET_MAPPINGS,
**CHROMAKEY_MAPPINGS,
**VARPROMPT_MAPPINGS,
**VARFOLDER_MAPPINGS,
**VARCOMB_MAPPINGS,
**VARIMGLOADER_MAPPINGS,
**VARBUILDER_MAPPINGS,
**VARDEBUG_MAPPINGS,
**MATCHCOLOR_MAPPINGS,
**MATCHCOLORBALANCE_MAPPINGS,
**MATCHLUMINANCE_MAPPINGS,
**SAVETEXT_MAPPINGS,
}
NODE_DISPLAY_NAME_MAPPINGS = {
**BIREFNET_DISPLAY,
**CHROMAKEY_DISPLAY,
**VARPROMPT_DISPLAY,
**VARFOLDER_DISPLAY,
**VARCOMB_DISPLAY,
**VARIMGLOADER_DISPLAY,
**VARBUILDER_DISPLAY,
**VARDEBUG_DISPLAY,
**MATCHCOLOR_DISPLAY,
**MATCHCOLORBALANCE_DISPLAY,
**MATCHLUMINANCE_DISPLAY,
**SAVETEXT_DISPLAY,
}
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"]