參考1:https://www.bilibili.com/read/cv20039815
參考2:https://blog.cmyr.ltd/archives/e740aac.html
服務器:阿里雲AI機器學習V100計算卡
OS:windows 10/server 均可
其他:
Python 3.10.6
CUDA
步驟:
1.下載 https://docs.conda.io/en/latest/miniconda.html
安裝完畢後在開始桌面內選擇 Miniconda 即可使用
conda config --set show_channel_urls yes
2.在 C:\Users\XXX\.condarc
下修改文件內容如下
channels: - defaults show_channel_urls: true default_channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2 custom_channels: conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
conda clean -i
//ps管理員打開執行
conda init cmd.exe
打開Miniconda cmd執行
conda create --name stable-diffusion-webui python=3.10.6 conda activate stable-diffusion-webui
python -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade pip
安裝cuda11,地址:https://developer.download.nvidia.cn/compute/cuda/11.1.1/local_installers/cuda_11.1.1_456.81_win10.exe
git config --global http.proxy 127.0.0.1:1080 //設置科學工具proxy否則後面無法啓動項目
git config --global https.proxy 127.0.0.1:1080
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
cd stable-diffusion-webui
模型下載地址:https://huggingface.co/hakurei/waifu-diffusion-v1-3/tree/main
下載完成後的模型請放到 models\Stable-diffusion\
下,並將文件名稱修改爲 model.ckpt
打開Miniconda cmd cd到git根目錄執行
conda activate stable-diffusion-webui
webui-user.bat
Negative prompt參考:nsfw,blush,lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts,signature, watermark, username, blurry, artist name,bad feet,big head,fused body,multiple hands,multiple legs,multiple hands,multiple breast,multiple lower legs,multiple thighs,fused body,twist body