thedyze / save-image-extended-comfyui

Extended Save node for ComfyUI
85 stars 7 forks source link

[feature request] Independent Counter #5

Closed AlUlkesh closed 1 year ago

AlUlkesh commented 1 year ago

I think currently the counter is incremented if the rest of the filename is the same.

Would it possible to add an option that increments the counter independently from the rest of the filename?

For example, currently: With the following files existing in the folder

000001_good_image.png
000003_bad_image.png

and generating another good_image the filename is: 000002_good_image.png

My request would make it possible for the filename to be 000004_good_image.png instead.

Or in other words, what I am looking for, is for each file in the folder to have its unique ascending number.

thedyze commented 1 year ago

This would require extensive rewrite of the code, it currently looks for the counter numbers in the beginning and in the end of files. I will look into it and see how much work it is.

A workaround for now if you have different filename_keys and/or prefix, and want to have separate counters is to set the counter_digits to different values. So if you have 000001_draft.png you could do 0001_upscale.png and have separate counters.

AlUlkesh commented 1 year ago

An easier approach might be to leave the current logic as is and introduce a new, separate, "sequence number", that when used is always at the beginning of the filename.

If you think that approach would work for you, I could make a PR for it.

thedyze commented 1 year ago

I might be open for that, let me get back to you. Want think a bit on how to proceed first.

thedyze commented 1 year ago

Hey, totally forgot about this, sorry. Go ahead if you're still up for that PR!

AlUlkesh commented 1 year ago

Hi, ok, I'll look into it.

aegis72 commented 1 year ago

Hi! The way I did this was to make my own "bitly" namer node setup, and then I concat that to the filename string. You can see it in the appendix of my Aegisflow Documentation (near the end of the PDF manual): https://github.com/aegis72/aegisflow

AlUlkesh commented 1 year ago

Sorry, I only got around to this today.

@aegis72: Thanks, however I prefer an ascending number in the filename, so I can sort with it.

@thedyze: I think I got this done today, but then I ran into issue #6, so I'll wait for the PR.