0
点赞
收藏
分享

微信扫一扫

2024北京劳保展|职业防护装备展|安全生产展|劳保展览会

搬砖的小木匠 04-10 10:30 阅读 2

 一、准备环境

 先安装git 工具来更新git源码 , 载下源码后卸载git 版本(centos 默认1.8版本,说是安装会引起失败)

安装git 命令,可使用 git --version查看版本

sudo yum install git -y

卸载git命令

sudo yum remove git

 正式源码安装git 过程 

cd /usr/src/
git clone https://github.com/git/git.git
cd git/
sudo make prefix=/usr install
sudo echo "export PATH=/usr/bin:$PATH" >> ~/.bashrc
source ~/.bashrc
git --version

最后显示 git version 2.44 就成功了(要git 2.3以上)

cd /usr/local
wget https://www.python.org/ftp/python/3.10.6/Python-3.10.6.tgz --no-check-certificate
tar -zxvf Python-3.10.6.tgz
wget https://www.openssl.org/source/openssl-1.1.1n.tar.gz --no-check-certificate
tar -zxvf openssl-1.1.1n.tar.gz
cd openssl-1.1.1n
./config --prefix=/usr/local/openssl
make -j && make install
openssl version

mv /usr/bin/openssl /usr/bin/openssl.bak
ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl

yum install zlib zlib-devel
yum install -y libffi-devel

cd /usr/local/Python-3.10.6/
./configure --prefix=/usr/local/python3 --with-openssl=/usr/local/openssl --with-openssl-rpath=auto
make -j
make install
python3 -V

ln -s /usr/local/python3/bin/pydoc3.10 /usr/bin/pydoc3
ln -s /usr/local/python3/bin/python3.10-config /usr/bin/python3-config
ln -s /usr/local/python3/bin/python3.10 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3.10 /usr/bin/pip

pip install --upgrade pip

pip -V
pip install requests

 说明:

安装完python3.10.6  ,

        pip 安装默认为 22.2.1 要升级到最新

在webui.sh中把 can_run_as_root=0 改成 can_run_as_root=1   就可以root 直接执行对应脚本 

 说明:(pip在虚拟机中可能不是最新的,所以创建要创建的虚拟机中,升级pip)

第一步安装git和Python3在前置部分已经安装好了。
开始第二步,下载webui.sh,下面这个命令即使从官方github地址下载webui.sh这个文件。注意:我们只需要下载这一个文件即可,其他文件在之后执行这个文件的时候会下载。
wget -q https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui.sh
第三步执行webui.sh,在你保存webui.sh的目录中执行。执行完成后,会在同级目录下生成名为stable-diffusion-webui的文件夹,这就是从官方地址完整下载的。
./webui.sh
第四部进入stable-diffusion-webui里面,里面也有这个文件,再次执行这个./webui.sh文件,然后就可以使用啦

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

sh webui.sh
cd stable-diffusion-webui
python3 -m venv venv
source venv/bin/activate
pip -V 
pip install --upgrade pip

pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/

pip install -r requirements_versions.txt # 执行此条命令前,请检查你的剩余磁盘空间

 二、安装必要的库  在stable-diffusion-webui目录

pip3 install torch torchvision torchaudio
python -m xformers.info
 
pip install xformers
mkdir openai
cd openai
git clone https://www.modelscope.cn/AI-ModelScope/clip-vit-large-patch14.git
git clone https://github.com/facebookresearch/xformers.git
cd xformers
git submodule update --init --recursive
 
如果不行,也可以用下源码,下下来放对应目录 
 
git clone https://github.com/NVIDIA/cutlass.git third_party/cutlass
git clone https://github.com/Dao-AILab/flash-attention.git third_party/flash-attention
git clone https://github.com/ROCm/composable_kernel.git third_party/composable_kernel_tiled

cd ./repositories
git clone https://github.com/salesforce/BLIP.git
git clone https://github.com/sczhou/CodeFormer.git
git clone https://github.com/crowsonkb/k-diffusion.git
git clone https://github.com/Stability-AI/generative-models.git
git clone https://github.com/Stability-AI/stablediffusion.git stable-diffusion-stability-ai


git clone https://github.com/CompVis/stable-diffusion.git
cd stable-diffusion

参考:

1)、Centos7 部署 Stable Diffusion_skip-torch-cuda-test-CSDN博客

举报

相关推荐

0 条评论