diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-10-09 11:33:22 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-10-09 11:33:22 +0000 |
commit | 542a3d3a4a00c1383fbdaf938ceefef87cf834bb (patch) | |
tree | 90a5da1db886eb2c09e75075add56c2d2de774f4 /scripts/xy_grid.py | |
parent | 77a719648db515f10136e8b8483d5b16bda2eaeb (diff) | |
download | stable-diffusion-webui-gfx803-542a3d3a4a00c1383fbdaf938ceefef87cf834bb.tar.gz stable-diffusion-webui-gfx803-542a3d3a4a00c1383fbdaf938ceefef87cf834bb.tar.bz2 stable-diffusion-webui-gfx803-542a3d3a4a00c1383fbdaf938ceefef87cf834bb.zip |
fix btoken hypernetworks in XY plot
Diffstat (limited to 'scripts/xy_grid.py')
-rw-r--r-- | scripts/xy_grid.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/scripts/xy_grid.py b/scripts/xy_grid.py index a8f53bef..fe949067 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]
@@ -321,6 +318,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
|