aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-03-11 08:45:31 +0000
committerGitHub <noreply@github.com>2023-03-11 08:45:31 +0000
commita11ce2b96cc933ebb9e10d46603a89457ddcb9df (patch)
tree4c9efccb08f591e3a27b7dab6e39ce4adab17bab /scripts
parent0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8 (diff)
parent5fef67f6ee949a61826a3a043ea8610fd89fc371 (diff)
downloadstable-diffusion-webui-gfx803-a11ce2b96cc933ebb9e10d46603a89457ddcb9df.tar.gz
stable-diffusion-webui-gfx803-a11ce2b96cc933ebb9e10d46603a89457ddcb9df.tar.bz2
stable-diffusion-webui-gfx803-a11ce2b96cc933ebb9e10d46603a89457ddcb9df.zip
Merge pull request #7710 from space-nuko/unipc
Implement UniPC sampler
Diffstat (limited to 'scripts')
-rw-r--r--scripts/xyz_grid.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/xyz_grid.py b/scripts/xyz_grid.py
index 53511b12..8e822e16 100644
--- a/scripts/xyz_grid.py
+++ b/scripts/xyz_grid.py
@@ -128,6 +128,10 @@ def apply_styles(p: StableDiffusionProcessingTxt2Img, x: str, _):
p.styles.extend(x.split(','))
+def apply_uni_pc_order(p, x, xs):
+ opts.data["uni_pc_order"] = min(x, p.steps - 1)
+
+
def format_value_add_label(p, opt, x):
if type(x) == float:
x = round(x, 8)
@@ -205,6 +209,7 @@ axis_options = [
AxisOptionImg2Img("Cond. Image Mask Weight", float, apply_field("inpainting_mask_weight")),
AxisOption("VAE", str, apply_vae, cost=0.7, choices=lambda: list(sd_vae.vae_dict)),
AxisOption("Styles", str, apply_styles, choices=lambda: list(shared.prompt_styles.styles)),
+ AxisOption("UniPC Order", int, apply_uni_pc_order, cost=0.5),
]
@@ -316,9 +321,11 @@ class SharedSettingsStackHelper(object):
def __enter__(self):
self.CLIP_stop_at_last_layers = opts.CLIP_stop_at_last_layers
self.vae = opts.sd_vae
+ self.uni_pc_order = opts.uni_pc_order
def __exit__(self, exc_type, exc_value, tb):
opts.data["sd_vae"] = self.vae
+ opts.data["uni_pc_order"] = self.uni_pc_order
modules.sd_models.reload_model_weights()
modules.sd_vae.reload_vae_weights()