stable diffusion搭建指南

项目地址:https://github.com/AUTOMATIC1111/stable-diffusion-webui

在腾讯云算力服务器最新执行启动命令

nohup python3 -u launch.py --skip-prepare-environment --xformers --listen --enable-insecure-extension-access --port=6889 --api > /var/log/sd_service.log &

nohup python3 -u launch.py --skip-prepare-environment --xformers --listen --enable-insecure-extension-access --port=6889 --api --api-log --no-gradio-queue --enable-console-prompts > /var/log/sd_service.log &

conda管理python环境,建议3.9以上版本

#查看环境

conda info --env

#创建环境

conda create --name python310 python=3.10

#激活环境

conda activate python310

安装其他依赖

apt install --no-install-recommends google-perftools

pip install xformers

启用自动安装服务

bash webui.sh -f --port 8080 --listen --xformers --enable-insecure-extension-access --api

放在前台运行,又能检测到错误,和实时看到日志

apt-get install screen

创建一个新会话

screen -S sd

会到指定会话

screen -r sd

其他问题:

  1. 如果遇到git下载请求问题:

#代理设置

git config --global http.proxy 42.193.142.230:1090

#取消代理

git config --global --unset http.proxy

  1. 遇到 'type' object is not subscriptable 问题

python语法不支持问题,需要升级到3.9以上

3.遇到http访问外网问题

vim ~/.bashrc

复制代码
alias setproxy="export ALL_PROXY=http://42.193.142.230:1090"
alias unsetproxy="unset ALL_PROXY"

source ~/.bashrc

然后执行

复制代码
setproxy

4.遇到切换模型一直loading ,并且报Error: Connection errored out

vim ~/.bashrc

复制代码
export COMMANDLINE_ARGS="--no-gradio-queue"

source ~/.bashrc

  1. Cannot locate TCMalloc

apt install --no-install-recommends google-perftools

6.No module 'xformers'. Proceeding without it.

pip install xformers

7.AssertionError: extension access disabed because of commandline flags

启动命令增加 --enable-insecure-extension-access

8.支持api接口

启动命令增加 --api

模型下载位置

从模型下载网站下载相关的模型文件,上传到相应目录即可,最著名最多模型的也就是c站,https://civitai.com/

1.checkpoints (大模型,sd的主模型)

/stable-diffusion-webui/stable-diffusion-webui/models/Stable-diffusion

因为webui.sh会下载一个新项目,所以会多一级目录

2.lora(微调模型,基于大模型做一些参数微调)

/stable-diffusion-webui/stable-diffusion-webui/models/Lora

参考链接:

Stable Diffusion \]webui部署(Linux) [https://blog.51cto.com/holy2010/6940654](https://blog.51cto.com/holy2010/6940654 "https://blog.51cto.com/holy2010/6940654") 【Stable Diffusion】安装过程中常见报错解决方法 [https://blog.csdn.net/Bankcary/article/details/131237002](https://blog.csdn.net/Bankcary/article/details/131237002 "https://blog.csdn.net/Bankcary/article/details/131237002") stable diffusion webui 启动参数详解 [https://blog.csdn.net/glovenone/article/details/132408230](https://blog.csdn.net/glovenone/article/details/132408230 "https://blog.csdn.net/glovenone/article/details/132408230") Stable Diffusion模型存放位置及种类介绍 [https://zhuanlan.zhihu.com/p/643709254](https://zhuanlan.zhihu.com/p/643709254 "https://zhuanlan.zhihu.com/p/643709254") 47个高质量的 Stable Diffusion 常用模型推荐 [https://www.uisdc.com/47-stable-diffusion-models](https://www.uisdc.com/47-stable-diffusion-models "https://www.uisdc.com/47-stable-diffusion-models") ubuntu部署stable-diffusion-webui [https://blog.wuzuxi.com/218.html](https://blog.wuzuxi.com/218.html "https://blog.wuzuxi.com/218.html") Stable Diffusion入门(十二):制作会说话图片 \| SadTalker [https://zhuanlan.zhihu.com/p/638639336](https://zhuanlan.zhihu.com/p/638639336 "https://zhuanlan.zhihu.com/p/638639336") Stable Diffusion系列课程上:安装、提示词入门、常用模型(checkpoint、embedding、LORA)、放大算法、局部重绘、常用插件[https://zhuanlan.zhihu.com/p/642592246?utm_id=0](https://zhuanlan.zhihu.com/p/642592246?utm_id=0 "https://zhuanlan.zhihu.com/p/642592246?utm_id=0")

相关推荐
吐个泡泡v2 天前
扩散模型详解:从DDPM到Stable Diffusion再到DiT的技术演进
stable diffusion·transformer·扩散模型·ddpm·dit
Blossom.1182 天前
基于MLOps+LLM的模型全生命周期自动化治理系统:从数据漂移到智能回滚的落地实践
运维·人工智能·学习·决策树·stable diffusion·自动化·音视频
不会kao代码的小王5 天前
openEuler上Docker部署Kafka消息队列实战
前端·云原生·stable diffusion·eureka
Blossom.1187 天前
基于多智能体强化学习的云资源调度系统:如何用MARL把ECS成本打下来60%
人工智能·python·学习·决策树·机器学习·stable diffusion·音视频
Yeliang Wu8 天前
Stable Diffusion WebUI 从安装到实战:原理、部署与问题全解
stable diffusion
Yeliang Wu8 天前
ComfyUI 全流程指南:安装、配置、插件与模型选型
stable diffusion·文生图·图生图·comfyui
LCG米9 天前
[OpenVINO实战] 在边缘设备上运行Stable Diffusion,实现离线文生图
人工智能·stable diffusion·openvino
水上冰石9 天前
rtx5060部署stable-diffusion1.10.1版本注意事项
stable diffusion
水上冰石9 天前
stable-diffusion-webui的v1.10.1版本汉化
stable diffusion