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

[Bug]: Generation randomly hangs while applying Hires Fix, hogs all GPU memory

Open r0buster opened this issue 2 years ago • 2 comments

Is there an existing issue for this?

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

What happened?

When using the Hires. Fix, there is a chance after the first or second generation at 512x768 that the image will start to generate, but hangs at 99% (web UI) or 100% (webui-user.bat), but doesn't save the picture. It then hangs without throwing an error, but using all available GPU dedicated memory causing severe slowdown. When interrupting the generation during the hires fix, the same will happen.

So far I've tried deleting venv and repository folders, using a fresh install, deleting all extensions, resetting config, disabling xformers. Also using the "--reinstall-torch --reinstall-xformers" commands didn't help. I feel like the issue came out of nowhere, no updates have been made.

It feels really random, and I can sometimes normally generate new pictures with the highres fix, regardless of the settings. Sometimes rebooting helps.

My video card is a NVIDIA GeForce RTX 3080.

gpu

Steps to reproduce the problem

  1. Go to text2image, generate a picture at 512x768 using DPM++ 2M at 60 steps, CFG 7. Enable the hires. fix (I use the 4x-UltraSharp upscaler, upscale by 2, denoising strength doesn't seem to matter but around 0,2)
  2. Press generate, wait
  3. Sometimes the whole interface will hang at 99%/100%, but not generate an image, while hogging all GPU dedicated memory.

What should have happened?

The image should be generated without any issue

Commit where the problem happens

3715ece

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

--xformers --api

List of extensions

SD-latent-mirroring a1111-sd-webui-tagcomplete sd-dynamic-prompts sd-webui-ar sd_grid_add_image_number stable-diffusion-webui-promptgen

Console logs

venv "C:\Apps\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Commit hash: 3715ece0adce7bf7c5e9c5ab3710b2fdc3848f39
Installing requirements for Web UI
Installing sd-dynamic-prompts requirements.txt

Launching Web UI with arguments: --xformers
Loading weights [dc027dbbf9] from C:\Apps\stable-diffusion-webui\models\Stable-diffusion\clarity_clarity14.safetensors
Creating model from config: C:\Apps\stable-diffusion-webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Applying xformers cross attention optimization.
Textual inversion embeddings loaded(162): [snipped]
Textual inversion embeddings skipped(5): [snipped]
Model loaded in 5.8s (load weights from disk: 0.1s, create model: 0.4s, apply weights to model: 2.7s, apply half(): 0.5s, move model to device: 0.6s, load textual inversion embeddings: 1.5s).
Running on local URL:  http://127.0.0.1:7860


100%|██████████████████████████████████████████████████████████████████████████████████| 60/60 [01:02<00:00,  1.04s/it]
Total progress: 100%|████████████████████████████████████████████████████████████████| 120/120 [01:18<00:00,  1.29s/it]

Additional information

No response

r0buster avatar Feb 18 '23 14:02 r0buster

it's not limited to hi-res fix actually but i can certainly confirm this happens - next time you encounter it try just opening a new tab or minimizing your browser, as it seems to be heavily related to 3d-accelerated web browsers

zero01101 avatar Feb 18 '23 16:02 zero01101

I see, thank you for linking that. I will give it a shot if it happens again. Strange how this issue suddenly popped up.

r0buster avatar Feb 18 '23 16:02 r0buster

so then, issue resolved? I know that for openoutpaint, you need to disable browser hardware acceleration.

reopen if you are having problems

ClashSAN avatar Feb 24 '23 05:02 ClashSAN