feat: extra models path option

This commit is contained in:
Dowon
2023-10-21 16:52:07 +09:00
parent 6832136581
commit cebd492613
2 changed files with 23 additions and 12 deletions

View File

@@ -53,7 +53,10 @@ from modules.shared import cmd_opts, opts, state
no_huggingface = getattr(cmd_opts, "ad_no_huggingface", False)
adetailer_dir = Path(models_path, "adetailer")
model_mapping = get_models(adetailer_dir, huggingface=not no_huggingface)
extra_models_dir = Path(shared.opts.data.get("ad_extra_models_dir", ""))
model_mapping = get_models(
adetailer_dir, extra_dir=extra_models_dir, huggingface=not no_huggingface
)
txt2img_submit_button = img2img_submit_button = None
SCRIPT_DEFAULT = "dynamic_prompting,dynamic_thresholding,wildcard_recursive,wildcards,lora_block_weight"
@@ -781,6 +784,16 @@ def on_ui_settings():
),
)
shared.opts.add_option(
"ad_extra_models_path",
shared.OptionInfo(
default="",
label="Extra path to scan adetailer models",
component=gr.Textbox,
section=section,
),
)
shared.opts.add_option(
"ad_save_previews",
shared.OptionInfo(False, "Save mask previews", section=section),