adieyal / sd-dynamic-prompts

A custom script for AUTOMATIC1111/stable-diffusion-webui to implement a tiny template language for random prompt generation
MIT License
2.01k stars 259 forks source link

Bug in dynamic_promting.py #513

Open freezerain opened 1 year ago

freezerain commented 1 year ago
Error running process: D:\Projects\SD Portrait Generator\stable-diffusion-webui\extensions\sd-dynamic-prompts\scripts\dynamic_prompting.py
Traceback (most recent call last):
  File "D:\Projects\SD Portrait Generator\stable-diffusion-webui\modules\scripts.py", line 451, in process
    script.process(p, *script_args)
  File "D:\Projects\SD Portrait Generator\stable-diffusion-webui\extensions\sd-dynamic-prompts\sd_dynamic_prompts\dynamic_prompting.py", line 478, in process
    all_prompts, all_negative_prompts = generate_prompts(
  File "D:\Projects\SD Portrait Generator\stable-diffusion-webui\extensions\sd-dynamic-prompts\sd_dynamic_prompts\helpers.py", line 93, in generate_prompts
    all_prompts = prompt_generator.generate(prompt, num_prompts, seeds=seeds) or [""]
  File "D:\Projects\SD Portrait Generator\stable-diffusion-webui\venv\lib\site-packages\dynamicprompts\generators\randomprompt.py", line 71, in generate
    prompts.append(next(iter(gen)))
StopIteration

I honestly dont care about this error much, just reporting my logs. I was running batch img2img upscale with ControlNet tiling model and Ultimate SD Upscaler script. My promt boxes were empty and 1 style with negative loras were chosen The style appends: [(CyberRealistic_Negative-neg:0.9):0.2], [(ng_deepnegative_v1_75t:0.9):0.2] Batch upscaling keepd working tho so looks like minor bug to me have a nice day

Woisek commented 1 year ago

I also want add to this, as I see issues for the last weeks now. It also seems to interfere with some other scripts sometimes, but idk. Here is my log after an empty prompt in txt2img and CN usage:

09:05:28-624454 ERROR Running script process: I:\Super SD 2.0\automatic\extensions\sd-dynamic-prompts\scripts\dynamic_prompting.py: StopIteration ┌───────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────┐ │ I:\Super SD 2.0\automatic\modules\scripts.py:389 in process │ │ │ │ 388 │ │ │ │ args = p.per_script_args.get(script.title(), p.script_args[script.args_f │ │ > 389 │ │ │ │ script.process(p, *args, **kwargs) │ │ 390 │ │ │ │ s.append(f'{script.title()}:{round(time.time()-t0, 2)}s') │ │ │ │ I:\Super SD 2.0\automatic\extensions\sd-dynamic-prompts\sd_dynamic_prompts\dynamic_prompting.py:478 in process │ │ │ │ 477 │ │ │ │ │ > 478 │ │ │ all_prompts, all_negative_prompts = generate_prompts( │ │ 479 │ │ │ │ generator, │ │ │ │ I:\Super SD 2.0\automatic\extensions\sd-dynamic-prompts\sd_dynamic_prompts\helpers.py:93 in generate_prompts │ │ │ │ 92 │ """ │ │ > 93 │ all_prompts = prompt_generator.generate(prompt, num_prompts, seeds=seeds) or [""] │ │ 94 │ │ │ │ I:\Super SD 2.0\automatic\venv\lib\site-packages\dynamicprompts\generators\randomprompt.py:71 in generate │ │ │ │ 70 │ │ │ │ self._context.rand.seed(seed) │ │ > 71 │ │ │ │ prompts.append(next(iter(gen))) │ │ 72 │ │ │ return prompts │ └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ StopIteration

Forevercyj commented 1 year ago

same error

piwawa commented 1 year ago

Same problem with me, my situation is in the process of using StableSR script like this:

image