alexopus / ComfyUI-Image-Saver

Save images with Civitai-compatible generation metadata in ComfyUI
MIT License
49 stars 8 forks source link

Filename Placeholder #31

Closed noarche closed 3 months ago

noarche commented 4 months ago

Hello and thanks for reading this prob. Resolving this prob would help me with a project where I am using comfyUI to perform a task where I need to preserve original file names (they were named with very useful information).

Is it possible for you to add a %filename- placeholder so that it is replaced with the original file name?

example:

I load testIMG.jpg in image load node and send to Img saver node with naming convention:

%filename-%time-%basemodelname-%cfg-%steps-%sampler_name-%scheduler-%seed

Resulting with:

testIMG-2023-11-16-131331-Anything-v4.5-pruned-mergedVae-7.0-25-dpm_2-normal-1_01.png

alexopus commented 3 months ago

There can be many image loader nodes in the workflow. Not only the standard ones, but also custom ones. Which one provides the filename for the %filename? There is no way to guess that from the Saver node.

Possible solution would be to accept that as an string input. But since a "filename" you have in your use case is not a very common one, I would make a "custom" input/widget, which you could use in the filename as %custom. Then you have to somehow provide the filename as an input to the Saver node as a string. Would this work for you?

noarche commented 3 months ago

Not sure what happened but after I requested this I found it after updating. There are now filename bubbles on the loaders I use. Thanks! I can just use this and convert filename to input on saver node and it should resolve my issue.