Repository: stable-diffusion-webui
Issue: [Bug]: IndexError: list index out of range,use Script:prompts from file or textbox
Labels: bug-report

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

When I use "Script:prompts from file or textbox" And "ControlNet:batch,canny" to Generate Images,It always uses the first line of prompt text

### Steps to reproduce the problem

1.Select Tag: Text to images
2.Use ControlNet v1.1.238, arg: Enable, Control Type: Canny, Batch then Input Directory(images)
3.Use Script,Prompt from file or textbox,List of prompt inputs:
--prompt "anime minimalist, masterpiece, bestink splash,<lora:mo:0.5>,(1boy, male focus, solo, tattoo, abs, facial hair, black hair, muscular, chain, pectorals, nipples, short hair, nude, muscular male, bara, goatee, chest tattoo :0.6)" --negative_prompt "(worst quality, low quality:1.4), (realistic, lip, nose, tooth, rouge, lipstick, eyeshadow:1.0), (abs, muscular, rib:1.0), bad_prompt_version2-neg, badhandv4, easyNegative" 
--prompt "anime minimalist, masterpiece, bestink splash,<lora:mo:0.5>,(multiple boys, male focus, shirt, facial hair, short hair, black hair, beard, yellow shirt, brown hair, jacket, 6+boys :0.6)" --negative_prompt "(worst quality, low quality:1.4), (realistic, lip, nose, tooth, rouge, lipstick, eyeshadow:1.0), (abs, muscular, rib:1.0), bad_prompt_version2-neg, badhandv4, easyNegative" 
--prompt "anime minimalist, masterpiece, bestink splash,<lora:mo:0.5>,(tattoo, male focus, muscular male, muscular, bara, facial hair, pectorals, multiple boys, abs, nipples, large pectorals, navel, arm tattoo, beard, short hair, black hair, chest tattoo, topless male, mature male, shoulder tattoo, looking at viewer, jacket, closed mouth :0.6)" --negative_prompt "(worst quality, low quality:1.4), (realistic, lip, nose, tooth, rouge, lipstick, eyeshadow:1.0), (abs, muscular, rib:1.0), bad_prompt_version2-neg, badhandv4, easyNegative" 
--prompt "anime minimalist, masterpiece, bestink splash,<lora:mo:0.5>,(no humans, scenery, sky, cloud, outdoors, day, blue sky, sunlight, fence, building, wall, plant, shadow :0.6)" --negative_prompt "(worst quality, low quality:1.4), (realistic, lip, nose, tooth, rouge, lipstick, eyeshadow:1.0), (abs, muscular, rib:1.0), bad_prompt_version2-neg, badhandv4, easyNegative" 
4.Generate!
5.PNG info review:It always uses the first line of prompt text
ps. When I first used it, it was normal, but now it doesn't work anymore. After downloading it again, it works again, but the problem occurred again the second time I used it
<img width="927" alt="image" src="https://github.com/AUTOMATIC1111/stable-diffusion-webui/assets/135701214/5f7df122-2ad5-4d40-b051-2cd96c623808">


### What should have happened?

img1: uses the first line of prompt input text
img2: uses the second line of prompt input text
img3: uses the third line of prompt input text
...

### Version or Commit where the problem happens

V1.5.1

### What Python version are you running on ?

Python 3.10.x

### What platforms do you use to access the UI ?

Windows

### What device are you running WebUI on?

Nvidia GPUs (RTX 20 above)

### Cross attention optimization

xformers

### What browsers do you use to access the UI ?

_No response_

### Command Line Arguments

```Shell
No
```


### List of extensions

No

### Console logs

```Shell
No
```


### Additional information

_No response_