当前位置:   article > 正文

【Stable Difussion】一键部署_cannot locate tcmalloc. do you have tcmalloc or go

cannot locate tcmalloc. do you have tcmalloc or google-perftool installed on

一、安装

1、github项目地址:

https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
  • 1

2、新建conda环境

conda create -n sdxl python=3.10
注:python版本应该大于3.10
  • 1
  • 2

3、切换至conda环境,启动项目

切换环境

conda activate sdxl
  • 1

在空的项目目录下执行:

wget -q https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui.sh
  • 1

启动:

1、cd stable-diffusion-webui
2、bash webui.sh 
  • 1
  • 2

可能出现的错误:

错误一:Cannot locate TCMalloc (improves CPU memory usage)

解决方法:安装 libgoogle-perftools4 和 libtcmalloc-minimal4 库。

sudo apt-get install libgoogle-perftools4 libtcmalloc-minimal4 -y
  • 1

错误二: This script must not be launched as root, aborting…

解决方法:运行 bash webui.sh -f
  • 1

4、git 下载失败

打开你的stable-diffusion主目录,找到如图所示的launch.py文件 
找到  def prepare_enviroment():
在每个  https://github.com/  开头的链接前面添加   https://ghproxy.com/  
例如:
	https://ghproxy.com/https://github.com/ 
  • 1
  • 2
  • 3
  • 4
  • 5

5、显示安装torch失败

1、检查显卡使用,停掉不用的服务,至少保证显卡余量10g以上
2、安装离线包   pip执行本地安装,先到朋友torch官网中找到对应的版本,获取到下载 cuda版本(cu)、python版本(cp)、还有torch版本(2.0.1)、torchvision(0.15.2)版本,获取到对应的下载链接后,可在Linux下执行 
wget https://........
  • 1
  • 2
  • 3

6、卡在安装Installing requirements

网络问题,可以查看stable-diffusion-webui/requirements 下载对应的离线包 安装后再执行wenui.sh

7、报错 openai/clip-vit-large-patch14

报错: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.
  • 1
解决:手动下载   需要翻墙   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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
在项目目录下创建(stable-diffusion-webui)
mkdir -p openai/clip-vit-large-patch14

把以上九个文件放到新文件夹下
  • 1
  • 2
  • 3
  • 4

7、不要忘记修改restart.sh中的VAE路径

二、运维

1、模型位置

模型挂载到:目录文件/stable-diffusion-webui/models/Stable-diffusion/
  • 1

2、风格位置

SDXL文件夹挂载到: 目录文件/stable-diffusion-webui/models/Lora/
  • 1

3、VAE挂载

sdxl_vae.safetensors
文件夹挂载到: 目录文件/stable-diffusion-webui/models/VAE/
  • 1
  • 2

3、项目启动参数

--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 &
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

4、重启项目

conda activate sdxl
cd 到  /disk/sdxl/
执行 sh restart.sh  
  • 1
  • 2
  • 3

5、日志文件存放地址

/disk/sdxl/sdxl.log
  • 1

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/448919
推荐阅读
相关标签
  

闽ICP备14008679号