依賴軟件
GIT
下載頁面 https://git-scm.com/download/win
直接下載使用這個地址 https://github.com/git-for-windows/git/releases/download/v2.40.0.windows.1/Git-2.40.0-64-bit.exe
雙擊下載好的文件,然后一直點擊 “Next”。
最后取消那個“View Release Notes”前的√,然后點擊“Finish”
Python
安裝這個版本:3.10.6
下載頁面 https://www.python.org/downloads/ 或 https://www.python.org/downloads/release/python-3106/
直接下載使用這個地址 https://www.python.org/ftp/python/3.10.6/python-3.10.6-amd64.exe
雙擊下載的文件,
勾上“Add Python 3.10 to PATH”,再點上面的“Install Now”
最后點擊一下“Disabled path length limit”再關閉
安裝StableDiffusion WebUI前的準備
第一 檢查之前安裝的軟件是否正常
同時按下“WIN+R”在彈出的對話框中輸入cmd
(或者全大寫CMD
都可以)然后直接回車或者點擊確定按鈕
或者點擊任務欄上的搜索圖標也是輸入cmd
不同版本的Windows有細微差別
然后會打開一個黑色的窗口(細微差別可忽視)
輸入(或者直接粘貼)git --version
和python --version
記得要分開并且最后回車
如何粘貼?
在那個黑色窗口的標題欄上點擊右鍵,在出現(xiàn)的菜單上選擇”編輯“->“粘貼”
命令參考:
c:\Users\Administrator>git --version
git version 2.40.0.windows.1
c:\Users\Administrator>python --version
Python 3.10.6
第二 加速一下Python的pip
國內(nèi)的一些安裝源鏡像地址
阿里云 https://mirrors.aliyun.com/pypi/simple/
中國科技大學 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) https://pypi.douban.com/simple/
清華大學 https://pypi.tuna.tsinghua.edu.cn/simple/
還是在剛才那個黑色的窗口
更新pip,輸入命令:python -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ --upgrade pip
并回車
配置源(全局),輸入命令:pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
并回車
使用pip install torch
測試一下速度,如果速度太慢(幾百kb勉強接受,最好是有幾mb以上的速度),可以用上面列出的其他鏡像試試(比如清華大學的)pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
可以重復操作找到一個比較快(和地區(qū)、時間都有關系,也可以不用直接用默認的)的源地址
恢復默認源:pip config set global.index-url https://pypi.Python.org/simple/
命令參考:
c:\>python -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ --upgrade pip
c:\>pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
c:\>pip install torch
# 使用 Ctrl+C 可以終止
安裝Stable Diffusion Webui
準備工作目錄
打開“文件資源管理器”,在非C:盤例如E:盤創(chuàng)建一個目錄(例如Works,或者用現(xiàn)有的“工作目錄”也可以)
點擊“地址欄”
輸入cmd
并回車
會出現(xiàn)一個“黑色窗口”并已經(jīng)自動進入這個工作目錄下。
克隆程序
輸入命令git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
并回車開始克隆。
如果網(wǎng)絡不通暢會失敗,這時候重新執(zhí)行就可以了。
安裝、配置
輸入cd stable-diffusion-webui
并回車
這個時候可以(非必要)提前安裝一下中文語言包(之后還需要配置啟用才能生效,也可以以后在UI上安裝)
輸入命令git clone https://github.com/dtlnor/stable-diffusion-webui-localization-zh_CN extensions\stable-diffusion-webui-localization-zh_CN
并回車
安裝配置啟動WebUI,輸入命令webui-user.bat
并回車
過程根據(jù)網(wǎng)絡不同從十來分鐘到幾十分鐘(甚至更長)。中途可能會報錯,一般是網(wǎng)絡問題直接重試即可。
如果報錯信息包含這樣的內(nèi)容,說明你的電腦系統(tǒng)沒有可用的顯卡。
AssertionError: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check
在經(jīng)過漫長的安裝過程,成功啟動的樣子是這樣的,注意紅色框框,有這個信息說明安裝好了。
這時候可以用Ctrl+c
,停止程序。以后再啟動的時候在安裝目錄下“E:\Works\stable-diffusion-webui”直接找到剛才那個“webui-user.bat”雙擊就行(只要等十多秒)?;蛘咛砑右粋€“快捷方式”到桌面上。
后續(xù)
添加一個“快捷方式”到桌面上。
使用“文件資源管理器”導航到安裝目錄下“E:\Works\stable-diffusion-webui”找到“webui-user"。使用右鍵功能。文章來源:http://www.zghlxwxcb.cn/news/detail-504118.html
注意:你會看到多個“webui-user
",選擇后面有顯示“Windows 批處理文件”的那個!文章來源地址http://www.zghlxwxcb.cn/news/detail-504118.html
命令參考
E:\Works>git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
# 等待執(zhí)行完畢
E:\Works>cd stable-diffusion-webui
# 安裝插件
# 中文包
E:\Works\stable-diffusion-webui>git clone https://github.com/dtlnor/stable-diffusion-webui-localization-zh_CN extensions\stable-diffusion-webui-localization-zh_CN
# 圖片瀏覽器
E:\Works\stable-diffusion-webui>git clone https://github.com/AlUlkesh/stable-diffusion-webui-images-browser extensions\stable-diffusion-webui-images-browser
# 自動安裝并啟動
E:\Works\stable-diffusion-webui>webui-user.bat
到了這里,關于Windows全新安裝 StableDiffusion WebUI的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!