diff options
author | victorca25 <41912303+victorca25@users.noreply.github.com> | 2022-10-09 12:11:22 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-09 12:11:22 +0000 |
commit | 53154ba10a2d4bf716046abec3da0eca91bcc001 (patch) | |
tree | eeed0b11b4e5cae7a441992b0ae07bfe65212413 /scripts/xy_grid.py | |
parent | ad4de819c43997f2666b5bad95301f5c37f9018e (diff) | |
parent | 9d1138e2940c4ddcd2685bcba12c7d407e9e0ec5 (diff) | |
download | stable-diffusion-webui-gfx803-53154ba10a2d4bf716046abec3da0eca91bcc001.tar.gz stable-diffusion-webui-gfx803-53154ba10a2d4bf716046abec3da0eca91bcc001.tar.bz2 stable-diffusion-webui-gfx803-53154ba10a2d4bf716046abec3da0eca91bcc001.zip |
Merge branch 'master' into esrgan_mod
Diffstat (limited to 'scripts/xy_grid.py')
-rw-r--r-- | scripts/xy_grid.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/scripts/xy_grid.py b/scripts/xy_grid.py index a8f53bef..c89ca1a9 100644 --- a/scripts/xy_grid.py +++ b/scripts/xy_grid.py @@ -10,7 +10,7 @@ import numpy as np import modules.scripts as scripts
import gradio as gr
-from modules import images
+from modules import images, hypernetwork
from modules.processing import process_images, Processed, get_correct_sampler
from modules.shared import opts, cmd_opts, state
import modules.shared as shared
@@ -80,8 +80,7 @@ def apply_checkpoint(p, x, xs): def apply_hypernetwork(p, x, xs):
- hn = shared.hypernetworks.get(x, None)
- opts.data["sd_hypernetwork"] = hn.name if hn is not None else 'None'
+ hypernetwork.load_hypernetwork(x)
def format_value_add_label(p, opt, x):
@@ -203,8 +202,6 @@ class Script(scripts.Script): p.batch_size = 1
- initial_hn = opts.sd_hypernetwork
-
def process_axis(opt, vals):
if opt.label == 'Nothing':
return [0]
@@ -262,6 +259,7 @@ class Script(scripts.Script): # Confirm options are valid before starting
if opt.label == "Sampler":
+ samplers_dict = build_samplers_dict(p)
for sampler_val in valslist:
if sampler_val.lower() not in samplers_dict.keys():
raise RuntimeError(f"Unknown sampler: {sampler_val}")
@@ -321,6 +319,6 @@ class Script(scripts.Script): # restore checkpoint in case it was changed by axes
modules.sd_models.reload_model_weights(shared.sd_model)
- opts.data["sd_hypernetwork"] = initial_hn
+ hypernetwork.load_hypernetwork(opts.sd_hypernetwork)
return processed
|