wallish77 / wlsh_nodes

WLSH ComfyUI Nodes
GNU General Public License v3.0
93 stars 13 forks source link

Image Save with prompt - file name and save location issues #4

Closed JHNewton closed 1 year ago

JHNewton commented 1 year ago

OK, used the WAS seed node and got that issue taken care. Now, I like to name my files with my initials and the date (JHN-2023-08-11) I use the system notation , [time(%Y-%m-%d)] (the same as WAS uses in his save image). Unfortunately, it is using the system parameter time literally - JHN_[time(%Y-%m-%d)]. The other issue is that that the node will not save to a subdirectory - ./output/[time(%Y-%m-%d)]. Nothing. If I remove the date/time parameter, it'll save. Now, I haven't tried it with a full directory name such as ./output/2023-08-11. question: is your node suppose to create a new entry in the png file or is it just appending to the current prompt tag?

wallish77 commented 1 year ago

The timestamp naming on my node works a little differently in that it expects a keyword like %time which it will unwrap to the specific format of YYYY-mm-dd-hhmmss. If you want to prepend your initials, you could format the string like JHN_%time and it should follow accordingly.

The output directory does not go through the keyword parsing, so it'll take what you put literally. I do have a node under text (I think) that just provides different time strings which could use with a string concatenate node (I think WAS has one) to make directory and/or filenames as inputs.

As far as the entry into the png file, it embeds information that Comfy normally doesn't, as far as I know. Or at least, when I wrote it I don't think Comfy did (a lot has changed in the last month or so!).

JHNewton commented 1 year ago

Cool. I noticed that your save node does not appear to sequences the images. Am I missing something?

On Sun, Aug 13, 2023, 11:01 wallish77 @.***> wrote:

Closed #4 https://github.com/wallish77/wlsh_nodes/issues/4 as completed.

— Reply to this email directly, view it on GitHub https://github.com/wallish77/wlsh_nodes/issues/4#event-10080060743, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVZJJ4KF2MJZZ75FYU2HOB3XVDT3XANCNFSM6AAAAAA3NB5SYM . You are receiving this because you authored the thread.Message ID: @.***>

wallish77 commented 1 year ago

By sequence do you mean append a counter? I think it will if you have a batch going but otherwise it doesn't as it assumes you're not putting more than one image per second. I suppose that's not the safest assumption as cards get faster...

JHNewton commented 1 year ago

Ok, thanks for the clarification. Amy chance that you might add that ability/feature? I don't normally do batch work as such, but I do quite a few images with tweaks in between each generation and I like to save them for comparisons. This does necessitate that each have a unique name, and generally just doing a increments increase in sequence number does the trick.

A little background - I retired from the government back in 2005 as a computer specialist/IT specialist. I have a programming background, but mostly in I guess what are considered dead languages - Basic, Pascal, COBAL, fortran... you get the idea. I didn't get into the object-oriented world as such. Python is a completely new creation to me and I'm not quite sure I want to try and learn a new language at 75. I'd rather spend my energy/time in learning to utilize what talented folk like you have developed.

I'm also a fairly decent photographer and do a fair amount of work in Photoshop. The whole purpose of learning Generative AI, ie ComfyUI, was to help me in my photography. So, most of my questions, and maybe some suggestions, will be as quasi-knowledgeable user.

Regards, John Newton

Fotographixs http://www.fotographixs.com Instagram https://instagram.com/john.fotographixs/ Facebook https://www.facebook.com/profile.php?id=1240206692

I don't think that I'll ever reach the stage when I will say, "This is what I believe. Finished." What I believe is alive ... and open to growth. --Madeleine L'Engle

On Sun, Aug 13, 2023 at 11:21 AM wallish77 @.***> wrote:

By sequence do you mean append a counter? I think it will if you have a batch going but otherwise it doesn't as it assumes you're not putting more than one image per second. I suppose that's not the safest assumption as cards get faster...

— Reply to this email directly, view it on GitHub https://github.com/wallish77/wlsh_nodes/issues/4#issuecomment-1676390910, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVZJJ4PY3KTZNVD67SUVEKDXVDWHBANCNFSM6AAAAAA3NB5SYM . You are receiving this because you authored the thread.Message ID: @.***>

wallish77 commented 1 year ago

I'll look into how to implement a counter for my save node, but it might not be so straightforward and there are other ways that might be easier. First, the way that Comfy does the counter is to check the save path and grab the filenames from that path, finding pattern _#, getting the # part of that, and then adding one and returning it to be added to the filename before saving. However, I think that requires the filename prior to the entry to be the same (just with a different number on the end).

My general practice for uniqueness is to have the filename of %time-%model-%seed or %time-%seed, which creates pretty unique names. If your goal is just unique names that may be a good trick. To get matching images need to have two images created within one second of each other, that aren't part of a batch, and have the same seed.

You can also use an extra seed node and set the mode to "increment" and feed that into the seed input of my file save node, including %seed at the end (like JHN_%seed) and it'll act like a counter.

JHNewton commented 1 year ago

That does indeed work, but makes for one looooong file name😁 I know that WAS had some issues with naming files and directories. I was trying to save my images to a different drive. For the time being, I'm saving my images to the default "output" directory with a subdirectory for the date created

Ideally, it would be great if I could just save to the working LR directory, but I understand the ComfyUI has some "challenges" in working with directories other than the default.

Thanks for taking the time and keep up the great work.

Regards, John Newton

Fotographixs http://www.fotographixs.com Instagram https://instagram.com/john.fotographixs/ Facebook https://www.facebook.com/profile.php?id=1240206692

I don't think that I'll ever reach the stage when I will say, "This is what I believe. Finished." What I believe is alive ... and open to growth. --Madeleine L'Engle

On Sun, Aug 13, 2023 at 12:39 PM wallish77 @.***> wrote:

I'll look into how to implement a counter for my save node, but it might not be so straightforward and there are other ways that might be easier. First, the way that Comfy does the counter is to check the save path and grab the filenames from that path, finding pattern _#, getting the # part of that, and then adding one and returning it to be added to the filename before saving. However, I think that requires the filename prior to the entry to be the same (just with a different number on the end).

My general practice for uniqueness is to have the filename of %time-%model-%seed or %time-%seed, which creates pretty unique names. If your goal is just unique names that may be a good trick.

— Reply to this email directly, view it on GitHub https://github.com/wallish77/wlsh_nodes/issues/4#issuecomment-1676407717, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVZJJ4NJHKQT4YLS64FIEADXVD7KZANCNFSM6AAAAAA3NB5SYM . You are receiving this because you authored the thread.Message ID: @.***>