aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/xy_grid.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/xy_grid.py b/scripts/xy_grid.py
index 6344e612..c0c364df 100644
--- a/scripts/xy_grid.py
+++ b/scripts/xy_grid.py
@@ -77,6 +77,11 @@ def apply_checkpoint(p, x, xs):
modules.sd_models.reload_model_weights(shared.sd_model, info)
+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'
+
+
def format_value_add_label(p, opt, x):
if type(x) == float:
x = round(x, 8)
@@ -122,6 +127,7 @@ axis_options = [
AxisOption("Prompt order", str_permutations, apply_order, format_value_join_list),
AxisOption("Sampler", str, apply_sampler, format_value),
AxisOption("Checkpoint name", str, apply_checkpoint, format_value),
+ AxisOption("Hypernetwork", str, apply_hypernetwork, format_value),
AxisOption("Sigma Churn", float, apply_field("s_churn"), format_value_add_label),
AxisOption("Sigma min", float, apply_field("s_tmin"), format_value_add_label),
AxisOption("Sigma max", float, apply_field("s_tmax"), format_value_add_label),
@@ -193,6 +199,8 @@ class Script(scripts.Script):
modules.processing.fix_seed(p)
p.batch_size = 1
+ initial_hn = opts.sd_hypernetwork
+
def process_axis(opt, vals):
if opt.label == 'Nothing':
return [0]
@@ -300,4 +308,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
+
return processed