最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(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的評論 (共 條)

分享到微博請遵守國家法律
壶关县| 孟连| 德安县| 北流市| 潞西市| 平乡县| 班戈县| 河东区| 米林县| 镇康县| 大荔县| 怀化市| 大邑县| 西乌珠穆沁旗| 青神县| 来凤县| 乌兰察布市| 沁阳市| 东兴市| 义乌市| 松滋市| 且末县| 焦作市| 稷山县| 台东市| 汨罗市| 聂拉木县| 阳原县| 安庆市| 临沂市| 宣恩县| 长宁县| 托克托县| 商丘市| 吐鲁番市| 金川县| 顺昌县| 张北县| 南溪县| 盐山县| 炉霍县|