Fixed disable negative prompts

Fixes #167
pull/200/head v2.2.3
Adi Eyal 2023-01-08 20:59:37 +02:00
parent 8866f0dea0
commit defdf8a927
2 changed files with 9 additions and 4 deletions

View File

@ -1,3 +1,4 @@
- 2.2.3 Fixed disable negative prompts - see [#167](https://github.com/adieyal/sd-dynamic-prompts/issues/167)
- 2.2.2 Fixed missing whitespace between wildcards
- 2.2.1 Fixed unlink seed from prompt bug - see [#150](https://github.com/adieyal/sd-dynamic-prompts/issues/150#issuecomment-1374847700)
- 2.2.0 Added option in advanced settings to save the raw prompt in the png metadata

View File

@ -43,7 +43,7 @@ if wildcard_dir is None:
else:
WILDCARD_DIR = Path(wildcard_dir)
VERSION = "2.2.2"
VERSION = "2.2.3"
wildcard_manager = WildcardManager(WILDCARD_DIR)
@ -297,11 +297,15 @@ class Script(scripts.Script):
)
all_prompts = generator.generate(original_prompt, num_images)
all_negative_prompts = generator.generate(
original_negative_prompt, num_images
)
total_prompts = len(all_prompts)
if disable_negative_prompt:
all_negative_prompts = [""]
else:
all_negative_prompts = generator.generate(
original_negative_prompt, num_images
)
if len(all_negative_prompts) < total_prompts:
all_negative_prompts = all_negative_prompts * (
total_prompts // len(all_negative_prompts) + 1