https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
conda create -n sdxl python=3.10
注:python版本应该大于3.10
切换环境
conda activate sdxl
在空的项目目录下执行:
wget -q https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui.sh
启动:
1、cd stable-diffusion-webui
2、bash webui.sh
可能出现的错误:
错误一:Cannot locate TCMalloc (improves CPU memory usage)
解决方法:安装 libgoogle-perftools4 和 libtcmalloc-minimal4 库。
sudo apt-get install libgoogle-perftools4 libtcmalloc-minimal4 -y
错误二: This script must not be launched as root, aborting…
解决方法:运行 bash webui.sh -f
打开你的stable-diffusion主目录,找到如图所示的launch.py文件
找到 def prepare_enviroment():
在每个 https://github.com/ 开头的链接前面添加 https://ghproxy.com/
例如:
https://ghproxy.com/https://github.com/
1、检查显卡使用,停掉不用的服务,至少保证显卡余量10g以上
2、安装离线包 pip执行本地安装,先到朋友torch官网中找到对应的版本,获取到下载 cuda版本(cu)、python版本(cp)、还有torch版本(2.0.1)、torchvision(0.15.2)版本,获取到对应的下载链接后,可在Linux下执行
wget https://........
网络问题,可以查看stable-diffusion-webui/requirements 下载对应的离线包 安装后再执行wenui.sh
报错:OSError: Can't load tokenizer for 'openai/clip-vit-large-patch14'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'openai/clip-vit-large-patch14' is the correct path to a directory containing all relevant files for a CLIPTokenizer tokenizer.
解决:手动下载 需要 https://huggingface.co/openai/clip-vit-large-patch14/tree/main
下载文件为:
1、config.json
2、flax_model.msgpack
3、merges.txt
4、preprocessor_config.json
5、pytorch_model.bin
6、special_tokens_map.json
7、tokenizer.json
8、tokenizer_config.json
9、vocab.json
在项目目录下创建(stable-diffusion-webui)
mkdir -p openai/clip-vit-large-patch14
把以上九个文件放到新文件夹下
模型挂载到:目录文件/stable-diffusion-webui/models/Stable-diffusion/
SDXL文件夹挂载到: 目录文件/stable-diffusion-webui/models/Lora/
sdxl_vae.safetensors
文件夹挂载到: 目录文件/stable-diffusion-webui/models/VAE/
--api # 启动画图接口
--vae-path #添加vae模式,切换模型
--server-name #指定ip地址
--port #指定端口
例子:
bash webui.sh --api --vae-path /disk/sdxl/stable-diffusion-webui/models/VAE/sdxl_vae.safetensors --server-name ${host} --port ${port} >> sdxl.log 2>&1 &
conda activate sdxl
cd 到 /disk/sdxl/
执行 sh restart.sh
/disk/sdxl/sdxl.log