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")

相关推荐
迈火1 天前
Facerestore CF (Code Former):ComfyUI人脸修复的卓越解决方案
人工智能·gpt·计算机视觉·stable diffusion·aigc·语音识别·midjourney
重启编程之路2 天前
Stable Diffusion 参数记录
stable diffusion
孤狼warrior5 天前
图像生成 Stable Diffusion模型架构介绍及使用代码 附数据集批量获取
人工智能·python·深度学习·stable diffusion·cnn·transformer·stablediffusion
love530love7 天前
【避坑指南】提示词“闹鬼”?Stable Diffusion 自动注入神秘词汇 xiao yi xian 排查全记录
人工智能·windows·stable diffusion·model keyword
世界尽头与你7 天前
Stable Diffusion web UI 未授权访问漏洞
安全·网络安全·stable diffusion·渗透测试
love530love7 天前
【故障解析】Stable Diffusion WebUI 更换主题后启动报 JSONDecodeError?可能是“主题加载”惹的祸
人工智能·windows·stable diffusion·大模型·json·stablediffusion·gradio 主题
ai_xiaogui12 天前
Stable Diffusion Web UI 绘世版 v4.6.1 整合包:一键极速部署,深度解决 AI 绘画环境配置与 CUDA 依赖难题
人工智能·stable diffusion·环境零配置·高性能内核优化·全功能插件集成·极速部署体验
微学AI13 天前
金仓数据库的新格局:以多模融合开创文档数据库
人工智能·stable diffusion
我的golang之路果然有问题13 天前
开源绘画大模型简单了解
人工智能·ai作画·stable diffusion·人工智能作画
我的golang之路果然有问题13 天前
comfyUI中的动作提取分享
人工智能·stable diffusion·ai绘画·人工智能作画·comfy