diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2022-10-12 10:35:42 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-12 10:35:42 +0300 |
commit | dc1432e0dd2b826bbf5aee3e87d8270c151e4912 (patch) | |
tree | 276c27910e8ec38a1a054df02c67f73a84cb35df /scripts/xy_grid.py | |
parent | 1d64976dbc5a0f3124567b91fadd5014a9d93c5f (diff) | |
parent | ca5efc316b9431746ff886d259275310f63f95fb (diff) |
Merge branch 'master' into feature/scale_to
Diffstat (limited to 'scripts/xy_grid.py')
-rw-r--r-- | scripts/xy_grid.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/scripts/xy_grid.py b/scripts/xy_grid.py index 771eb8e4..ef431105 100644 --- a/scripts/xy_grid.py +++ b/scripts/xy_grid.py @@ -10,7 +10,8 @@ import numpy as np import modules.scripts as scripts
import gradio as gr
-from modules import images, hypernetwork
+from modules import images
+from modules.hypernetworks import hypernetwork
from modules.processing import process_images, Processed, get_correct_sampler
from modules.shared import opts, cmd_opts, state
import modules.shared as shared
@@ -27,6 +28,9 @@ def apply_field(field): def apply_prompt(p, x, xs):
+ if xs[0] not in p.prompt and xs[0] not in p.negative_prompt:
+ raise RuntimeError(f"Prompt S/R did not find {xs[0]} in prompt or negative prompt.")
+
p.prompt = p.prompt.replace(xs[0], x)
p.negative_prompt = p.negative_prompt.replace(xs[0], x)
@@ -193,7 +197,7 @@ class Script(scripts.Script): x_values = gr.Textbox(label="X values", visible=False, lines=1)
with gr.Row():
- y_type = gr.Dropdown(label="Y type", choices=[x.label for x in current_axis_options], value=current_axis_options[4].label, visible=False, type="index", elem_id="y_type")
+ y_type = gr.Dropdown(label="Y type", choices=[x.label for x in current_axis_options], value=current_axis_options[0].label, visible=False, type="index", elem_id="y_type")
y_values = gr.Textbox(label="Y values", visible=False, lines=1)
draw_legend = gr.Checkbox(label='Draw legend', value=True)
@@ -205,7 +209,10 @@ class Script(scripts.Script): if not no_fixed_seeds:
modules.processing.fix_seed(p)
- p.batch_size = 1
+ if not opts.return_grid:
+ p.batch_size = 1
+
+
CLIP_stop_at_last_layers = opts.CLIP_stop_at_last_layers
def process_axis(opt, vals):
|