diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-07-18 15:20:22 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-07-18 15:20:22 +0000 |
commit | eb7c9b58fc2fbab205d4bc9f708800870dcda3fb (patch) | |
tree | 337bc9e4e6793aa072c2e2a8c10e3a3f7daf6a95 /scripts/xyz_grid.py | |
parent | f865d3e11647dfd6c7b2cdf90dde24680e58acd8 (diff) | |
parent | 7f7db1700bda40ba3171a49b6a4ef38f868b7d0a (diff) | |
download | stable-diffusion-webui-gfx803-eb7c9b58fc2fbab205d4bc9f708800870dcda3fb.tar.gz stable-diffusion-webui-gfx803-eb7c9b58fc2fbab205d4bc9f708800870dcda3fb.tar.bz2 stable-diffusion-webui-gfx803-eb7c9b58fc2fbab205d4bc9f708800870dcda3fb.zip |
Merge branch 'dev' into release_candidate
Diffstat (limited to 'scripts/xyz_grid.py')
-rw-r--r-- | scripts/xyz_grid.py | 12 |
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)),
]
|