news 2026/2/8 18:18:06

stable diffusion搭建指南

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
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

【Stable Diffusion】安装过程中常见报错解决方法 https://blog.csdn.net/Bankcary/article/details/131237002

stable diffusion webui 启动参数详解 https://blog.csdn.net/glovenone/article/details/132408230

Stable Diffusion模型存放位置及种类介绍 https://zhuanlan.zhihu.com/p/643709254

47个高质量的 Stable Diffusion 常用模型推荐 https://www.uisdc.com/47-stable-diffusion-models

ubuntu部署stable-diffusion-webui https://blog.wuzuxi.com/218.html

Stable Diffusion入门(十二):制作会说话图片 | SadTalker https://zhuanlan.zhihu.com/p/638639336

Stable Diffusion系列课程上:安装、提示词入门、常用模型(checkpoint、embedding、LORA)、放大算法、局部重绘、常用插件https://zhuanlan.zhihu.com/p/642592246?utm_id=0

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/2/5 2:54:58

48、Python网络编程:smtplib与urllib包的使用详解

Python网络编程:smtplib与urllib包的使用详解 1. smtplib模块 1.1 功能概述 smtplib模块提供了一个低级的SMTP客户端接口,可使用RFC 821和RFC 1869中描述的SMTP协议发送邮件。该模块包含许多低级函数和方法,详细信息可查阅在线文档。 1.2 核心类与方法 1.2.1 SMTP类 构…

作者头像 李华
网站建设 2026/2/8 10:17:34

数学可视化终极指南:用动画让抽象数学触手可及

数学可视化终极指南:用动画让抽象数学触手可及 【免费下载链接】videos 项目地址: https://gitcode.com/GitHub_Trending/vi/videos 还在为理解微积分的抽象概念而苦恼吗?GitHub_Trending/vi/videos项目为你打开了一扇通往数学可视化世界的大门。…

作者头像 李华
网站建设 2026/2/8 7:22:08

TrollRestore 终极指南:在 iOS 17.0 上轻松安装 TrollStore

TrollRestore 终极指南:在 iOS 17.0 上轻松安装 TrollStore 【免费下载链接】TrollRestore TrollStore installer for iOS 17.0 项目地址: https://gitcode.com/gh_mirrors/tr/TrollRestore TrollRestore 是一款专为 iOS/iPadOS 15.2 - 16.7 RC (20H18) 和 1…

作者头像 李华
网站建设 2026/2/5 16:06:31

Meridian营销组合建模完整指南:从入门到精通

Meridian营销组合建模完整指南:从入门到精通 【免费下载链接】meridian Meridian is an MMM framework that enables advertisers to set up and run their own in-house models. 项目地址: https://gitcode.com/GitHub_Trending/meri/meridian 在当今数据驱…

作者头像 李华
网站建设 2026/2/6 18:25:10

DeepWiki-Open本地部署指南:打造完全离线的AI文档生成系统

DeepWiki-Open本地部署指南:打造完全离线的AI文档生成系统 【免费下载链接】deepwiki-open Open Source DeepWiki: AI-Powered Wiki Generator for GitHub Repositories 项目地址: https://gitcode.com/gh_mirrors/de/deepwiki-open 还在为代码文档生成依赖外…

作者头像 李华