Stable Diffusion web UI
前言
好久没更了,最近又发现好玩的AI工具,分享给大家。
Stable Diffusion是一款功能异常强大的AI图片生成器。它支持文字生成图片,图片转图片,使用各种各样的模型来达到你想要的效果,还能训练你自己的专属模型。 简单来说,即使你没有绘画功底,只要文笔叙说的够详细准确也可以画出自己想要的图片,甚至超乎你的想象。
- 先转一波别人使用此工具生成的图:
- 自己部署生成的图片,个人电脑显存只有4g,只能生成384*384的小图
电脑硬件要求
- Windows系统
- 有独立显卡,并且是NVDIA卡,显存至少4个G。
- 硬盘留有足够的空间,该程式占用30个G左右(包括模型)
网络要求:可能需要魔法上网
当然,mac系统,AMD显卡,显存少的情况也有方法安装使用,不过多少会出问题,而且功能不全,严重影响使用体验。
安装步骤
选择一个路径(最好放在C盘,以免后续出问题),新建stable-diffusion-webui-master
文件夹,在这个文件夹下解压刚刚下载的stable-diffusion-webui-master .zip
。
- 显卡显存大于8G的忽略这步。显存小于8G修改上一步解压文件里面的
webui-user.bat
1 | @echo off |
显存4—6G修改成以上
显存不到2G把--medvram
改成--lowvram
这样可以减少系统的负担,提高图片的运算速率。
- 双击运行
webui-user.bat
等待安装,会花费挺长时间安装,全部的安装环境大概10个G
可能出现的问题:
Couldn‘t install gfpgan
,以下是报错代码
1 | Installing gfpgan |
找到stable-diffusion-webui-master文件夹下launch.py
,打开编辑这个文件
在所有https://github.com前面添加https://ghproxy.com/。下面是修改好的。修改后保存文件.
删除stable-diffusion-webui-master
文件夹下的venv
文件夹(只要报错没有流畅安装完成,再次双击webui-user.bat
运行之前都要删除这个文件)
1 | def prepare_environment(): |
假如没有其它报错,成功安装后会出现本地链接网址,把网址复制到浏览器就能访问。不要退出cmd!!!
- 添加中文语言包
https://github.com/VinsonLaro/stable-diffusion-webui-chinese
把上面的地址粘贴在下图的第三步,点击install
重启web-ui
选择Settings,选择user interface,选择chinese-all-0220
应用设置,重载UI
文字生成图片界面介绍
模型
模型推荐
- 人体骨架分析模型
control_sd15_openpose
,作用是可以把真人图片上传到web-ui,分析出图片中人物的姿势骨架,然后重新绘图。 - 国风模型
guofeng3_v32
:生成的人物,符合国人审美,富有中国元素 - anythion4.0:比较适合绘制动漫风格人物
stablydiffuseds_26
AI模型
提示词
提示词(prompt):图中想要出现的内容。
标配提示词:masterpiece
,best quality
。
反向提示词(negative prompt):图中不想要的内容
提示词可以使用翻译软件翻译成英语直接用,也可以使用TAG来展示,一个提示词后面一个逗号,复杂的语法,比如(),and,or,:,[]等怎么使用可以自己拓展了解。提示词越靠前,优先级越高,把重点想画的内容放在最前面。比如masterpiece
,best quality
的意思是大师级,高质量绘画,把它们放在最前面,出来的图片质量就会比较好。
提示词在线网站
提示词示例
正向提示词
1 | 4 girls,4 girls on the beach,back to the sea,White dress,beautiful white gauze skirt,bikini,intricate,elegant,highly detailed,digita painting,concept art,summer lights,queen,sunset,orange sky,pink nightgown,simple background,soft light<lora:dalcefopainting_Lora300:1> |
反向提示词
1 | nude,naked,hands,cartoon,thick strokes,((disfigured)),((bad art)),((deformed)),((poorly drawn)),((extra limbs)),((close up)),((b&w)),weird colors,blurry,complex |
正向提示词
1 | 1girl, beautiful, realistic |
反向提示词
1 | (((simple background))),monochrome ,lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, lowres, bad anatomy, bad hands, text, error, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, ugly,pregnant,vore,duplicate,morbid,mut ilated,tran nsexual, hermaphrodite,long neck,mutated hands,poorly drawn hands,poorly drawn face,mutation,deformed,blurry,bad anatomy,bad proportions,malformed limbs,extra limbs,cloned face,disfigured,gross proportions, (((missing arms))),(((missing legs))), (((extra arms))),(((extra legs))),pubic hair, plump,bad legs,error legs,username,blurry,bad feet |
在线体验使用
推荐阅读
- 本地部署 AI作画工具 stable-diffusion-webui 多种模型 可生成NSFW
https://www.tjsky.net/tutorial/457
- AI绘画指南 stable diffusion webui (SD webui)如何设置与使用
https://www.tjsky.net/tutorial/488
- Stable Diffusion2.1+WebUI的安装与使用(极详细)