ComfyS3 icon indicating copy to clipboard operation
ComfyS3 copied to clipboard

Files get overwritten when trying to save into subfolders

Open AlvaroLopez-DEU opened this issue 4 months ago • 1 comments

Files get overwritten when trying to save into subfolders

It seems that using filename_prefix with a / character to separate into multiple subfolders is not working (it does work on the vanilla Save Image node). Ideally, when setting an output folder via the S3_OUTPUT_DIR env var, you should also be able to select subfolders when checking the counter.

What happens today is that the file is ALWAYS written as {outputDir}/{prefix}_00001.png. The prefix DOES work, since the file is created in the subfolder, however, the counter is ALWAYS 00001 and thus, is always replaced.

To Reproduce

Create any workflow with a Save Image to S3 node and add a / character to filename_prefix, such as example/ComfyUI. For every workflow you run, the name will ALWAYS be {outputDir}/example/ComfyUI_00001.png (the file contains the output of the last workflow run).

Expected behavior

When creating the workflow under "To Reproduce", I would expect the node to create files under {outputDir}/example/ComfyUI, meaning they have keys like {outputDir}/example/ComfyUI_000001.png, {outputDir}/example/ComfyUI_000002.png, {outputDir}/example/ComfyUI_000003.png, {outputDir}/example/ComfyUI_000004.png and so on.

I hope this can get fixed soon. If needed, I can create a PR @TemryL .

AlvaroLopez-DEU avatar Aug 26 '25 05:08 AlvaroLopez-DEU

Maybe we can add two strategies to check the numbering? Like, one that checks the numbering of local files (the same behavior as the default SaveImage node) or the one that does an S3 folder checkup

AlvaroLopez-DEU avatar Aug 26 '25 05:08 AlvaroLopez-DEU