显卡:(一个实例仅能用一张卡)
顶配:rtx 6000 ada 48g,a100 40g,a100 80g ,a100 96g,a800 80g,h100,h200
高端:rtx4090 24g,rtx4090D 24g,rtx a6000 48g,rtx a5000 24g,rtx 5000 ada 32g
魔改:rtx2080ti 22g,rtx3080 20g
性价比:rtx4060ti 16g,rtx2060 12g,rtx3060 12g,rtx3090 24g,rtx titan 24g
其它硬件及系统环境
内存32g以上,固态300g以上,rtx之后8G以上显卡
ubuntu2204+命令行+N卡+conda
检查cuda
#ll /sys/bus/pci/devices/
#sudo apt install nvidia-driver-530
nvcc -V
dpkg -l |grep cudnn
watch -n 0.5 nvidia-smi
https://stablediffusionweb.com
https://github.com/Stability-AI/stablediffusion
https://github.com/AUTOMATIC1111/stable-diffusion-webui
sudo apt install bc libgoogle-perftools-dev
ldconfig -p | grep tcmalloc
sudo vim /etc/profile
export LD_PRELOAD=/lib/x86_64-linux-gnu/libtcmalloc.so
source /etc/profile
sudo apt install libgl1 libgl1-mesa-glx libgl1-mesa-dev
ldconfig -p | grep libGL.so.1
安装 Stable Diffusion web UI
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
cd stable-diffusion-webui
搭建python虚拟环境
conda update conda
conda config --add channels conda-forge
conda config --add channels defaults
conda info
python -m pip install --upgrade pip
conda create -n sd python=3.10.6
conda activate sd
pip install -r requirements_versions.txt
pip install -r requirements.txt
cd models/Stable-diffusion/
wget https://hf-mirror.com/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors
mkdir openai && cd openai
#https://huggingface.co/openai/clip-vit-large-patch14
git clone https://hf-mirror.com/openai/clip-vit-large-patch14.git
vim webui.sh
can_run_as_root=1
vim module/paths_internal.py
commandline_args = os.environ.get('COMMANDLINE_ARGS', "--xformers --share --gradio-auth tuser:pwd")
低4G --medvram --opt-split-attention
低8G --lowvram --opt-split-attention
--listen
webui.sh
git clone https://github.com/VinsonLaro/stable-diffusion-webui-chinese
ll stable-diffusion-webui-chinese/localizations/
cp ll stable-diffusion-webui-chinese/localizations/* localizations
Settings->User interface->Localization(requires restart) 选择Chinese-ALL 或者 Chinese-English
Apply setting Reload UI
------------------------------------------------------------
临时使用清华镜像
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn
更改默认库包下载地址为清华镜像
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# 环境出错时
python3 -m venv venv
# git提示https没法访问
git config --global https.sslVerify false
------------------------------------------------------------
更新 sd-webui-controlnet,将 controlnet 插件升级至最新版本,即
cd extensions/sd-webui-controlnet
git remote -v
# https://ghproxy.com/ 代理已经失效,需要重新设置
git remote set-url origin https://github.com/Mikubill/sd-webui-controlnet.git
git pull origin main
更新 a1111-sd-webui-tagcomplete 插件:
cd workspace/stable_diffusion_webui/extensions/a1111-sd-webui-tagcomplete
git remote -v
# https://ghproxy.com/ 代理已经失效,需要重新设置
# git remote set-url origin https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git
git remote set-url origin git@github.com:DominikDoom/a1111-sd-webui-tagcomplete.git
git pull origin main
提示信息,不需考虑,参考 GitHub - Issues:
"Tag Autocomplete: Could not locate model-keyword extension, Lora trigger word completion will be limited to those added through the extra networks menu."
标签自动完成:无法定位模型关键字扩展,Lora 触发词补全,将仅限于通过额外网络菜单添加的内容。
更新 sd-webui-roop 插件:
cd workspace/stable_diffusion_webui/extensions/sd-webui-roop
git remote -v
# https://ghproxy.com/ 代理已经失效,需要重新设置
git remote set-url origin git@github.com:s0md3v/sd-webui-roop.git
git pull origin main
Warning 信息,修复参考 Deprecation Warning,替换文件 faceswap.py:
workspace/stable_diffusion_webui/extensions/sd-webui-roop/scripts/faceswap.py:38: GradioDeprecationWarning: Usage of gradio.inputs is deprecated, and will not be supported in the future, please import your component from gradio.components
img = gr.inputs.Image(type="pil")
workspace/stable_diffusion_webui/modules/gradio_extensons.py:25: GradioDeprecationWarning: `optional` parameter is deprecated, and it has no effect
res = original_IOComponent_init(self, *args, **kwargs)
workspace/stable_diffusion_webui/extensions/sd-webui-roop/scripts/faceswap.py:55: GradioDeprecationWarning: Usage of gradio.inputs is deprecated, and will not be supported in the future, please import your component from gradio.components
upscaler_name = gr.inputs.Dropdown(
workspace/stable_diffusion_webui/extensions/sd-webui-roop/scripts/faceswap.py:74: GradioDeprecationWarning: Usage of gradio.inputs is deprecated, and will not be supported in the future, please import your component from gradio.components
model = gr.inputs.Dropdown(
更新 sdweb-easy-prompt-selector 插件:
cd workspace/stable_diffusion_webui/extensions
git clone git@github.com:blue-pen5805/sdweb-easy-prompt-selector.git
Warning 信息,参考 emove style() method:
workspace/stable_diffusion_webui/extensions/sdweb-easy-prompt-selector/scripts/easy_prompt_selector.py:97: GradioDeprecationWarning: The `style` method is deprecated. Please set these arguments in the constructor instead.
reload_button.style(size='sm')
重新启动 sd-webui 工程:
top
nohup python -u launch.py --listen --port 9301 --xformers --no-half-vae --enable-insecure-extension-access --theme dark --gradio-queue > nohup.62.out &
tail -f nohup.62.out
=========================================
nohup python -u launch.py --listen --port 9301 --xformers --no-half-vae --enable-insecure-extension-access --theme dark --gradio-queue > nohup.62.out &
tail -f nohup.62.out
标签:diffusion,--,webui,https,stable,sd From: https://www.cnblogs.com/vicowong/p/18120685