diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-07-25 05:18:02 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-07-25 05:18:02 +0000 |
commit | a3ddf464a2ed24c999f67ddfef7969f8291567be (patch) | |
tree | cf70006b4d1d6df1f42ea944416b1034ae32a92b /scripts/xyz_grid.py | |
parent | f865d3e11647dfd6c7b2cdf90dde24680e58acd8 (diff) | |
parent | 2c11e9009ea18bab4ce2963d44db0c6fd3227370 (diff) | |
download | stable-diffusion-webui-gfx803-a3ddf464a2ed24c999f67ddfef7969f8291567be.tar.gz stable-diffusion-webui-gfx803-a3ddf464a2ed24c999f67ddfef7969f8291567be.tar.bz2 stable-diffusion-webui-gfx803-a3ddf464a2ed24c999f67ddfef7969f8291567be.zip |
Merge branch '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)),
]
|