[FEATURE REQUEST] Configurable filename format (with code provided) #504
Replies: 4 comments
-
I updated the code above, as I realized the "count" variable had to always be at the beginning of the filename to work properly, and be followed by a "-". So it's better not to make it configurable, and I removed the "[COUNT]" tag. |
Beta Was this translation helpful? Give feedback.
-
Agreed with this, also I think it would be a good idea if the cfg value were included in the filename by default (I added "c{cfg_scale}" to mine after the seed value, to differentiate it from the step count), which would make it so the generation is reproducable with nothing but the image file. Also, a toggle of whether or not to replace the spaces in the prompt with underscores in the filenames would be nice (I modified the "sanitized_prompt" code to disable that in mine, since I want to be able to copy and paste the original prompt more easily from the filename, and underscores do affect the prompt differently than spaces when generating) |
Beta Was this translation helpful? Give feedback.
-
Finally made a PR here: #908 |
Beta Was this translation helpful? Give feedback.
-
Agree. I also manually update to include guidance and denoise values.. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
All parameters vary depending on our needs and experiments. Some people play a lot with steps, others with CFG, or image dimensions. And it is very handy to have this information in the filenames. Personally, I have to manually change webui.py every time I update the repo, to fit my needs. The best way to make everyone happy would be to make the filenames format configurable with a "--name_format" argument. Using tags should be the most flexible and scalable way. Something like:
--name_format [STEPS]-[CFG]-[SEED]-[PROMPT]
Here is the code that implements this (sorry I'm not familiar with Github, and I don't want to mess up things):
First add the following argument in the arguments list:
parser.add_argument("--name_format", type=str, nargs="?", help="filenames format", default=None)
Then replace this code in webui.py :
With this code:
I made some tests, and it seems to work fine. As you can see, the supported tags in the name format are: [STEPS], [CFG], [PROMPT], [WIDTH], [HEIGHT], [SAMPLER] and [SEED]. If no format is provided as an argument, it will use the current naming format.
Hope it will help. Keep up the great work!
Beta Was this translation helpful? Give feedback.
All reactions