CUDA out of memory. 當GPU記憶體不足而停止時的解決方法

1 min

language: ja bn en es hi pt ru zh-cn zh-tw

在使用Stable Diffusion時發生記憶體不足的錯誤。

我的情況下出現了以下顯示。

CUDA out of memory. Tried to allocate 3.35 GiB (GPU 0; 8.00 GiB total capacity; 5.63 GiB already allocated; 843.24 MiB free; 5.65 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

編輯 webui-user.bat,如果沒有安裝 xformers 的人,也請安裝 xformers。
即使使用 VAE 也可能發生,所以請加入 –no-half-vae。

set COMMANDLINE_ARGS=–xformers --no-half-vae

結束。

Related Posts