Repository: stable-diffusion-webui
Issue: [Bug]: Stable diffusion stops generating if left alone a certain time [circumvented]
Labels: not-an-issue

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

I run SD from an external HDD
Leaving SD in continuous generation overnight produced less than expected images. It turns out it gets "frozen" at some point and stops generating new batches. If I unlock the screen in the morning, it suddenly starts to make new batches and laptop fans start cooling (prior to unlock, it is not doing anything).
I already asked in SD discord, tech help discord, etc and they told me to change powerplan and suspension settings in windows and to set SD processes priorities to high, above normal and real time in task manager. None of that worked.

### Steps to reproduce the problem


1. Open Stable diffusion webui
2. Set parameters for a generation (I used randomizer plugin, hires fix and wildcards; but I don't think it is related)
3. Click on generate forever
4. Measure the time for each batch of images generated
5. Wait 5+ hours
6. You will notice fans are off and the computer is not doing anything apparently. Unlocking it will cause generate forever to resume.
7. Compare the number of batches you got with the number you would expect for all the time you left SD on. You should get less than 33% the expected number of batches.

### What should have happened?

Generation should not have stopped.

### Commit where the problem happens

22bcc7be428c94e9408f589966c2040187245d81

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

Windows

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

Microsoft Edge

### Command Line Arguments

```Shell
set COMMANDLINE_ARGS=--deepdanbooru --medvram --xformers --api --cors-allow-origins=http://127.0.0.1:3456 --no-half-vae --skip-install
```


### List of extensions

https://github.com/guzuligo/CFG-Schedule-for-Automatic1111-SD.git
https://github.com/aria1th/Hypernetwork-MonkeyPatch-Extension.git
SD webui civitai helper
https://github.com/KohakuBlueleaf/a1111-sd-webui-locon.git
https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git
https://github.com/space-nuko/a1111-stable-diffusion-webui-vram-estimator.git
https://github.com/brick2face/corridor-crawler-outpainting.git
https://github.com/s9roll7/ebsynth_utility.git
https://github.com/LonicaMewinsky/gif2gif
https://github.com/fropych/mine-diffusion.git
https://github.com/Extraltodeus/multi-subject-render
https://github.com/zero01101/openOutpaint-webUI-extension
https://github.com/adieyal/sd-dynamic-prompts.git
https://github.com/vladmandic/sd-extension-aesthetic-scorer.git
https://github.com/vladmandic/sd-extension-steps-animation.git
https://github.com/mcmonkeyprojects/sd-infinity-grid-generator-script.git
https://github.com/kohya-ss/sd-webui-additional-networks.git
https://github.com/Mikubill/sd-webui-controlnet
https://github.com/antis0007/sd-webui-multiple-hypernetworks.git
https://github.com/d8ahazard/sd_dreambooth_extension
https://github.com/yownas/seed_travel.git
https://github.com/p1atdev/stable-diffusion-webui-cafe-aesthetic.git
https://github.com/Klace/stable-diffusion-webui-pix2pix (disabled)
https://github.com/AUTOMATIC1111/stable-diffusion-webui-promptgen.git
https://github.com/innightwolfsleep/stable-diffusion-webui-randomize
https://github.com/Kahsolt/stable-diffusion-webui-sonar.git
https://github.com/AUTOMATIC1111/stable-diffusion-webui-wildcards
https://github.com/Coyote-A/ultimate-upscale-for-automatic1111.git
https://github.com/ThereforeGames/unprompted.git
https://github.com/fishslot/video_loopback_for_webui

### Console logs

```Shell
This problem is not reflected on logs, the cmd progress just gets frozen until you unlock the computer.
```


### Additional information

It must happen when it finishes a batch since, when unlocking, SD is always at the step in which it is at 0% in cmd and doesn't display a progress number in the webui interface, which happens between batches.

I found a way to circumvent this issue by downloading at extremely low speed a torrent to the same drive SD is running in. This makes SD go on and not stop. Other ways to force the disk to do tasks overnight should work too. Nevertheless, a bug.

I updated to latest commit (5ab7f213bec2f816f9c5644becb32eb72c8ffb89). I'll check if it still happens here.