aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLeon Feng <523684+leon0707@users.noreply.github.com>2023-07-18 08:24:14 +0000
committerGitHub <noreply@github.com>2023-07-18 08:24:14 +0000
commita3730bd9becd2f1f5d209885b694b0dec178d110 (patch)
tree8ac9948d89606f7519df786f07f6ddb93c3d2720 /scripts
parentd6668347c8b85b11b696ac56777cc396e34ee1f9 (diff)
parent871b8687a82bb2ca907d8a49c87aed7635b8fc33 (diff)
downloadstable-diffusion-webui-gfx803-a3730bd9becd2f1f5d209885b694b0dec178d110.tar.gz
stable-diffusion-webui-gfx803-a3730bd9becd2f1f5d209885b694b0dec178d110.tar.bz2
stable-diffusion-webui-gfx803-a3730bd9becd2f1f5d209885b694b0dec178d110.zip
Merge branch 'dev' into fix-11805
Diffstat (limited to 'scripts')
-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)),
]