aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-07-17 15:56:34 +0300
committerGitHub <noreply@github.com>2023-07-17 15:56:34 +0300
commitf97e35929bece737ed00ebf34c6c528158af9801 (patch)
tree4ce1418dd9a5d9dd0b337b131875b8303a5e4ef8
parent2164578738edba6f56c4e95409c56f9ccef442e0 (diff)
parent8941297ceb3e71fa16fd842b135786b0ebc1b2b1 (diff)
Merge pull request #11824 from AUTOMATIC1111/XYZ-always_discard_next_to_last_sigma
XYZ always_discard_next_to_last_sigma
-rw-r--r--scripts/xyz_grid.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/scripts/xyz_grid.py b/scripts/xyz_grid.py
index 7821cc65..1010845e 100644
--- a/scripts/xyz_grid.py
+++ b/scripts/xyz_grid.py
@@ -144,11 +144,20 @@ def apply_face_restore(p, opt, x):
p.restore_faces = is_active
-def apply_override(field):
+def apply_override(field, boolean: bool = False):
def fun(p, x, xs):
+ if boolean:
+ x = True if x.lower() == "true" else False
p.override_settings[field] = x
return fun
+
+def boolean_choice(reverse: bool = False):
+ def choice():
+ return ["False", "True"] if reverse else ["True", "False"]
+ return choice
+
+
def format_value_add_label(p, opt, x):
if type(x) == float:
x = round(x, 8)
@@ -235,6 +244,7 @@ axis_options = [
AxisOption("Face restore", str, apply_face_restore, format_value=format_value),
AxisOption("Token merging ratio", float, apply_override('token_merging_ratio')),
AxisOption("Token merging ratio high-res", float, apply_override('token_merging_ratio_hr')),
+ AxisOption("Always discard next-to-last sigma", str, apply_override('always_discard_next_to_last_sigma', boolean=True), choices=boolean_choice(reverse=True)),
]