组件
Git
Python
AUTOMATIC1111
Stable Diffusion 模型
基础模型
- Stable Diffusion 2 最重要的转变是替换文本编码器。Stable Diffusion 1 使用 OpenAl 的 CLIP,这是一种开源模型,可以了解标题对图像的描述程度。虽然模型本身是开源的,但重要的是,训练 CLIP 的数据集不是公开可用的。
它使用已知 Stable Diffusion 2 改为使用 OpenCLIP 它是 CLIP 的开源版本数据集进行训练- LAION-5B 的美学子集,可过滤掉 NSFW 图像。Stability Al 表示 OpenCLIP “极大地提高了生成图像的质量”,事实上,在指标上优于 CLIP 的未发布版本。(有时候 2 的效果不如 1 是正常的) - huggingface
- Stable Diffusion 2 最重要的转变是替换文本编码器。Stable Diffusion 1 使用 OpenAl 的 CLIP,这是一种开源模型,可以了解标题对图像的描述程度。虽然模型本身是开源的,但重要的是,训练 CLIP 的数据集不是公开可用的。
预训练的模型(在基础模型的基础上做了与预先的微调,可以生成特定风格的人物)
模型有 ckpt
和 safetensors
ckpt
比较早期,嵌入了 python 的一些脚本,容易受到病毒攻击safetensors
较新,且读取速度更快
安装
克隆仓库
AUTOMATIC1111/stable-diffusion-webui: Stable Diffusion web UI (github.com):
|
下载模型
以 1.5 为例:runwayml/stable-diffusion-v1-5 at main (huggingface.co)
将下载好的模型放入仓库的 models/Stable-diffusion
中:
安装 conda
|
|
|
|
设置仓库根目录下, webui-user.bat
里的参数:
|
git pull
让项目每次运行前都拉取最新的仓库,我就不设了set PYTHON="C:\Users\19048\.conda\envs\stable-diffusion\python.exe"
设置 python 解释器的位置
运行 webui
|
|
我试图绕开这个安装 torch 的环节,因为我觉得它安装有点慢,但是我不会😅……但是把代理关了好像还蛮快的?冀大的网速还是值得一夸。
老是下载一半报错:
pip._vendor.urllib3.excerptions.ReadTimeoutError: HTTPSConnectionPool(host='download.pytorch.org', port=443): Read timed out.
唉,因为用清华镜像会下成 CPU 版本的 pytorch,只能一直试了,真傻逼啊。
结果安装到gfpgan
还是失败……先吃午饭吧。
我说婷婷!直接上网找个整合版安装包吧😅。
打开网页报错 Something went wrong Expecting value: line 1 column 1 (char 0)的,把你梯子关了
尝试使用xFormers
会报错,好吧那就关了。
玩
一些使用教程:
- 2023-03-22_5分钟学会Stable Diffusion图生图功能 - 知乎 (zhihu.com)
- KREA — create better prompts. 这个网站可以看到其他人生成的图片所用到的提示词。
太变态的就不发了咳咳咳……
- cubistic painting of Samuel Beckett by Picasso and Georges Braque, analytical cubism, brushstrokes
- 毕加索和乔治·布拉克分析立体主义笔触的塞缪尔·贝克特立体主义绘画
- photo of rihanna. latex. artgerm, ilya kuvshinov, alphonse mucha. highly detailed 8 k. intricate. nikon d 8 5 0 5 5 mm. award wi
- 蕾哈娜的照片。乳胶。Artgerm, Ilya Kuvshinov, Alphonse Mucha.高度详细的 8 K. 错综复杂。尼康 D 8 5 0 5 5 毫米奖 WI
- junji ito style homer simpson, intricate, highly detailed, illustration, art by junji ito, junji ito
- 伊藤淳二风格荷马辛普森,复杂,高度详细,插图,伊藤淳二,伊藤润二的艺术
- Audrey Hepburn painting by Van Gogh
- 梵高画的奥黛丽赫本
- realistic extremely detailed portrait painting of a beautiful black woman with a robot, city street on background by Jean Delvil
- 现实的极其详细的肖像画,一个美丽的黑人妇女与机器人,背景上的城市街道,由 Jean Delvil 绘制
- Michael Jackson painting by Pegaso
- 毕加索画的迈克尔杰克逊
- a really suspicious horse, you can just tell that it's up to no good
- 一匹非常可疑的马,你可以说它没有好处
线上部署
- 本地吃配置
- 本地部署复杂
- 随时随地访问
- 免费
Colab 部署地址:camenduru/stable-diffusion-webui-colab at drive (github.com)