stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

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

Open A2Sumie opened this issue 3 years ago • 1 comments

Describe the bug Through alternative prompts, I'm trying to add blank prompts ~~to allow prompts being skipped randomly~~Misunderstood 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):

  • OS: Windows
  • Browser MS Edge
  • Commit revision c8045c5ad4f99deb3a19add06e0457de1df62b05 Additional context Error output as follows. `Error completing request Arguments: ('[||]', '', 'None', 'None', 60, 0, False, False, 1, 1, 11, -1.0, -1.0, 0, 0, 0, False, 832, 512, True, 0.8, 0, 0, 0, False, False, None, '', 1, '', 0, '', True, False, False) {} Traceback (most recent call last): File "C:\STDF\stable-diffusion-webui\modules\prompt_parser.py", line 74, in alternate yield next(args[(step - 1)%len(args)]) StopIteration

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 avatar Oct 17 '22 10:10 A2Sumie

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

A2Sumie avatar Oct 17 '22 10:10 A2Sumie

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

MalfreCryvertia avatar Apr 22 '23 13:04 MalfreCryvertia

Closing as stale.

catboxanon avatar Aug 03 '23 16:08 catboxanon