配置 和使用 stable-diffusion-webui

1. 中文插件

参考:
https://zhuanlan.zhihu.com/p/617997179

我选择的是 通过网址安装。

不过是我在 去页面最顶部部,找到 Localization (requires restart) 选项。

成功:

image

每个参数含义:

参数 说明
Prompt 提示词(正向)
Negative prompt 消极的提示词(反向)
Width & Height 要生成的图片尺寸。尺寸越大,越耗性能,耗时越久。
CFG scale AI 对描述参数(Prompt)的倾向程度。值越小生成的图片越偏离你的描述,但越符合逻辑;值越大则生成的图片越符合你的描述,但可能不符合逻辑。
Sampling method 采样方法。有很多种,但只是采样算法上有差别,没有好坏之分,选用适合的即可。
Sampling steps 采样步长。太小的话采样的随机性会很高,太大的话采样的效率会很低,拒绝概率高(可以理解为没有采样到,采样的结果被舍弃了)。
Seed 随机数种子。生成每张图片时的随机种子,这个种子是用来作为确定扩散初始状态的基础。不懂的话,用随机的即可。

2. 开启面部修复(CodeFormers)

设置内选择 CodeFormers 进行面部修复。

点击生成,会自动下载模型到指定文件夹下,如果下载失败,报如下错误:

正在解析主机 github.com (github.com)... 127.0.0.1
正在连接 github.com (github.com)|127.0.0.1|:443... 已连接。
错误: 无法验证 github.com 的由 “CN=SteamTools Certificate” 颁发的证书:
  无法本地校验颁发者的权限。
要以不安全的方式连接至 github.com,使用“--no-check-certificate”。

可以使用 wget 手动下载到提示的文件夹下,并且加上 --no-check-certificate参数。

错误:AttributeError: 'FaceRestoreHelper' object has no attribute 'face_det'

解决:https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/10059#discussioncomment-5985092

3. 怎么写提示词?

用 chatGPT 生成:参考:https://zhuanlan.zhihu.com/p/632025155

正向:A close-up illustration of Ana de Armas in a neo-noir style, reminiscent of the film noir genre, with a focus on shadows, contrasts, and a sense of danger.

反向:ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, deformed, body out of frame, bad anatomy, watermark, signature, cut off, low contrast, underexposed, overexposed, bad art, beginner, amateur, distorted face, blurry, draft, grainy

效果:

image

4. 怎么使用 lora?

Lora 模型的网站:

https://civitai.com/ 被和谐,可以访问:https://aigccafe.com/

去该网站上下一个 左上角写着 lora 的模型,一般比较小(几十 M)。

Lora 模型使用参考:https://zhuanlan.zhihu.com/p/624230991

正向: ((animation style)), A close-up illustration of Ana de Armas in a neo-noir style, reminiscent of the film noir genre, with a focus on shadows, contrasts, and a sense of danger.<lora:animetarotV51:0.8>

反向:同上

image

5. 怎么训练 lora?

暂时参考:https://zhuanlan.zhihu.com/p/624230991

待续

posted @ 2023-06-28 23:10  cold_moon  阅读(204)  评论(0编辑  收藏  举报