I’m currently batch processing images, and I want to keep their original names while adding a suffix. I’m using the Image Save node, but its current options don’t quite work for me. Since I’m using the Batch Image Loader, I can send the image names to the prefix, and that works quite well. Then, I duplicated the Image Save node and added a few fields to avoid disrupting my friends’ workflows with new parameters if they need to reload.
Since the original images already have the naming conventions I need, I just need to add a suffix to indicate the changes I’m making to the images.
Since I have the original names plus the suffix, I added the option to remove the counter at the end of each file name.
I wonder if you could implement this in the code so that anyone else can use it and any future git pull won’t override the node in my files.
Here's the modified node (I renamed the class just for keeping track on my internal workflows and not breaking others using the original class):
`
NODE_CLASS_MAPPINGS = {
"Image Save with suffix": WAS_Image_Save_with_suffix,
I’m currently batch processing images, and I want to keep their original names while adding a suffix. I’m using the Image Save node, but its current options don’t quite work for me. Since I’m using the Batch Image Loader, I can send the image names to the prefix, and that works quite well. Then, I duplicated the Image Save node and added a few fields to avoid disrupting my friends’ workflows with new parameters if they need to reload.
Here's the modified node (I renamed the class just for keeping track on my internal workflows and not breaking others using the original class): ` NODE_CLASS_MAPPINGS = {
class WAS_Image_Save_with_suffix: def init(self): self.output_dir = comfy_paths.output_directory self.type = 'output' @classmethod def INPUT_TYPES(cls): return { "required": { "images": ("IMAGE", ), "output_path": ("STRING", {"default": '[time(%Y-%m-%d)]', "multiline": False}), "filename_prefix": ("STRING", {"default": "ComfyUI"}), "filenamedelimiter": ("STRING", {"default":""}), "filename_suffix": ("STRING", {'default': ""}), "filename_number_padding": ("INT", {"default":4, "min":1, "max":9, "step":1}), "filename_number_start": (["false", "true"],), 'filename_use_counter': (['false', 'true'], {'default': 'true'}), "extension": (['png', 'jpg', 'jpeg', 'gif', 'tiff', 'webp', 'bmp'], ), "dpi": ("INT", {"default": 300, "min": 1, "max": 2400, "step": 1}), "quality": ("INT", {"default": 100, "min": 1, "max": 100, "step": 1}), "optimize_image": (["true", "false"],), "lossless_webp": (["false", "true"],), "overwrite_mode": (["false", "prefix_as_filename"],), "show_history": (["false", "true"],), "show_history_by_prefix": (["true", "false"],), "embed_workflow": (["true", "false"],), "show_previews": (["true", "false"],), }, "hidden": { "prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO" }, }