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 天前
CANN ops-nn 算子解读:Stable Diffusion 图像生成中的 Conv2D 卷积实现
深度学习·计算机视觉·stable diffusion
学易1 天前
第十五节.别人的工作流,如何使用和调试(上)?(2类必现报错/缺失节点/缺失模型/思路/实操/通用调试步骤)
人工智能·ai作画·stable diffusion·报错·comfyui·缺失节点
心疼你的一切1 天前
基于CANN仓库算力手把手实现Stable Diffusion图像生成(附完整代码+流程图)
数据仓库·深度学习·stable diffusion·aigc·流程图·cann
Niuguangshuo2 天前
DALL-E 3:如何通过重构“文本描述“革新图像生成
人工智能·深度学习·计算机视觉·stable diffusion·重构·transformer
Niuguangshuo3 天前
深入解析 Stable Diffusion XL(SDXL):改进潜在扩散模型,高分辨率合成突破
stable diffusion
Niuguangshuo3 天前
深入解析Stable Diffusion基石——潜在扩散模型(LDMs)
人工智能·计算机视觉·stable diffusion
迈火3 天前
SD - Latent - Interposer:解锁Stable Diffusion潜在空间的创意工具
人工智能·gpt·计算机视觉·stable diffusion·aigc·语音识别·midjourney
迈火10 天前
Facerestore CF (Code Former):ComfyUI人脸修复的卓越解决方案
人工智能·gpt·计算机视觉·stable diffusion·aigc·语音识别·midjourney
重启编程之路11 天前
Stable Diffusion 参数记录
stable diffusion
孤狼warrior14 天前
图像生成 Stable Diffusion模型架构介绍及使用代码 附数据集批量获取
人工智能·python·深度学习·stable diffusion·cnn·transformer·stablediffusion