Added option to add multiple extra models dirs separated by colons (#596)

* Added option to add multiple extra models dirs separated by colons

* Added "(requires Reload UI)" tag to the extra models path setting

* Changed colon seperator to in favor of vertical bar.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Natans
2024-05-06 10:02:14 +03:00
committed by GitHub
parent 87739bed85
commit dc451caaa2

View File

@@ -76,10 +76,10 @@ no_huggingface = getattr(cmd_opts, "ad_no_huggingface", False)
adetailer_dir = Path(paths.models_path, "adetailer")
safe_mkdir(adetailer_dir)
extra_models_dir = shared.opts.data.get("ad_extra_models_dir", "")
extra_models_dirs = shared.opts.data.get("ad_extra_models_dir", "")
model_mapping = get_models(
adetailer_dir,
extra_models_dir,
*extra_models_dirs.split("|"),
huggingface=not no_huggingface,
)
@@ -849,10 +849,12 @@ def on_ui_settings():
"ad_extra_models_dir",
shared.OptionInfo(
default="",
label="Extra path to scan adetailer models",
label="Extra paths to scan adetailer models seperated by vertical bars",
component=gr.Textbox,
section=section,
),
)
.info("eg. path/to/models|another/path/to/models|different/path/to/models")
.needs_reload_ui(),
)
shared.opts.add_option(