github項(xiàng)目地址:AUTOMATIC1111/stable-diffusion-webui
前提:
git已經(jīng)安裝(這個(gè)很簡(jiǎn)單,可以去其他教程看)
安裝python 3.10.9,這里稍微說(shuō)一下,用Anaconda或者python官網(wǎng)的環(huán)境都是可以的。只要能找到下面這個(gè)python.exe文件的位置就可以。
使用git下載novel AI源碼
①右鍵空白的地方-》Git Bash Here -》輸入:
git clone https://ghproxy.com/https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
②成功后會(huì)出現(xiàn)下面這樣一個(gè)文件:
③進(jìn)入到這個(gè)文件夾后會(huì)找到下面這樣一個(gè)文件webui-user.bat
④使用記事本打開(kāi)后把剛才找到的python.exe文件路徑放進(jìn)去、保存
⑤雙擊webui-user.bat文件
如果你的網(wǎng)絡(luò)夠好,它可以下載,你就等等,直接看第⑦步
如果你網(wǎng)絡(luò)不好,那么跟我走下一步。
進(jìn)入到torchvision下載torchvision-0.14.1+cpu-cp310-cp310-win_amd64.whl
進(jìn)入到torch下載torch-1.13.1+cu117-cp310-cp310-win_amd64.whl
找到這個(gè)python.exe文件
接著打開(kāi)cmd輸入如下代碼
D:\csdn\stable-diffusion-webui\venv\Scripts\python.exe -m pip config set global.index-url https://pypi.douban.com/simple/
⑥安裝剛剛下載好的兩個(gè)文件
輸入
D:\csdn\stable-diffusion-webui\venv\Scripts\python.exe -m pip install D:\chromeDownLoad\torch-1.13.1+cu117-cp310-cp310-win_amd64.whl
等待安裝完成,再輸入
D:\csdn\stable-diffusion-webui\venv\Scripts\python.exe -m pip install D:\chromeDownLoad\torchvision-0.14.1+cu117-cp310-cp310-win_amd64.whl
⑦雙擊webui-user.bat后,會(huì)發(fā)現(xiàn)不用安裝torch和torchvision了。接著會(huì)卡在Installing gfpgan。我們關(guān)掉這個(gè)窗口。
打開(kāi)cmd,再次輸入
D:\csdn\stable-diffusion-webui\venv\Scripts\python.exe -m pip config set global.index-url https://pypi.douban.com/simple/
輸入
D:\csdn\stable-diffusion-webui\venv\Scripts\python.exe -m pip install gfpgan
等待安裝完成。
⑧雙擊webui-user.bat文件,這時(shí)候就會(huì)顯示Installing clip
這個(gè)時(shí)候我們就不要用pip直接安裝了
我們用記事本打開(kāi)與webui-user.bat在同一目錄的launch.py文件,ctrl+f搜索clip,找到下面的代碼,右面有一個(gè)地址https://github.com/openai/CLIP.git
我們隨便找一個(gè)地方右鍵-》git bash here
輸入
git clone https://ghproxy.com/https://github.com/openai/CLIP.git
cmd切進(jìn)這個(gè)新下載的目錄,輸入
D:\csdn\stable-diffusion-webui\venv\Scripts\python.exe setup.py install
⑨雙擊webui-user.bat文件,這時(shí)候就會(huì)顯示Installing open_clip
與clip類(lèi)似,用同樣的方法安裝,我就不寫(xiě)了。
⑩安裝
我們打開(kāi)與webui-user.bat在同一目錄的repositories目錄,在此目錄下使用
git clone https://ghproxy.com/https://github.com/Stability-AI/stablediffusion.git
git clone https://ghproxy.com/https://github.com/CompVis/taming-transformers.git
git clone https://ghproxy.com/https://github.com/crowsonkb/k-diffusion.git
git clone https://ghproxy.com/https://github.com/salesforce/BLIP.git
git clone https://ghproxy.com/https://github.com/sczhou/CodeFormer.git
需要注意的一點(diǎn)是,第一條命令下載后的目錄名是
我們需要將它改為launch.py中寫(xiě)的文件名
最后在repositories得到的文件如下所示
11、雙擊webui-user.bat文件,等待片刻后會(huì)顯示缺一個(gè)ftfy文件
我們使用命令文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-778413.html
D:\csdn\stable-diffusion-webui\venv\Scripts\python.exe -m pip install ftfy
12、雙擊webui-user.bat文件,開(kāi)始下載模型
下載完成后,就可以運(yùn)行了
在瀏覽器中輸入http://127.0.0.1:7860
大功告成
[補(bǔ)充:最后會(huì)出現(xiàn)No module ‘xformers’. Proceeding without it.問(wèn)題,這個(gè)問(wèn)題不管也沒(méi)關(guān)系,加了這個(gè)包會(huì)加了這個(gè)會(huì)省一點(diǎn)顯存和提一點(diǎn)速度
如果想解決這個(gè)問(wèn)題,可以參考此鏈接:https://www.bilibili.com/read/cv20259334。不過(guò)我按照他的方法配置了后,運(yùn)行就報(bào)錯(cuò)了,有大佬知道是啥問(wèn)題,可以在評(píng)論區(qū)說(shuō)一下。]文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-778413.html
到了這里,關(guān)于AUTOMATIC1111/stable-diffusion-webui安裝教程的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!