Repository: stable-diffusion-webui
Issue: [Bug]: Random freezing occurs when user interrupting the generation process
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?

In the event that a user decides to abort an unfinished image generation process, there is a certain probability that the program will freeze:

 **After pressing "interrupt", the generation is paused, but the GPU and VRAM remain in a high-utilization state. The console window may display either incomplete or complete status, and there's no error in the log, but at this point, the web interface is frozen, preventing further actions. The only option at this point is to close the backend, keep awaiting is not likely to make difference.**

When this situation occurs, likes, when the user presses "Interrupt" and the program freezes, the web interface will not show any further changes apart from the progress suspending. Subsequently, when the user closes the console window, the web interface, will display "Connection errored out" as usual, and the "Interrupt" button will revert back to the "Generate" button.

This bug has been present since early versions, occurred infrequently in recent versions, and resurfaced after 1.6 versions. (this is subject to verification).

### Steps to reproduce the problem

1. Generate an image.
2. Press "Interrupt" before the generation is finished.
3. There'll be a slight chance of freezing.

The occurrence probability of this issue is not too high; it may take dozens to hundreds of repetitions to reproduce. In cases of bad luck, the freeze may occur on the first attempt at such an operation.

My guess is that it may be related to the workload, and this issue is more likely to occur in when generating high resolution images, or using i2i mode, or using ControlNet. 

It's also not due to setting parameters too high, causing the workload to far exceed the device's capabilities. Instead, it just happens occasionally during normal generations.

### What should have happened?

Ideally, the program should not freeze and stop generating immediately after the user has pressed the Interrupt button.

### Sysinfo

[sysinfo-2023-10-04-16-39.txt](https://github.com/AUTOMATIC1111/stable-diffusion-webui/files/12805996/sysinfo-2023-10-04-16-39.txt)


### What browsers do you use to access the UI ?

Microsoft Edge

### Console logs

```Shell
venv "C:\Users\Aeka0\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec  6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)]
Version: v1.6.0
Commit hash: 5ef669de080814067961f28357256e8fe27544f4
Launching Web UI with arguments: --deepdanbooru --xformers --no-half-vae
=================================================================================
You are running xformers 0.0.17.
The program is tested to work with xformers 0.0.20.
To reinstall the desired version, run with commandline flag --reinstall-xformers.

Use --skip-version-check commandline argument to disable this check.
=================================================================================
Tag Autocomplete: Could not locate model-keyword extension, Lora trigger word completion will be limited to those added through the extra networks menu.
2023-10-05 00:25:37,519 - ControlNet - INFO - ControlNet v1.1.410
ControlNet preprocessor location: C:\Users\Aeka0\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads
2023-10-05 00:25:37,607 - ControlNet - INFO - ControlNet v1.1.410
Loading weights [6292dd40d6] from C:\Users\Aeka0\stable-diffusion-webui\models\Stable-diffusion\meinapastel_v6Pastel.safetensors
Creating model from config: C:\Users\Aeka0\stable-diffusion-webui\configs\v1-inference.yaml
Loading VAE weights specified in settings: C:\Users\Aeka0\stable-diffusion-webui\models\VAE\normal.vae.pt
Applying attention optimization: xformers... done.
Model loaded in 5.2s (load weights from disk: 0.8s, create model: 0.3s, apply weights to model: 1.5s, apply half(): 1.0s, load VAE: 0.6s, calculate empty prompt: 0.9s).
fatal: unable to access 'https://github.com/zero01101/openOutpaint.git/': Recv failure: Connection was reset
fatal: Unable to fetch in submodule path 'app'
[openOutpaint-extension-submodule] failed to download update, check network
2023-10-05 00:26:01,567 - ControlNetFastload - INFO - Load Controlnet Fastload Filter on isRemote=None and accessLevel=2
C:\Users\Aeka0\stable-diffusion-webui\extensions\stable-diffusion-webui-dataset-tag-editor\scripts\main.py:218: GradioDeprecationWarning: The `style` method is deprecated. Please set these arguments in the constructor instead.
  with gr.Row().style(equal_height=False):
C:\Users\Aeka0\stable-diffusion-webui\extensions\stable-diffusion-webui-dataset-tag-editor\scripts\tag_editor_ui\block_dataset_gallery.py:25: GradioDeprecationWarning: The `style` method is deprecated. Please set these arguments in the constructor instead.
  self.gl_dataset_images = gr.Gallery(label='Dataset Images', elem_id="dataset_tag_editor_dataset_gallery").style(grid=image_columns)
C:\Users\Aeka0\stable-diffusion-webui\extensions\stable-diffusion-webui-dataset-tag-editor\scripts\tag_editor_ui\block_dataset_gallery.py:25: GradioDeprecationWarning: The 'grid' parameter will be deprecated. Please use 'columns' in the constructor instead.
  self.gl_dataset_images = gr.Gallery(label='Dataset Images', elem_id="dataset_tag_editor_dataset_gallery").style(grid=image_columns)
C:\Users\Aeka0\stable-diffusion-webui\extensions\stable-diffusion-webui-dataset-tag-editor\scripts\tag_editor_ui\tab_filter_by_selection.py:35: GradioDeprecationWarning: The `style` method is deprecated. Please set these arguments in the constructor instead.
  self.gl_filter_images = gr.Gallery(label='Filter Images', elem_id="dataset_tag_editor_filter_gallery").style(grid=image_columns)
C:\Users\Aeka0\stable-diffusion-webui\extensions\stable-diffusion-webui-dataset-tag-editor\scripts\tag_editor_ui\tab_filter_by_selection.py:35: GradioDeprecationWarning: The 'grid' parameter will be deprecated. Please use 'columns' in the constructor instead.
  self.gl_filter_images = gr.Gallery(label='Filter Images', elem_id="dataset_tag_editor_filter_gallery").style(grid=image_columns)
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
  0%|                                                                                           | 0/22 [00:00<?, ?it/s]Startup time: 48.3s (prepare environment: 13.4s, import torch: 3.1s, import gradio: 1.2s, setup paths: 0.7s, initialize shared: 0.3s, other imports: 0.7s, setup codeformer: 0.3s, load scripts: 2.4s, create ui: 23.5s, gradio launch: 2.8s).
100%|██████████████████████████████████████████████████████████████████████████████████| 22/22 [00:04<00:00,  5.27it/s]
Total prTile 1/1548%|███████████████████████████████▍                                  | 20/42 [00:05<00:01, 12.90it/s]
        Tile 2/15
        Tile 3/15
        Tile 4/15
        Tile 5/15
        Tile 6/15
        Tile 7/15
        Tile 8/15
        Tile 9/15
        Tile 10/15
        Tile 11/15
        Tile 12/15
        Tile 13/15
        Tile 14/15
        Tile 15/15
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:02<00:00,  9.82it/s]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 42/42 [00:08<00:00,  4.77it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 22/22 [00:01<00:00, 16.66it/s]
Total prTile 1/1548%|███████████████████████████████▍                                  | 20/42 [00:01<00:01, 18.54it/s]
        Tile 2/15
        Tile 3/15
        Tile 4/15
        Tile 5/15
        Tile 6/15
        Tile 7/15
        Tile 8/15
        Tile 9/15
        Tile 10/15
        Tile 11/15
        Tile 12/15
        Tile 13/15
        Tile 14/15
        Tile 15/15
  0%|                                                                                           | 0/20 [00:00<?, ?it/s]
Total progress:  52%|██████████████████████████████████▌                               | 22/42 [00:02<00:02,  9.38it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 22/22 [00:01<00:00, 16.95it/s]
Total prTile 1/1548%|███████████████████████████████▍                                  | 20/42 [00:01<00:01, 17.87it/s]
        Tile 2/15
        Tile 3/15
        Tile 4/15
        Tile 5/15
        Tile 6/15
        Tile 7/15
        Tile 8/15
        Tile 9/15
        Tile 10/15
        Tile 11/15
        Tile 12/15
        Tile 13/15
        Tile 14/15
        Tile 15/15
  0%|                                                                                           | 0/20 [00:00<?, ?it/s]
Total progress:  52%|██████████████████████████████████▌                               | 22/42 [00:02<00:02,  9.95it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 22/22 [00:01<00:00, 17.78it/s]
Total prTile 1/1548%|███████████████████████████████▍                                  | 20/42 [00:01<00:01, 16.23it/s]
        Tile 2/15
        Tile 3/15
        Tile 4/15
        Tile 5/15
        Tile 6/15
        Tile 7/15
        Tile 8/15
        Tile 9/15
        Tile 10/15
        Tile 11/15
        Tile 12/15
        Tile 13/15
        Tile 14/15
        Tile 15/15
  0%|                                                                                           | 0/20 [00:00<?, ?it/s]
Total progress:  52%|██████████████████████████████████▌                               | 22/42 [00:02<00:01, 10.20it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 22/22 [00:01<00:00, 19.73it/s]
Total prTile 1/1548%|███████████████████████████████▍                                  | 20/42 [00:01<00:01, 18.50it/s]
        Tile 2/15
        Tile 3/15
        Tile 4/15
        Tile 5/15
        Tile 6/15
        Tile 7/15
        Tile 8/15
        Tile 9/15
        Tile 10/15
        Tile 11/15
        Tile 12/15
        Tile 13/15
        Tile 14/15
        Tile 15/15
 40%|█████████████████████████████████▏                                                 | 8/20 [00:00<00:01,  9.64it/s]
Total progress:  71%|███████████████████████████████████████████████▏                  | 30/42 [00:03<00:01,  9.79it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 22/22 [00:01<00:00, 17.03it/s]
Total prTile 1/1550%|█████████████████████████████████                                 | 21/42 [00:01<00:01, 18.83it/s]
        Tile 2/15
        Tile 3/15
        Tile 4/15
        Tile 5/15
        Tile 6/15
        Tile 7/15
        Tile 8/15
        Tile 9/15
        Tile 10/15
        Tile 11/15
        Tile 12/15
        Tile 13/15
        Tile 14/15
        Tile 15/15
  0%|                                                                                           | 0/20 [00:00<?, ?it/s]
Total progress:  52%|██████████████████████████████████▌                               | 22/42 [00:02<00:02,  9.99it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 22/22 [00:01<00:00, 18.10it/s]
Total prTile 1/1550%|█████████████████████████████████                                 | 21/42 [00:01<00:01, 16.49it/s]
        Tile 2/15
        Tile 3/15
        Tile 4/15
        Tile 5/15
        Tile 6/15
        Tile 7/15
        Tile 8/15
        Tile 9/15
        Tile 10/15
        Tile 11/15
        Tile 12/15
        Tile 13/15
        Tile 14/15
        Tile 15/15
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:02<00:00,  7.79it/s]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 42/42 [00:04<00:00,  8.56it/s]
 18%|███████████████                                                                    | 4/22 [00:00<00:00, 19.25it/s]
Total prTile 1/1510%|██████▍                                                            | 4/42 [00:00<00:01, 19.07it/s]
        Tile 2/15
        Tile 3/15
        Tile 4/15
        Tile 5/15
        Tile 6/15
        Tile 7/15
        Tile 8/15
        Tile 9/15
        Tile 10/15
        Tile 11/15
        Tile 12/15
        Tile 13/15
        Tile 14/15
        Tile 15/15
  0%|                                                                                           | 0/20 [00:00<?, ?it/s]
Total progress:  10%|██████▍                                                            | 4/42 [00:01<00:10,  3.65it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 22/22 [00:01<00:00, 18.43it/s]
Total prTile 1/1552%|██████████████████████████████████▌                               | 22/42 [00:01<00:01, 18.10it/s]
        Tile 2/15
        Tile 3/15
        Tile 4/15
        Tile 5/15
        Tile 6/15
        Tile 7/15
        Tile 8/15
        Tile 9/15
        Tile 10/15
        Tile 11/15
        Tile 12/15
        Tile 13/15
        Tile 14/15
        Tile 15/15
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:02<00:00,  7.90it/s]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 42/42 [00:04<00:00,  9.02it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 22/22 [00:01<00:00, 19.52it/s]
Total prTile 1/1550%|█████████████████████████████████                                 | 21/42 [00:01<00:01, 18.46it/s]
        Tile 2/15
        Tile 3/15
        Tile 4/15
        Tile 5/15
        Tile 6/15
        Tile 7/15
        Tile 8/15
        Tile 9/15
        Tile 10/15
        Tile 11/15
        Tile 12/15
        Tile 13/15
        Tile 14/15
        Tile 15/15
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:02<00:00,  7.91it/s]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 42/42 [00:04<00:00,  9.03it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 22/22 [00:01<00:00, 19.20it/s]
Total prTile 1/1550%|█████████████████████████████████                                 | 21/42 [00:01<00:01, 18.10it/s]
        Tile 2/15
        Tile 3/15
        Tile 4/15
        Tile 5/15
        Tile 6/15
        Tile 7/15
        Tile 8/15
        Tile 9/15
        Tile 10/15
        Tile 11/15
        Tile 12/15
        Tile 13/15
        Tile 14/15
        Tile 15/15
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:02<00:00,  7.78it/s]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 42/42 [00:04<00:00,  8.50it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 22/22 [00:01<00:00, 18.12it/s]
Total prTile 1/1550%|█████████████████████████████████                                 | 21/42 [00:01<00:01, 16.77it/s]
        Tile 2/15
        Tile 3/15
        Tile 4/15
        Tile 5/15
        Tile 6/15
        Tile 7/15
        Tile 8/15
        Tile 9/15
        Tile 10/15
        Tile 11/15
        Tile 12/15
        Tile 13/15
        Tile 14/15
        Tile 15/15
 15%|████████████▍                                                                      | 3/20 [00:00<00:01,  9.60it/s]
Total progress:  60%|███████████████████████████████████████▎                          | 25/42 [00:02<00:01, 10.19it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 22/22 [00:01<00:00, 17.96it/s]
Total prTile 1/1550%|█████████████████████████████████                                 | 21/42 [00:01<00:01, 16.49it/s]
        Tile 2/15
        Tile 3/15
        Tile 4/15
        Tile 5/15
        Tile 6/15
        Tile 7/15
        Tile 8/15
        Tile 9/15
        Tile 10/15
        Tile 11/15
        Tile 12/15
        Tile 13/15
        Tile 14/15
        Tile 15/15
  0%|                                                                                           | 0/20 [00:00<?, ?it/s]
Total progress:  52%|██████████████████████████████████▌                               | 22/42 [00:02<00:01, 10.16it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 22/22 [00:01<00:00, 19.88it/s]
Total prTile 1/1550%|█████████████████████████████████                                 | 21/42 [00:01<00:01, 18.59it/s]
        Tile 2/15
        Tile 3/15
        Tile 4/15
        Tile 5/15
        Tile 6/15
        Tile 7/15
        Tile 8/15
        Tile 9/15
        Tile 10/15
        Tile 11/15
        Tile 12/15
        Tile 13/15
        Tile 14/15
        Tile 15/15
 15%|████████████▍                                                                      | 3/20 [00:00<00:01,  9.53it/s]
Total progress:  60%|███████████████████████████████████████▎                          | 25/42 [00:02<00:01, 10.47it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 22/22 [00:01<00:00, 18.13it/s]
Total prTile 1/1550%|█████████████████████████████████                                 | 21/42 [00:01<00:01, 16.59it/s]
        Tile 2/15
        Tile 3/15
        Tile 4/15
        Tile 5/15
        Tile 6/15
        Tile 7/15
        Tile 8/15
        Tile 9/15
        Tile 10/15
        Tile 11/15
        Tile 12/15
        Tile 13/15
        Tile 14/15
        Tile 15/15
 15%|████████████▍                                                                      | 3/20 [00:00<00:01,  9.23it/s]
Total progress:  60%|███████████████████████████████████████▎                          | 25/42 [00:02<00:01, 10.17it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 22/22 [00:01<00:00, 19.70it/s]
Total prTile 1/1552%|██████████████████████████████████▌                               | 22/42 [00:01<00:01, 17.93it/s]
        Tile 2/15
        Tile 3/15
        Tile 4/15
        Tile 5/15
        Tile 6/15
        Tile 7/15
        Tile 8/15
        Tile 9/15
        Tile 10/15
        Tile 11/15
        Tile 12/15
        Tile 13/15
        Tile 14/15
        Tile 15/15
  0%|                                                                                           | 0/20 [00:00<?, ?it/s]
Total progress:  52%|██████████████████████████████████▌                               | 22/42 [00:02<00:01, 10.82it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 22/22 [00:01<00:00, 16.68it/s]
Total prTile 1/1552%|██████████████████████████████████▌                               | 22/42 [00:01<00:01, 16.22it/s]
        Tile 2/15
        Tile 3/15
        Tile 4/15
        Tile 5/15
        Tile 6/15
        Tile 7/15
        Tile 8/15
        Tile 9/15
        Tile 10/15
        Tile 11/15
        Tile 12/15
        Tile 13/15
        Tile 14/15
        Tile 15/15
  5%|████▏                                                                              | 1/20 [00:00<00:01,  9.58it/s]
Total progress:  55%|████████████████████████████████████▏                             | 23/42 [00:02<00:02,  9.49it/s]
Total progress:  55%|████████████████████████████████████▏                             | 23/42 [00:02<00:01, 16.22it/s]
```


### Additional information

In the logs above, only the last generation process got stuck. The other unfinished ones are not problematic.