D.N.

在 windows 使用 conda 環境搭建 Stable Diffusion web UI

發佈於 March 15, 2023

說明

官方做法沒有針對 conda 環境說明手動安裝。以下是紀錄在 windows 使用 conda 環境搭建 Stable Diffusion web UI,主要是給原本就有 conda 環境的使用者參考。

實作

  1. 使用conda創建虛擬環境。

    conda create -n test python=3.8
    
  2. 安裝torch,到官方選擇與電腦可匹配的 torch GPU 版本。

    pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116
    
  3. 拉取專案。

    git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
    cd stable-diffusion-webui
    
  4. 安裝其他依賴套件。

    pip install -r requirements.txt
    
  5. 執行腳本。執行過程中會安裝一些相依套件,最後會跑出Running on local URL: http://127.0.0.1:7860訊息代表成功執行。

    python launch.py
    

© 2024 D.N.. All rights reserved.