make save to dirs optional for imgs saved from ui

This commit is contained in:
Lopyter 2022-10-02 18:15:31 +02:00 committed by AUTOMATIC1111
parent 2ef69df9a7
commit 91f327f22b
2 changed files with 2 additions and 1 deletions

View File

@ -173,6 +173,7 @@ options_templates.update(options_section(('saving-to-dirs', "Saving to a directo
"grid_save_to_dirs": OptionInfo(False, "Save grids to subdirectory"),
"directories_filename_pattern": OptionInfo("", "Directory name pattern"),
"directories_max_prompt_words": OptionInfo(8, "Max prompt words", gr.Slider, {"minimum": 1, "maximum": 20, "step": 1}),
"use_save_to_dirs_for_ui": OptionInfo(False, "Use \"Save images to a subdirectory\" option for images saved from UI"),
}))
options_templates.update(options_section(('upscaling', "Upscaling"), {

View File

@ -113,7 +113,7 @@ def save_files(js_data, images, index):
p = MyObject(data)
path = opts.outdir_save
save_to_dirs = opts.save_to_dirs
save_to_dirs = opts.use_save_to_dirs_for_ui
if save_to_dirs:
dirname = apply_filename_pattern(opts.directories_filename_pattern or "[prompt_words]", p, p.seed, p.prompt)