diff options
author | DepFA <35278260+dfaker@users.noreply.github.com> | 2022-10-11 10:59:56 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-11 10:59:56 +0000 |
commit | 1a0a6a84c3149e236211d547471f5416cd1129f3 (patch) | |
tree | abccaea0e1db9eb5e7ec99c093871029e19f9980 /scripts/xy_grid.py | |
parent | a8490e4019c359ff24824e004059744d7164361b (diff) | |
download | stable-diffusion-webui-gfx803-1a0a6a84c3149e236211d547471f5416cd1129f3.tar.gz stable-diffusion-webui-gfx803-1a0a6a84c3149e236211d547471f5416cd1129f3.tar.bz2 stable-diffusion-webui-gfx803-1a0a6a84c3149e236211d547471f5416cd1129f3.zip |
add incorrect start word guard to xy_grid (#2259)
Diffstat (limited to 'scripts/xy_grid.py')
-rw-r--r-- | scripts/xy_grid.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/scripts/xy_grid.py b/scripts/xy_grid.py index 99b3c4f6..9d4d6187 100644 --- a/scripts/xy_grid.py +++ b/scripts/xy_grid.py @@ -27,17 +27,12 @@ def apply_field(field): def apply_prompt(p, x, xs):
-
- orig_prompt = p.prompt
- orig_negative_prompt = p.negative_prompt
+ 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)
- if p.prompt == orig_prompt and p.negative_prompt == orig_negative_prompt:
- pass
- #raise RuntimeError(f"Prompt S/R did not find {xs[0]} in prompt or negative prompt. Did you forget to add the token?")
-
def apply_order(p, x, xs):
token_order = []
|