aboutsummaryrefslogtreecommitdiff
path: root/scripts/xyz_grid.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-07-19 07:59:39 +0300
committerGitHub <noreply@github.com>2023-07-19 07:59:39 +0300
commit0a334b447ff0c41519bb9e280050736913ad9cf8 (patch)
treee27963f76b7357ff0cb7b2c3fdcb720ab64f0e50 /scripts/xyz_grid.py
parent6094310704f4b3853bfa5d05d9c1ace58b2deee7 (diff)
parentc2b975485708791b29d44d79ee1a48d3abd838b7 (diff)
Merge branch 'dev' into allow-no-venv-install
Diffstat (limited to 'scripts/xyz_grid.py')
-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)),
]