Stable Diffusion 本地安装步骤

简介: Stable Diffusion 本地安装步骤

Stable Diffusion 是一种开源机器学习模型,可以从文本生成图像,根据文本修改图像,或者在低分辨率或低细节图像上填充细节。


Stable Diffusion 已经过数十亿张图像的训练,可以产生与从 DALL-E 2 和 MidJourney 获得的结果相当的结果。 它由 Stability AI 开发,并于 2022 年 8 月 22 日首次公开发布。


Stable Diffusion 可以在 windows 电脑上完全免费使用。

本文介绍 Stable Diffusion 在 Windows 11 操作系统上的详细安装步骤。


  1. 安装 Python

社区推荐安装 Python 3.10.6,但笔者安装的是 3.10.8:


大家可以直接通过这个链接下载 Python.


打开 Stable Diffusion 的 Github 仓库

点击 Code->Download Zip 将其下载到本地:

下载到本地,解压。

https://huggingface.co/CompVis/stable-diffusion-v-1-4-original


启动日志,会自动下载 torchtorchvision

耐心等待其下载完毕:


如果启动时遇到如下错误消息:


File “C:\app\stable-diffusion-webui-master\launch.py”, line 355, in

prepare_environment()

File “C:\app\stable-diffusion-webui-master\launch.py”, line 260, in prepare_environment

run_python(“import torch; assert torch.cuda.is_available(), ‘Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check’”)

File “C:\app\stable-diffusion-webui-master\launch.py”, line 121, in run_python

return run(f’“{python}” -c “{code}”', desc, errdesc)

File “C:\app\stable-diffusion-webui-master\launch.py”, line 97, in run

raise RuntimeError(message)

RuntimeError: Error running command.

Command: “C:\app\stable-diffusion-webui-master\venv\Scripts\python.exe” -c “import torch; assert torch.cuda.is_available(), ‘Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check’”

Error code: 1

stdout:

stderr: C:\app\stable-diffusion-webui-master\venv\lib\site-packages\torch\cuda_init_.py:88: UserWarning: CUDA initialization: The NVIDIA driver on your system is too old (found version 10020). Please update your GPU driver by downloading and installing a new version from the URL: http://www.nvidia.com/Download/index.aspx Alternatively, go to: https://pytorch.org to install a PyTorch version that has been compiled with your version of the CUDA driver. (Triggered internally at …\c10\cuda\CUDAFunctions.cpp:109.)

return torch._C._cuda_getDeviceCount() > 0

Traceback (most recent call last):

File “”, line 1, in

AssertionError: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check


https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/1742

https://github.com/TencentARC/GFPGAN

按照错误消息的提示去纠正:

找到了报这条错误消息的准确地址:

启动成功了:


相关实践学习
基于阿里云DeepGPU实例,用AI画唯美国风少女
本实验基于阿里云DeepGPU实例,使用aiacctorch加速stable-diffusion-webui,用AI画唯美国风少女,可提升性能至高至原性能的2.6倍。
相关文章
|
2月前
|
机器学习/深度学习 编解码 人工智能
阿里云Stable Diffusion操作教程
阿里云Stable Diffusion操作教程
|
2月前
|
机器学习/深度学习 自然语言处理 算法
Stable Diffusion WebUI 从零基础到入门
Stable Diffusion WebUI 从零基础到入门
314 1
|
2月前
|
人工智能 物联网 开发工具
本地搭建 Stable Diffusion,还有完整的安装包
本地搭建 Stable Diffusion,还有完整的安装包
171 0
|
9月前
|
机器学习/深度学习
什么是 Stable Diffusion 中的 Masking
什么是 Stable Diffusion 中的 Masking
|
9月前
|
并行计算 PyTorch 算法框架/工具
使用 Stable Diffusion 本地版时遇到显卡驱动过旧的问题
使用 Stable Diffusion 本地版时遇到显卡驱动过旧的问题
|
1月前
|
算法 算法框架/工具 计算机视觉
Stable diffusion采样器详解
在我们使用SD web UI的过程中,有很多采样器可以选择,那么什么是采样器?它们是如何工作的?它们之间有什么区别?你应该使用哪一个?这篇文章将会给你想要的答案。
Stable diffusion采样器详解
|
1月前
|
关系型数据库 数据库 开发工具
Stable Diffusion 本地部署教程
Stable Diffusion 本地部署教程
46 0
|
2月前
|
Python
stable diffusion本地部署教程
stable diffusion本地部署教程
49 1
|
2月前
|
Docker 容器
stable_diffusion_webui docker环境配置
请注意,上述步骤提供了一个基本的配置示例。根据你的实际需求和环境,你可能需要进一步配置Docker容器、网络设置和安全性设置。确保遵循Docker最佳实践来保护你的容器和应用程序。
43 1
|
2月前
|
人工智能 异构计算
Stable Diffusion 3.0的特点
【2月更文挑战第5天】Stable Diffusion 3.0的特点
246 2
Stable Diffusion 3.0的特点