AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
141.8k stars 26.79k forks source link

Alternative Prompts:Intended "[|" or "||" or "|]" fails generate. #2944

Closed A2Sumie closed 1 year ago

A2Sumie commented 2 years ago

Describe the bug Through alternative prompts, I'm trying to add blank prompts to allow prompts being skipped randomlyMisunderstood the feature yet this is a bug. However [| or || or |] would fail generate. Considered a bug because using a space like [ | seems fixing the problem yet I'm not sure if this works as desired. Alternative Prompts is nevertheless a lottery thing and needs some large batch to test. To Reproduce Steps to reproduce the behavior:

  1. Enter "[|" or "||" or "|]" in prompt.
  2. Click on 'Generate.'
  3. See error, outputs attached

Expected behavior A blank prompt would be randomly chosen. I assume the [from::when] prompt is [from:to black prompt:when] so this should be similar?

Desktop (please complete the following information):

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\STDF\stable-diffusion-webui\venv\lib\site-packages\lark\visitors.py", line 116, in _call_userfunc return f(children) File "C:\STDF\stable-diffusion-webui\modules\prompt_parser.py", line 82, in start return ''.join(flatten(args)) File "C:\STDF\stable-diffusion-webui\modules\prompt_parser.py", line 81, in flatten yield from flatten(gen) File "C:\STDF\stable-diffusion-webui\modules\prompt_parser.py", line 80, in flatten for gen in x: File "C:\STDF\stable-diffusion-webui\modules\prompt_parser.py", line 87, in default yield from child RuntimeError: generator raised StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\STDF\stable-diffusion-webui\modules\ui.py", line 212, in f res = list(func(*args, *kwargs)) File "C:\STDF\stable-diffusion-webui\webui.py", line 64, in f res = func(args, **kwargs) File "C:\STDF\stable-diffusion-webui\modules\txt2img.py", line 44, in txt2img processed = process_images(p) File "C:\STDF\stable-diffusion-webui\modules\processing.py", line 393, in process_images c = prompt_parser.get_multicond_learned_conditioning(shared.sd_model, prompts, p.steps) File "C:\STDF\stable-diffusion-webui\modules\prompt_parser.py", line 203, in get_multicond_learned_conditioning learned_conditioning = get_learned_conditioning(model, prompt_flat_list, steps) File "C:\STDF\stable-diffusion-webui\modules\prompt_parser.py", line 127, in get_learned_conditioning prompt_schedules = get_learned_conditioning_prompt_schedules(prompts, steps) File "C:\STDF\stable-diffusion-webui\modules\prompt_parser.py", line 100, in get_learned_conditioning_prompt_schedules promptdict = {prompt: get_schedule(prompt) for prompt in set(prompts)} File "C:\STDF\stable-diffusion-webui\modules\prompt_parser.py", line 100, in promptdict = {prompt: get_schedule(prompt) for prompt in set(prompts)} File "C:\STDF\stable-diffusion-webui\modules\prompt_parser.py", line 98, in get_schedule return [[t, at_step(t, tree)] for t in collect_steps(steps, tree)] File "C:\STDF\stable-diffusion-webui\modules\prompt_parser.py", line 98, in return [[t, at_step(t, tree)] for t in collect_steps(steps, tree)] File "C:\STDF\stable-diffusion-webui\modules\prompt_parser.py", line 88, in at_step return AtStep().transform(tree) File "C:\STDF\stable-diffusion-webui\venv\lib\site-packages\lark\visitors.py", line 153, in transform return self._transform_tree(tree) File "C:\STDF\stable-diffusion-webui\venv\lib\site-packages\lark\visitors.py", line 149, in _transform_tree return self._call_userfunc(tree, children) File "C:\STDF\stable-diffusion-webui\venv\lib\site-packages\lark\visitors.py", line 120, in _call_userfunc raise VisitError(tree.data, tree, e) lark.exceptions.VisitError: Error trying to process rule "start":

generator raised StopIteration `

A2Sumie commented 2 years ago

I misunderstood Alternative Prompts badly but this should still be a bug.

MalfreCryvertia commented 1 year ago

is this still not fixed or at least addressed to by someone?

catboxanon commented 1 year ago

Closing as stale.