Avoid overwriting custom image names

This commit is contained in:
2026-10-15 14:57:27 +00:00
parent 64a8e8a439
commit 873028f783
3 changed files with 38 additions and 3 deletions
+5 -1
View File
@@ -1,6 +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_available_relative_path,
_next_counter_for_relative_path,
_folder_is_image,
_list_folder_image_files,
@@ -135,7 +136,10 @@ try:
return 1, ""
relative_template = "/".join(parts)
counter = _next_counter_for_relative_path(base, relative_template)
resolved_relative = relative_template.replace("%counter%", str(counter).zfill(digits))
if "%counter%" in relative_template:
resolved_relative = relative_template.replace("%counter%", str(counter).zfill(digits))
else:
resolved_relative = _next_available_relative_path(base, relative_template)
return counter, resolved_relative
try: