lllyasviel / stable-diffusion-webui-forge

GNU Affero General Public License v3.0
7.45k stars 722 forks source link

An error occurred in the image: OutOfCacheError: CUDA out of memory Tried to allocate 256.00 MiB. GPU #1091

Open 1241445614 opened 1 month ago

1241445614 commented 1 month ago

When I use instant ID to change faces in the torch2.31+CUDA121 environment, I encounter OutOfCacheError: CUDA out of memory Tried to allocate 256.00 MiB GPU, The image size is 1024px * 1024px, and my graphics card is ntx1060 6G. This can run perfectly with torch 2.1+CUDA121. Isn't torch 2.1+CUDA121 more stable? TORCH2.31+CUDA121 can run with xFormers, but the speed will be slower.

1241445614 commented 1 month ago

79313686d659fe6d9a5837afdd4a201 f706650eeb656a2917b3155db50d30b

1241445614 commented 1 month ago

torch2.12+cuda121 too! c7a8965e6910936991aafbdad6f803f 39248d6285473d908c783bbdb22b932

SuperMaoUwU commented 1 month ago

If you look in terminal you will see that tiling is broken and turned off right now, this is the issue with out of memory problem because tiling used to fix this before, also memory allocation is broken in new build, i have 3060 6gb vram and i have same issue, use appends to make memory efficient

1241445614 commented 1 month ago

如果你查看终端,你会看到平铺现在已经损坏并关闭,这是内存不足的问题,因为平铺以前用于修复这个问题,内存分配在新版本中也被破坏了,我有 3060 6gb vram 我有同样的问题,使用附加来提高内存效率

Thank you for your answer. Yes, that's why I started preparing to use two versions. The latest version is for experiencing FLUX, and the old version from July 21st is for daily work

SuperMaoUwU commented 1 month ago

to use SDXL i use "--xformers --xformers-flash-attention --cuda-stream --always-offload-from-vram --precision autocast --attention-quad --cuda-malloc --administrator --clip-in-fp8-e4m3fn --vae-in-fp16 --unet-in-fp8-e4m3fn" in commandline args in webui-user.bat problem is not torch or your driver, problem is SDWEBUI forge, https://huggingface.co/city96/FLUX.1-schnell-gguf try flux GGUF version with lowest filesize it has highest percent chance to fit in vram but keep in mind that the lower the quantization the lower the quality of image gen you will receive, there is also flux S gguf version too. I hope this helps you in your AI journey, comment if you find anything interesting as solution for lower memory card like ours

KAI-KOGASHIVA commented 3 weeks ago

to use SDXL i use "--xformers --xformers-flash-attention --cuda-stream --always-offload-from-vram --precision autocast --attention-quad --cuda-malloc --administrator --clip-in-fp8-e4m3fn --vae-in-fp16 --unet-in-fp8-e4m3fn" in commandline args in webui-user.bat problem is not torch or your driver, problem is SDWEBUI forge, https://huggingface.co/city96/FLUX.1-schnell-gguf try flux GGUF version with lowest filesize it has highest percent chance to fit in vram but keep in mind that the lower the quantization the lower the quality of image gen you will receive, there is also flux S gguf version too. I hope this helps you in your AI journey, comment if you find anything interesting as solution for lower memory card like ours

What should I do? These lines aren't helping; I keep getting an error from Python, and the program won't start.

I've tried many different methods, reinstalled all the programs, entered various commands, but the result is the same. I have an RTX 3060 (12GB) graphics card, and the error persists. This error only occurs when I enable LORa, but without it, the image doesn't match what I want.

Please help if you can; I have no experience with this, and this is my first time trying to work with the program.

1241445614 commented 2 weeks ago

要使用 SDXL,我在命令行参数中使用“--xformers --xformers-flash-attention --cuda-stream --always-offload-from-vram --precision autocast --attention-quad --cuda-malloc --administrator --clip-in-fp8-e4m3fn --vae-in-fp16 --unet-in-fp8-e4m3fn” 在命令行参数中webui-user.bat问题不是 torch 或您的驱动程序,问题是 SDWEBUI forge,https://huggingface.co/city96/FLUX.1-schnell-gguf尝试文件大小最小的 Flux GGUF 版本,它最适合 VRAM 的百分比最高,但请记住,量化越低,您收到的图像生成质量就越低,还有 Flux S GGUF 版本。我希望这对您的 AI 之旅有所帮助,如果您发现任何有趣的解决方案,请发表评论,例如我们

我该怎么办?这些台词无济于事;我不断从 Python 收到错误,并且程序无法启动。

我尝试了许多不同的方法,重新安装了所有程序,输入了各种命令,但结果是一样的。我有 RTX 3060 (12GB) 显卡,但错误仍然存在。此错误仅在启用 LORa 时发生,但如果没有它,图像与我想要的图像不匹配。

如果可以的话,请帮忙;我没有这方面的经验,这是我第一次尝试使用该程序。 现在好像稳定了些,我现在使用webui-user.bat来启动forge,上述问题没有在出现了,webui-user.bat启动比run.bat启动会好点,这位大佬给的那个“--xformers --xformers-flash-attention --cuda-stream --always-offload-from-vram --precision autocast --attention-quad --cuda-malloc --administrator --clip-in-fp8-e4m3fn --vae-in-fp16 --unet-in-fp8-e4m3fn”我也没有去添加,你可以试试看,如果你添加了,建议重新下载解压包,更新后并使用webui-user.bat来启动