separated options for sample and grid dir saving for #222
This commit is contained in:
parent
c92f2ff196
commit
decbbe81f5
|
@ -244,6 +244,9 @@ def sanitize_filename_part(text):
|
|||
|
||||
|
||||
def save_image(image, path, basename, seed=None, prompt=None, extension='png', info=None, short_filename=False, no_prompt=False):
|
||||
# would be better to add this as an argument in future, but will do for now
|
||||
is_a_grid = basename != ""
|
||||
|
||||
if short_filename or prompt is None or seed is None:
|
||||
file_decoration = ""
|
||||
elif opts.save_to_dirs:
|
||||
|
@ -257,7 +260,9 @@ def save_image(image, path, basename, seed=None, prompt=None, extension='png', i
|
|||
else:
|
||||
pnginfo = None
|
||||
|
||||
if opts.save_to_dirs and not no_prompt:
|
||||
save_to_dirs = (is_a_grid and opts.grid_save_to_dirs) or (not is_a_grid and opts.save_to_dirs)
|
||||
|
||||
if save_to_dirs and not no_prompt:
|
||||
words = re_nonletters.split(prompt or "")
|
||||
if len(words[0]) == 0:
|
||||
words = ["empty"]
|
||||
|
|
|
@ -98,7 +98,8 @@ class Options:
|
|||
"outdir_grids": OptionInfo("", "Output directory for grids; if empty, defaults to two directories below"),
|
||||
"outdir_txt2img_grids": OptionInfo("outputs/txt2img-grids", 'Output directory for txt2img grids'),
|
||||
"outdir_img2img_grids": OptionInfo("outputs/img2img-grids", 'Output directory for img2img grids'),
|
||||
"save_to_dirs": OptionInfo(False, "When writing images/grids, create a directory with name derived from the prompt"),
|
||||
"save_to_dirs": OptionInfo(False, "When writing images, create a directory with name derived from the prompt"),
|
||||
"grid_save_to_dirs": OptionInfo(False, "When writing grids, create a directory with name derived from the prompt"),
|
||||
"save_to_dirs_prompt_len": OptionInfo(10, "When using above, how many words from prompt to put into directory name", gr.Slider, {"minimum": 1, "maximum": 32, "step": 1}),
|
||||
"outdir_save": OptionInfo("log/images", "Directory for saving images using the Save button"),
|
||||
"samples_save": OptionInfo(True, "Save indiviual samples"),
|
||||
|
|
Loading…
Reference in New Issue