Use one counter across full save path

This commit is contained in:
2026-08-05 13:59:41 +00:00
parent d89335f1eb
commit b865af5384
3 changed files with 42 additions and 9 deletions
+5 -5
View File
@@ -1,7 +1,7 @@
from .dumas_image_nodes import (
NODE_CLASS_MAPPINGS as IMAGE_NODE_CLASS_MAPPINGS,
NODE_DISPLAY_NAME_MAPPINGS as IMAGE_NODE_DISPLAY_NAME_MAPPINGS,
_next_counter,
_next_counter_for_relative_path,
resolve_serve_token,
)
from .dumas_json_nodes import (
@@ -102,10 +102,10 @@ try:
parts = [part for part in name.replace("\\", "/").split("/") if part]
if not parts:
return 1, ""
frame_dir = os.path.join(base, *parts[:-1])
counter = _next_counter(frame_dir, parts[-1])
resolved_name = parts[-1].replace("%counter%", str(counter).zfill(digits))
return counter, "/".join(parts[:-1] + [resolved_name])
relative_template = "/".join(parts)
counter = _next_counter_for_relative_path(base, relative_template)
resolved_relative = relative_template.replace("%counter%", str(counter).zfill(digits))
return counter, resolved_relative
try:
loop = asyncio.get_running_loop()