mirror of
https://github.com/Bing-su/adetailer.git
synced 2026-02-24 17:14:09 +00:00
fix: controlnet to script default
This commit is contained in:
@@ -1 +1 @@
|
||||
__version__ = "23.5.16"
|
||||
__version__ = "23.5.17.dev0"
|
||||
|
||||
@@ -47,6 +47,9 @@ 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)
|
||||
txt2img_submit_button = img2img_submit_button = None
|
||||
SCRIPT_DEFAULT = (
|
||||
"controlnet,dynamic_prompting,dynamic_thresholding,wildcard_recursive,wildcards"
|
||||
)
|
||||
|
||||
if (
|
||||
not adetailer_dir.exists()
|
||||
@@ -269,13 +272,13 @@ class AfterDetailerScript(scripts.Script):
|
||||
def script_filter(self, p, args: ADetailerArgs):
|
||||
script_runner = copy(p.scripts)
|
||||
script_args = deepcopy(p.script_args)
|
||||
self.disable_controlnet_units(script_args)
|
||||
|
||||
ad_only_seleted_scripts = opts.data.get("ad_only_seleted_scripts", True)
|
||||
if not ad_only_seleted_scripts:
|
||||
return script_runner, script_args
|
||||
|
||||
default = "dynamic_prompting,dynamic_thresholding,wildcards,wildcard_recursive"
|
||||
ad_script_names = opts.data.get("ad_script_names", default)
|
||||
ad_script_names = opts.data.get("ad_script_names", SCRIPT_DEFAULT)
|
||||
script_names_set = {
|
||||
name
|
||||
for script_name in ad_script_names.split(",")
|
||||
@@ -283,7 +286,6 @@ class AfterDetailerScript(scripts.Script):
|
||||
}
|
||||
|
||||
if args.ad_controlnet_model != "None":
|
||||
self.disable_controlnet_units(script_args)
|
||||
script_names_set.add("controlnet")
|
||||
|
||||
filtered_alwayson = []
|
||||
@@ -562,7 +564,7 @@ def on_ui_settings():
|
||||
shared.opts.add_option(
|
||||
"ad_script_names",
|
||||
shared.OptionInfo(
|
||||
default="dynamic_prompting,dynamic_thresholding,wildcards,wildcard_recursive",
|
||||
default=SCRIPT_DEFAULT,
|
||||
label="Script names to apply to ADetailer (separated by comma)",
|
||||
component=gr.Textbox,
|
||||
component_args=textbox_args,
|
||||
|
||||
Reference in New Issue
Block a user