Stability-AI / stablediffusion

High-Resolution Image Synthesis with Latent Diffusion Models
MIT License
39.25k stars 5.06k forks source link

RTX 4090, Cuda out of memory errors when Hires Fix. #396

Open Allerius8 opened 2 months ago

Allerius8 commented 2 months ago

Hello guys, I am having really frustrating problem. I had 3060 with 12GB VRAM few days ago, I was having often CUDA out of Memory issues and I wanted to upgrade for long time so I actually bought 4090 24gb VRAM, expecting I will have zero issues. I also completely reinstalled my stable diffusion and windows. I set up everything, got latest drivers, everything. And SD is working flawlessly... UNLESS I turn on HiRes fix., for some reason, and I cant fucking figure out why, it has extreme issues with HiRes fix, generating the image takes just a few seconds but HiRes takes like 10 times the time, and puts a lot of load on my PC, AND very often either my PC nearly crashes or SD crashed with the same CUDA out of memory error.

Doesnt matter what model I use, doesnt matter what resolution or upscale amount, its just having really tough time with it.

I tried using multiple command arguments and variations of them, also no difference.

I really got beefy PC, 64GB RAM, 24GB VRAM, no load on it, I really have no idea whats the issue, it has to be some bug with last version of stable diffusion

chen29181 commented 3 weeks ago

maybe your image doesn't meet h&w=512,pad or scale it to 512x512 maybe helpful