AMD显卡使用stable-diffusion-webui-directml时爆显存怎么办?

已经是6800xt了,16G显存,但还是爆显存,求助 RuntimeError: Could not allocate tensor with 214…
关注者
20
被浏览
99,421
登录后你可以
不限量看优质回答 私信答主深度交流 精彩内容一键收藏


写在前面

Stable Diffusion的本地部署一般需要Nvidia显卡,可是并非所有计算机都有Nvidia显卡的配置,甚至有时拥有Nvidia显卡的电脑也会出现运行不畅的状况,那么对于这些电脑来说它们就与AI绘图无缘了吗?放心,今天介绍的这个方法对配置的要求接近于零,甚至平板电脑、手机(当然最好是智能机了笑)都可以,只要有浏览器就行。


教程正文

这个方法的原理是蹭Google的云上GPU,相当于远程操控另外一台超高配置的计算机来为自己所用,所以首先通过下方网址打开colaboratory:

colab.research.google.com

在左上角的Edit菜单选择Notebook settings

Hardware accelerator选择GPU,然后点击Save

点击右上角Connect,在allocating接着显示connected之后,就表示成功蹭上Google的GPU啦

点击+Code

这时会发现底部出现一个横条,这个就是即将要粘贴代码的地方

复制下方的代码,粘贴到横条中,然后点击左端的三角形镂空的圆形按钮,也就是“Run”。

!pip install --upgrade fastapi==0.90.0
!git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
!git clone https://github.com/yfszzx/stable-diffusion-webui-images-browser /content/stable-diffusion-webui/extensions/stable-diffusion-webui-images-browser
!curl -Lo chilloutmixni.safetensors https://huggingface.co/nolanaatama/chomni/resolve/main/chomni.safetensors
!curl -Lo ulzzang-6500.pt https://huggingface.co/nolanaatama/chomni/resolve/main/ulzzang-6500.pt
!curl -Lo koreanDollLikeness_v10.safetensors https://huggingface.co/duthanhduoc/chilloutmix-set/resolve/main/koreanDollLikeness_v10.safetensors
!curl -Lo japaneseDollLikeness_v10.safetensors https://huggingface.co/aimainia/japaneseDollLikeness_v10/blob/main/japaneseDollLikeness_v10.safetensors
!mkdir /content/stable-diffusion-webui/models/Lora
!mv "/content/koreanDollLikeness_v10.safetensors" "/content/stable-diffusion-webui/models/Lora"