From dc451caaa27ea22d70c0c1b4b603a2c013d15884 Mon Sep 17 00:00:00 2001 From: Natans <52584161+Natans8@users.noreply.github.com> Date: Mon, 6 May 2024 10:02:14 +0300 Subject: [PATCH] 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> --- scripts/!adetailer.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/!adetailer.py b/scripts/!adetailer.py index b3fb1c6..0d43264 100644 --- a/scripts/!adetailer.py +++ b/scripts/!adetailer.py @@ -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(