网站上线后做什么,wordpress知乎,免费ppt模板免费下载完整版免费,四川做网站公司前言
最近终于有机会从围墙里往外看#xff0c;了解到外面的世界已经有了天翻地覆的变化#xff0c;感叹万千#xff0c;笔者在本地mac#xff0c;windows#xff0c;linux#xff0c;docker部署了不下20遍后#xff0c;整理出来的linux极简避坑安装方案#xff0c;供…前言
最近终于有机会从围墙里往外看了解到外面的世界已经有了天翻地覆的变化感叹万千笔者在本地macwindowslinuxdocker部署了不下20遍后整理出来的linux极简避坑安装方案供大家参考学习。
注
系统linux
用户py
python3.10
涉及工具wget、miniconda、git
Stable Diffusion WebUI简称webui
安装目录/data/
github地址
https://github.com/AUTOMATIC1111/stable-diffusion-webui
安装
miniconda
由于stable-diffusion-webui的安装需要特定的python版本所以使用工具管理python库且由于Anaconda过于臃肿所以选择miniconda
# 安装wget工具确保可以使用下载功能
yum install -y wget# 安装miniconda
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh# 执行权限
chmod x Miniconda3-latest-Linux-x86_64.sh# 新建用户 py ## 由于webui默认不允许root用户执行且新建用户更好的管理python
useradd py# 新建目录
/data# 将安装脚本移动到/data方便管理
mv Miniconda3-latest-Linux-x86_64.sh /data/#将data目录授权给py
chown -R py:py /data# 安装miniconda
# 切换用户
su - py
cd /data
./Miniconda3-latest-Linux-x86_64.sh##遇到输入写yes其他按回车安装完成#安装完成后默认没有base前缀是环境还未生效需要手动source
source /home/py/.bashrc# 就会发现控制台由
[pylocalhost ~]$
#变成了
(base) [pylocalhost ~]$
# miniconda 安装完成python 环境
# 使用conda 安装webui需要使用的环境
conda create --name sd python3.10# 使用sd环境后续操作都在sd环境执行
conda activate sd
#控制台变为
(sd) [pylocalhost ~]$# 设置pip的阿里镜像源
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
pip config set install.trusted-host mirrors.aliyun.comgit
# 安装 git 由于conda 可以安装工具所以直接使用conda
conda install -y gitstable-diffusion-webui
# 下载github源码
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git# 启动
cd stable-diffusion-webui
./webui.sh############该操作会执行较久的时间来下载依赖如遇到github依赖下载失败多执行几遍github网站在国内不算限制访问##### 启动以后如果程序没有发现已存在的模型则会自动下载模型该操作访问的是外网所以需要手动下载模型放到
# 模型所在的位置
/data/stable-diffusion-webui/models/Stable-diffusion/# 这里上传了一个dreamshaper_8的模型供大家在内网使用见文章最后# 内网启动会遇到如下报错由于 https://huggingface.co/ 国内访问不了所以有个依赖下载失败该资源也提供下载见文章最后
OSError: Cant load tokenizer for openai/clip-vit-large-patch14. If you were trying to load it from https://huggingface.co/models, make sure you dont 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.#下载该资源放到任意路径本文放置/data/stable-diffusion-webui/下/huggingface/transformers为资源内部目录
#调整报错的脚本
# /data/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/modules/encoders/modules.py
openai/clip-vit-large-patch14
替换为
/data/stable-diffusion-webui/huggingface/transformers################################
#最终启动
./webui.sh --skip-torch-cuda-test --no-half --use-cpu interrogate --listen --port 1111#--skip-torch-cuda-test 没有显卡跳过检查不然起不来
#--no-half 降低精度减少资源使用不然起不来
#--use-cpu interrogate cpu的使用策略可选 all
#--listen 该参数不加的话只能本地访问添加该参数可以在其他客户端访问
#--port 指定端口默认7860
web页面
默认是英文本页面是安装了中文插件 https://github.com/VinsonLaro/stable-diffusion-webui-chinese.git 简单使用
输入提示词 1girl
附
模型下载地址https://civitai.com/
dreamshaper_8模型下载openai/clip-vit-large-patch14资源下载 由于文件最大只能上传1000M所以拆分成了多个文件 dreamshaper_8 Stable Diffusion WebUI -模型依赖-001 Stable Diffusion WebUI -模型依赖-002 Stable Diffusion WebUI -模型依赖-003 huggingfaceclip-vit-large-patch14 Stable Diffusion WebUI -模型依赖-004 Stable Diffusion WebUI -模型依赖-005 Stable Diffusion WebUI -模型依赖-006 每个小块挂了1个积分来抵消上传的流量费-_-没有积分的同学可以私我