diff options
author | w-e-w <40751091+w-e-w@users.noreply.github.com> | 2024-01-20 17:21:36 +0000 |
---|---|---|
committer | w-e-w <40751091+w-e-w@users.noreply.github.com> | 2024-01-20 18:53:58 +0000 |
commit | 25e8273d2f6481deca221b29d35093f6d0c9da6a (patch) | |
tree | 8aa4651858aa851811341778a3e41092aab46f61 /modules/shared.py | |
parent | f939bce845ae07536b1c920618743af83e0b01ec (diff) | |
download | stable-diffusion-webui-gfx803-25e8273d2f6481deca221b29d35093f6d0c9da6a.tar.gz stable-diffusion-webui-gfx803-25e8273d2f6481deca221b29d35093f6d0c9da6a.tar.bz2 stable-diffusion-webui-gfx803-25e8273d2f6481deca221b29d35093f6d0c9da6a.zip |
re-work multi --styles-file
--styles-file change to append str
--styles-file is [] then defaults to [styles.csv]
--styles-file accepts paths or paths with wildcard "*"
the first `--styles-file` entry is use as the default styles file path
if filename a wildcard then the first matching file is used
if no match is found, create a new "styles.csv" in the same dir as the first path
when saving a new style it will be save in the default styles file
when saving a existing style, it will be saved to file it belongs to
order of the styles files in the styles dropdown can be controlled to a certain degree by the order of --styles-file
Diffstat (limited to 'modules/shared.py')
-rw-r--r-- | modules/shared.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/shared.py b/modules/shared.py index 63661939..ccdca4e7 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -1,3 +1,4 @@ +import os
import sys
import gradio as gr
@@ -11,7 +12,7 @@ parser = shared_cmd_options.parser batch_cond_uncond = True # old field, unused now in favor of shared.opts.batch_cond_uncond
parallel_processing_allowed = True
-styles_filename = cmd_opts.styles_file
+styles_filename = cmd_opts.styles_file = cmd_opts.styles_file if len(cmd_opts.styles_file) > 0 else [os.path.join(data_path, 'styles.csv')]
config_filename = cmd_opts.ui_settings_file
hide_dirs = {"visible": not cmd_opts.hide_ui_dir_config}
|