无码av一区二区三区无码,在线观看老湿视频福利,日韩经典三级片,成 人色 网 站 欧美大片在线观看

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

amd顯卡在wsl環(huán)境下配置stable-diffusion-webui

2023-03-24 18:10 作者:大齡二次猿  | 我要投稿

環(huán)境為 wsl2 + openEule-22.09,顯卡為農(nóng)企的rx5700

只能說能用~

安裝git、python軟件包

sudo dnf install -y git python

下載stable-diffusion-webui到本地

git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git && cd ./stable-diffusion-webui

安裝Miniconda

  • 下載Miniconda

    wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
  • 使用Miniconda

    bash Miniconda3-latest-Linux-x86_64.sh

    初始化完畢后輸入conda -V 查看是否成功安裝,若提示命令不存在,可執(zhí)行 source ~/.bashrc 刷新當前環(huán)境變量

配置stable-diffusion-webui環(huán)境

  • 創(chuàng)建stable-diffusion-webui環(huán)境

    conda create -n stable-diffusion-webui python=3.10
  • 進入stable-diffusion-webui環(huán)境

    conda activate stable-diffusion-webui
  • 配置pip包管理器的源地址

    vi ~/.config/pip/pip.conf

    添加以下內(nèi)容

    [global] index-url = https://mirrors.aliyun.com/pypi/simple/ [install] trusted-host = mirrors.aliyun.com
  • 安裝環(huán)境依賴

    conda install numpy==1.23.5 conda install pytorch=1.13.1 cpuonly -c pytorch pip install torch-directml==0.1.13.1dev230301 gfpgan clip pip install -r requirements.txt

    可能會遇到提示pip版本過低,可執(zhí)行pip install --upgrade pip升級

修改部分代碼,使其支持directml

  • 找到 ./modules/devices.py 里的?def has_maps() -> bool:,在上面添加如下代碼

    def has_dml() -> bool: ?return True
  • 同樣是 ./modules/devices.py 里的?def get_optimal_device_name(),在代碼內(nèi)部的?if has_maps():?上面添加

    if has_dml(): ?return "dml"
  • 同樣是 ./modules/devices.py 里的?def get_optimal_device_name(),在代碼內(nèi)部添加

    if get_optimal_device_name() == "dml": ?import torch_directml ?return torch_directml.device()
  • 找到 ./modules/sd_models.py 里的?device = map_location or shared.weight_load_location or devices.get_optimal_device_name(),修改為

    device = map_location or shared.weight_load_location or devices.get_optimal_device()

開啟stable-diffusion-webui應用服務

python .\launch.py --skip-torch-cuda-test --lowvram --precision full --no-half

首次運行可能還需要安裝部分依賴,請靜候


在部署中遇到的一些錯誤

  • 代碼縮進不要用空格

  • 安裝環(huán)境依賴要在conda activate stable-diffusion-webui之后

  • 報libGL.so.1缺失,執(zhí)行pip install opencv-python-headless

部分內(nèi)容參考自?


amd顯卡在wsl環(huán)境下配置stable-diffusion-webui的評論 (共 條)

分享到微博請遵守國家法律
广州市| 古丈县| 浠水县| 阜南县| 吉隆县| 黄骅市| 斗六市| 武定县| 平南县| 辽宁省| 沙坪坝区| 姚安县| 余干县| 蚌埠市| 桓台县| 巨野县| 新营市| 台州市| 太原市| 东阿县| 马关县| 迁安市| 女性| 电白县| 临江市| 河津市| 兴安盟| 德庆县| 利川市| 宁阳县| 和平县| 八宿县| 乌鲁木齐市| 浑源县| 盐城市| 咸阳市| 苍溪县| 剑河县| 景洪市| 百色市| 石嘴山市|