Stable Diffusion
Stable Diffusion是一个开源的文本生成图像模型。由CompVis、StabilityAI和Runway合作开发。
简介
时间轴
常见图像生成模型
| 名称 | 描述 |
|---|---|
| Diffusion models | |
| GAN (Generative adversarial networks) |
|
| VAE (Variational auto encoders) |
|
| Flow-based models |
相似对比
| 名称 | 描述 | 网站 |
|---|---|---|
| Stable Diffusion | ||
| Midjourney | ||
| DALL-E |
安装
在线使用
| 平台 | 描述 | |
|---|---|---|
| Hugging Face | 无需注册,直接使用。
官网:https://huggingface.co/spaces/stabilityai/stable-diffusion | |
| Replicate | 无需注册,直接使用,支持付费API。 | |
| DreamStudio | Stability AI 提供的网站。 | |
| Google Colab | Colab是Google提供的一个免费和付费的Jupyter Notebook环境。 使用步骤: 1.登录Colab,https://colab.research.google.com/ 2.安装Stable Diffusion环境,在 https://github.com/camenduru/stable-diffusion-webui-colab 选择一个环境脚本,点击打开并在Colab运行安装。 3.Colab中安装完成后会有WebUI链接,点击访问即可。 Google Colab:https://colab.research.google.com/ | |
| 腾讯云GPU服务器 | 购买活动服务器,60元15天。 使用步骤: 1.系统选择:Docker基础镜像。 2.拉取Docker镜像: sudo docker pull gpulab.tencentcloudcr.com/ai/stable-diffusion:1.0.8 3.运行容器: sudo docker run -itd --gpus=all --network=host --device=/dev/dri --group-add=video --ipc=host --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --name=stable-diffusion gpulab.tencentcloudcr.com/ai/stable-diffusion:1.0.8 | xargs sudo docker logs --follow。4.点击Public URL:https://xxxxxxxx.gradio.live/ 可以打开Stable Diffusion WebUI。点击http://外网IP:8888/?token=xxxxxx打开JupyterNotebook | |
Windows上部署
快速开始
Prompt 提示词
语法
| 名称 | 描述 | 示例 |
|---|---|---|
| prompt | 提示词,需要在画面出现内容。 | |
| Negative prompt | 反向提示词,不需要在画面出现内容。 | |
| Seed |
常见提示词
| 类型 | 提示词 |
|---|---|
| 设备 Device | 佳能:Canon,尼康:Nikon,iPhone, |
| 镜头 Lenses | |
| 风格 | |
| 画质 | 杰作:masterpiece,最佳品质:best quality |
常用网站
| 网站名称 | 描述 | 网址 |
|---|---|---|
| Civitai | 模型分享网站,点击图片右下角的感叹号,会显示提示词。 | https://civitai.com/ |
| Promptbase | 有 DALL·E, GPT, Midjourney, Stable Diffusion, ChatGPT提示词 | https://promptbase.com/ |
| Prompthero | https://prompthero.com/ | |
| 无界AI | https://wujieai.com/ | |
| Lexica | https://lexica.art/ |
Model 模型
Stable Diffusion模型是由一大堆的图像和图像的本注释训练而成。
模型类型
| 名称 | 描述 |
|---|---|
| Checkpoint | 又称大模型、底模型,真正 Stable Diffusion模型,直接使用即可生成图片。模型很大,一般2 – 7 GB。 格式:ckpt,safetensors 位置:stable-diffusion-webui/models/Stable-diffusion/ 使用:点击webUI左上角Stable Diffusion checkpoint单选框选择模型,默认Stable diffusion训练模型。 |
| LoRA | |
下载安装
安装模型,只需要下载模型放入对应文件夹,再在网页点击模型刷新按钮。如Checkpoint模型放入stable-diffusion-webui/models/Stable-diffusion文件夹中。可以网页浏览下载模型,也可以使用命令下载,如在Linux中下载chilloutmix 模型:
# 进入模型对应文件夹,使用wget下载。
cd stable-diffusion-webui/models/Stable-diffusion
wget -O chilloutmix_NiPrunedFp32.safetensors https://civitai.com/api/download/models/9475
| 名称 | 描述 | 网址 |
|---|---|---|
| Civitai | 模型多,浏览下载方便。 | https://civitai.com/ |
| Hugging Face | 模型多 | https://huggingface.co/ |
训练模型
Controlnet
资源
官网
- Stable Diffusion 源代码:https://github.com/CompVis/stable-diffusion
- Stable Diffusion 源代码:https://github.com/Stability-AI/stablediffusion
- Stability 官网:https://stability.ai
- Runway 官网:https://runwayml.com
网站
- Stable Diffusion WebUI:https://github.com/AUTOMATIC1111/stable-diffusion-webui
- stable diffusion webui colab:https://github.com/camenduru/stable-diffusion-webui-colab
- LAION-5B :https://laion.ai/blog/laion-5b/
视频
- 哔哩哔哩:my3d - AI绘图-stable diffusion从入门到精通
- 哔哩哔哩:AI次世代 - 【AI绘画入门教程】AI绘画入门 模型详解 保姆教程 Stable Diffusion模型到哪下载?
- Youtube:Jay Alammar - AI Art Explained: How AI Generates Images (Stable Diffusion, Midjourney, and DALLE)
- Youtube:李宏毅 -【生成式AI】速覽圖像生成常見模型
- Youtube:李宏毅 -【生成式AI】淺談圖像生成模型 Diffusion Model 原理
文章
- Jay Alammar:The Illustrated Stable Diffusion
- 画宇宙:倒立的BOB - stable diffusion 原理是什么?stable diffusion 原理介绍 - AI绘画每日一帖
- Towards AI:Youssef Hosni - Getting Started With Stable Diffusion
- 知乎:小小将 - 文生图模型之Stable Diffusion
- 知乎:新智元 - Jay Alammar再发新作:超高质量图解Stable Diffusion,看完彻底搞懂「图像生成」原理
- 知乎:Sean - Stable Diffusion原理解读
- STABLE DIFFUSION ART:models
- 亚马逊AWS官方博客: Stable Diffusion WebUI 在电商场景生成 AI 模特搭配服装的方案探索