mirror of
https://github.com/Bing-su/adetailer.git
synced 2026-04-30 19:21:33 +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")
|
adetailer_dir = Path(models_path, "adetailer")
|
||||||
model_mapping = get_models(adetailer_dir, huggingface=not no_huggingface)
|
model_mapping = get_models(adetailer_dir, huggingface=not no_huggingface)
|
||||||
txt2img_submit_button = img2img_submit_button = None
|
txt2img_submit_button = img2img_submit_button = None
|
||||||
|
SCRIPT_DEFAULT = (
|
||||||
|
"controlnet,dynamic_prompting,dynamic_thresholding,wildcard_recursive,wildcards"
|
||||||
|
)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
not adetailer_dir.exists()
|
not adetailer_dir.exists()
|
||||||
@@ -269,13 +272,13 @@ class AfterDetailerScript(scripts.Script):
|
|||||||
def script_filter(self, p, args: ADetailerArgs):
|
def script_filter(self, p, args: ADetailerArgs):
|
||||||
script_runner = copy(p.scripts)
|
script_runner = copy(p.scripts)
|
||||||
script_args = deepcopy(p.script_args)
|
script_args = deepcopy(p.script_args)
|
||||||
|
self.disable_controlnet_units(script_args)
|
||||||
|
|
||||||
ad_only_seleted_scripts = opts.data.get("ad_only_seleted_scripts", True)
|
ad_only_seleted_scripts = opts.data.get("ad_only_seleted_scripts", True)
|
||||||
if not ad_only_seleted_scripts:
|
if not ad_only_seleted_scripts:
|
||||||
return script_runner, script_args
|
return script_runner, script_args
|
||||||
|
|
||||||
default = "dynamic_prompting,dynamic_thresholding,wildcards,wildcard_recursive"
|
ad_script_names = opts.data.get("ad_script_names", SCRIPT_DEFAULT)
|
||||||
ad_script_names = opts.data.get("ad_script_names", default)
|
|
||||||
script_names_set = {
|
script_names_set = {
|
||||||
name
|
name
|
||||||
for script_name in ad_script_names.split(",")
|
for script_name in ad_script_names.split(",")
|
||||||
@@ -283,7 +286,6 @@ class AfterDetailerScript(scripts.Script):
|
|||||||
}
|
}
|
||||||
|
|
||||||
if args.ad_controlnet_model != "None":
|
if args.ad_controlnet_model != "None":
|
||||||
self.disable_controlnet_units(script_args)
|
|
||||||
script_names_set.add("controlnet")
|
script_names_set.add("controlnet")
|
||||||
|
|
||||||
filtered_alwayson = []
|
filtered_alwayson = []
|
||||||
@@ -562,7 +564,7 @@ def on_ui_settings():
|
|||||||
shared.opts.add_option(
|
shared.opts.add_option(
|
||||||
"ad_script_names",
|
"ad_script_names",
|
||||||
shared.OptionInfo(
|
shared.OptionInfo(
|
||||||
default="dynamic_prompting,dynamic_thresholding,wildcards,wildcard_recursive",
|
default=SCRIPT_DEFAULT,
|
||||||
label="Script names to apply to ADetailer (separated by comma)",
|
label="Script names to apply to ADetailer (separated by comma)",
|
||||||
component=gr.Textbox,
|
component=gr.Textbox,
|
||||||
component_args=textbox_args,
|
component_args=textbox_args,
|
||||||
|
|||||||
Reference in New Issue
Block a user