dsh-novelai 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +67 -2
- package/README.zh.md +68 -0
- package/cordis.patch.yml +3 -0
- package/docs/notes-character-ref.md +70 -0
- package/docs/notes-v45-full.md +126 -0
- package/docs/notes-v5.md +78 -0
- package/docs/prompt-guide.md +304 -0
- package/dsh.plugin.json +9 -0
- package/lib/index.js +329 -0
- package/lib/nai.mjs +415 -0
- package/lib/prompt.mjs +133 -0
- package/lib/routes.mjs +198 -0
- package/package.json +53 -6
- package/public/index.html +383 -0
- package/studio.mjs +30 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dsh-novelai contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,68 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-novelai
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
NovelAI image generation inside [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) — three agent tools, a full studio page, and a prompt knowledge base distilled from four Chinese NovelAI tutorials.
|
|
4
|
+
|
|
5
|
+
Bring your own NovelAI API token. Nothing is sent anywhere except `image.novelai.net`.
|
|
6
|
+
|
|
7
|
+
## What you get
|
|
8
|
+
|
|
9
|
+
| | |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| `nai_image` | Generate an image from a prompt. The PNG is saved and returned as an image attachment, so the model actually sees what it drew. Supports `style` presets (厚涂/平涂/水彩/油画/素描/线稿/像素/3D/Q版/漫画/立绘), `artist` strings (`[[[artist:name]]]`), and `enhance` (auto weight notation per model, quality tags, default negative, token budget warnings). |
|
|
12
|
+
| `nai_status` | Subscription tier, expiry, usage. |
|
|
13
|
+
| `nai_prompt` | `build` a prompt from subject/style/artist/scene, `check` an existing one (weight notation, brackets, V4.5 vs V5 syntax, token budget), or `guide` for the cheat sheet. |
|
|
14
|
+
| Studio page | `http://127.0.0.1:<port>/dsh-novelai/` — parameters, live draft previews, history, download. |
|
|
15
|
+
| Standalone studio | `node studio.mjs` → `http://127.0.0.1:4173/`, no DSH required. |
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
dsh plugin --profile web add dsh-novelai
|
|
21
|
+
# restart DSH, then open http://127.0.0.1:3080/dsh-novelai/
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Or manually: add `"dsh-novelai": "^1.0.0"` to your profile's `package.json` dependencies **and** to `dsh.profile.bundles`, then `pnpm install`.
|
|
25
|
+
|
|
26
|
+
## Configure
|
|
27
|
+
|
|
28
|
+
Click **设置** on the studio page and paste your NovelAI token (starts with `pst-`), or write `~/.dsh/novelai.json` yourself:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"apiKey": "pst-...",
|
|
33
|
+
"proxy": "",
|
|
34
|
+
"outDir": "",
|
|
35
|
+
"model": "nai-diffusion-4-5-full",
|
|
36
|
+
"width": 832,
|
|
37
|
+
"height": 1216,
|
|
38
|
+
"steps": 28,
|
|
39
|
+
"scale": 5,
|
|
40
|
+
"sampler": "k_euler_ancestral"
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
- `proxy` — leave empty for a direct connection. If you are behind the GFW, point it at your local HTTP proxy, e.g. `http://127.0.0.1:7890`. Environment overrides: `NAI_API_KEY`, `NAI_PROXY`.
|
|
45
|
+
- `outDir` — empty means `~/nai-output`.
|
|
46
|
+
- Tokens are stored in plain JSON under your home directory. That is the same place DSH keeps its own config; do not commit it.
|
|
47
|
+
|
|
48
|
+
## Anlas: what is free
|
|
49
|
+
|
|
50
|
+
Opus is unlimited **for the free tier only**: one image, ≤28 steps, up to about 1 MP.
|
|
51
|
+
|
|
52
|
+
- 832×1216 at 28 steps, 1 image → free
|
|
53
|
+
- 30 steps, or 1216×1216, or `n=4` → charged, and a 402 means your balance cannot cover it
|
|
54
|
+
- V5 at standard size → also free
|
|
55
|
+
- Character Reference / Vibe Transfer → charged separately (reference import + per generation)
|
|
56
|
+
|
|
57
|
+
You can read your balance for free: send a request that is certain to exceed it (e.g. 1216×1216); the 402 body reports `Required: X, Available: Y`.
|
|
58
|
+
|
|
59
|
+
## Notes
|
|
60
|
+
|
|
61
|
+
- One generation at a time per account; a second concurrent request returns 429 for ~15 s.
|
|
62
|
+
- V4/V4.5 models require `v4_prompt` / `v4_negative_prompt`; this plugin builds them for you.
|
|
63
|
+
- The bundled knowledge base ([docs/prompt-guide.md](docs/prompt-guide.md)) covers style reproduction, V5 specifics, character reference, Anlas accounting, and the precise-reference API shape.
|
|
64
|
+
- Reference images (Character Reference / Vibe Transfer) are **not** implemented yet.
|
|
65
|
+
|
|
66
|
+
## License
|
|
67
|
+
|
|
68
|
+
MIT
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# dsh-novelai
|
|
2
|
+
|
|
3
|
+
把 NovelAI 生图接进 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness):三个 agent 工具 + 一个画室页面 + 一套从四个中文教程里提炼的提示词知识库。
|
|
4
|
+
|
|
5
|
+
用自己的 NovelAI token,除了 `image.novelai.net` 之外什么都不往外发。
|
|
6
|
+
|
|
7
|
+
## 有什么
|
|
8
|
+
|
|
9
|
+
| | |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| `nai_image` | 给提示词出图,PNG 存盘并作为图片附件返回(模型能看见自己画了什么)。支持 `style` 画风预设、`artist` 画师串、`enhance`(按模型自动转权重写法、补质量词、补负面、超预算提醒)。 |
|
|
12
|
+
| `nai_status` | 档位、到期时间、用量。 |
|
|
13
|
+
| `nai_prompt` | `build` 拼提示词、`check` 体检(权重写法/括号/模型语法/token 预算)、`guide` 出心法。 |
|
|
14
|
+
| 画室页面 | `http://127.0.0.1:<端口>/dsh-novelai/`,参数面板、逐帧草稿、历史、下载。 |
|
|
15
|
+
| 独立 studio | `node studio.mjs` → `http://127.0.0.1:4173/`,不依赖 DSH。 |
|
|
16
|
+
|
|
17
|
+
## 安装
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
dsh plugin --profile web add dsh-novelai
|
|
21
|
+
# 重启 DSH,然后打开 http://127.0.0.1:3080/dsh-novelai/
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
手动装:把 `"dsh-novelai": "^1.0.0"` 同时加进 profile 的 `package.json` 依赖和 `dsh.profile.bundles`,再 `pnpm install`。
|
|
25
|
+
|
|
26
|
+
## 配置
|
|
27
|
+
|
|
28
|
+
页面右上角「设置」里粘 token(`pst-` 开头),或直接写 `~/.dsh/novelai.json`:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"apiKey": "pst-...",
|
|
33
|
+
"proxy": "",
|
|
34
|
+
"outDir": "",
|
|
35
|
+
"model": "nai-diffusion-4-5-full",
|
|
36
|
+
"width": 832,
|
|
37
|
+
"height": 1216,
|
|
38
|
+
"steps": 28,
|
|
39
|
+
"scale": 5,
|
|
40
|
+
"sampler": "k_euler_ancestral"
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
- `proxy`:直连就留空;墙内填本地代理,如 `http://127.0.0.1:7890`。也可用环境变量 `NAI_API_KEY` / `NAI_PROXY`。
|
|
45
|
+
- `outDir`:留空 = `~/nai-output`。
|
|
46
|
+
- token 明文存在家目录的 JSON 里(和 DSH 自己的配置同一个地方),别提交进仓库。
|
|
47
|
+
|
|
48
|
+
## Anlas:什么免费
|
|
49
|
+
|
|
50
|
+
Opus 的「不限量」只覆盖免费档:单张、≤28 步、约 1MP 以内。
|
|
51
|
+
|
|
52
|
+
- 832×1216 / 28 步 / 1 张 → 免费
|
|
53
|
+
- 30 步、1216×1216、`n=4` → 扣费;402 就是余额不够
|
|
54
|
+
- V5 标准尺寸 → 同样免费
|
|
55
|
+
- 角色参考 / 氛围迁移 → 另外计费
|
|
56
|
+
|
|
57
|
+
**不花钱看余额**:发一个必然超额的请求(如 1216×1216),402 的 body 里有 `Required: X, Available: Y`。
|
|
58
|
+
|
|
59
|
+
## 注意
|
|
60
|
+
|
|
61
|
+
- 同账号同时只能跑一个任务,第二个会 429,等约 15 秒。
|
|
62
|
+
- V4/V4.5 必须带 `v4_prompt` / `v4_negative_prompt`,插件已经替你拼好。
|
|
63
|
+
- 提示词手册在 [docs/prompt-guide.md](docs/prompt-guide.md):画风复现、V5、角色参考、Anlas 账、参考图 API。
|
|
64
|
+
- 参考图(Character Reference / Vibe Transfer)**尚未实现**。
|
|
65
|
+
|
|
66
|
+
## 许可
|
|
67
|
+
|
|
68
|
+
MIT
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# NovelAI 4.5 角色参考(Character Reference):一张图当 LoRA 用
|
|
2
|
+
|
|
3
|
+
> 来源:B 站「【NAI教程】一张图训练LoRA绘制自己喜欢的角色|NovelAI 4.5 角色参考 教程」(UP:衡鲍,13:03)。正文结论全部来自视频画面与烧录字幕,字幕没提到的参数不补。
|
|
4
|
+
|
|
5
|
+
## 0. 先说结论:没有「训练」这回事
|
|
6
|
+
|
|
7
|
+
标题里的「一张图训 LoRA」是比喻。Character Reference 不训练权重、不产出 LoRA 文件,所以**没有训练参数、没有耗时、也没有触发词**。它做的是:每次生成时由内部模型现场分析参考图 → 提取一个外观向量(发色、发型、脸型、服装等)→ 直接注入当前采样流程。
|
|
8
|
+
|
|
9
|
+
对比传统 LoRA(视频里的原话逻辑):SD 之类要「准备几十上百张图」「训练出新的权重修正矩阵」才能「长期复现」;Character Reference 是「每次都需要重新分析」,换来一张图即改即用。
|
|
10
|
+
|
|
11
|
+
## 1. 入口与面板
|
|
12
|
+
|
|
13
|
+
- 打开 novelai.net/image,模型选 **NAI Diffusion V4.5 Full**(多角色演示那段用的是 V4.5 **Curated**,两个都能用)。
|
|
14
|
+
- 左侧提示词框下方有两个按钮:**Vibe Transfer**、**Character Reference**。点 Character Reference 弹出独立面板,把图拖进槽位;按钮上会显示缩略图。
|
|
15
|
+
- 面板内还有一个 **Style Aware** 开关(默认勾选)。作者的操作是**导入参考图后把它关掉**;字幕另有一句「平时大家生成时可以保持这个」,即不导参考图时开着即可。
|
|
16
|
+
|
|
17
|
+
## 2. 参考图怎么挑(作者给的规范,逐条)
|
|
18
|
+
|
|
19
|
+
- 不要出现多个角色或背景;
|
|
20
|
+
- 人物尽量完整;
|
|
21
|
+
- 不要有闭眼之类遮挡特征的动作;
|
|
22
|
+
- 背景可以是透明通道 PNG;
|
|
23
|
+
- 背景最好不要过于复杂;
|
|
24
|
+
- 分辨率用 NovelAI 预设里【大】档的三种之一:**1024×1536 / 1472×1472 / 1536×1024**;
|
|
25
|
+
- 构图对齐:目标图是上半身,就**只导入上半身立绘**(视频原话「则最好只导入上半身的立绘」);
|
|
26
|
+
- 最好附上对应作品的风格。
|
|
27
|
+
|
|
28
|
+
视频演示里他同时放了全身、上半身、透明背景刘海特写几张,用来分别锁不同层级的特征。
|
|
29
|
+
|
|
30
|
+
## 3. 计费:按「每次生成」算
|
|
31
|
+
|
|
32
|
+
- Character Reference:**每次生成 +5 Anlas**(基础费用另算),幻灯片写的是「基础费用 + 5 Anlas / per generation」;
|
|
33
|
+
- **一次性导入 +2 Anlas**,之后每次生成 +5 Anlas;
|
|
34
|
+
- Img2Img、Vibe Transfer、Character Reference 三者的计费结构相同;
|
|
35
|
+
- 坑:字幕强调「而且是【每次生成】不是【每次导入】」——即便最高等级会员用户,也按生成次数扣。
|
|
36
|
+
|
|
37
|
+
## 4. 显性特征 vs 隐性特征
|
|
38
|
+
|
|
39
|
+
- Character Reference **只识别角色的显性特征**(看得见的:发色、发型、瞳孔、服装);
|
|
40
|
+
- 「模型只能依据【看得见的信息】来生成」,表情、习惯这类看不见的部分它只能靠风格描述去猜;
|
|
41
|
+
- 正确做法:参考图管显性,**角色提示词补隐性**,「补充好后再次生成,则结合了角色的显性和隐性特征」。
|
|
42
|
+
- 另一个坑:细节「几乎会被主提示词内的风格完全覆盖」——主提示词里的风格词越重,参考图的瞳孔等细节越容易被吃掉。
|
|
43
|
+
|
|
44
|
+
## 5. 多角色 + 角色参考
|
|
45
|
+
|
|
46
|
+
- 右侧 **Character Prompt** 面板 → **Add a Character**,出现「角色 1」「角色 2」两个槽位(可继续加)。
|
|
47
|
+
- 主提示词写整体,视频里的写法:`[(two prompts: 1.5::1 girl and 1 boy 2-character), 1.2::standing by riverside, golden twilight background, reverse light, golden lights, wheats on the side of the river, ancient vibe.`
|
|
48
|
+
- 角色 1 / 角色 2 里分别写这个角色的显性 + 隐性特征(他用英文 tag,也演示了中文描述)。
|
|
49
|
+
- 槽位与参考图**一一对应**:slot 1 对应角色 1,slot 2 对应角色 2,不会自动错位——字幕原话「为 SLOT1 和 SLOT2 注入了基本的特征」。
|
|
50
|
+
- 主要坑:主提示词与角色提示词**共享语境**(都写了 two girls / girl / 同一风格),导致「AI 往往会犯 reference 的一部分特征」「长相像 a 和 b 的融合」,或者主提示词影响角色 1。
|
|
51
|
+
- 解法:**尽量分别描写**两个角色的显性与隐性特征,「减少共享语境造成的扩散」;要精准就**单独生成一次目标人物的单人图**,「细节还原更到位」。
|
|
52
|
+
- 补救手段:局部崩了用 **inpaint** 修(他演示时也翻车过,「但很不凑巧」)。
|
|
53
|
+
|
|
54
|
+
## 6. 数值速查
|
|
55
|
+
|
|
56
|
+
| 项目 | 值 |
|
|
57
|
+
|---|---|
|
|
58
|
+
| 参考图分辨率 | 1024×1536 / 1472×1472 / 1536×1024 |
|
|
59
|
+
| 参考图张数 | 多槽位(演示 3 张:全身 / 上半身 / 透明背景特写) |
|
|
60
|
+
| 参考强度 / 保真度滑杆 | 面板中未出现,视频未讲(不编) |
|
|
61
|
+
| 计费 | 导入 +2 Anlas 一次;每次生成 +5 Anlas |
|
|
62
|
+
| 模型 | NAI Diffusion V4.5 Full / Curated |
|
|
63
|
+
|
|
64
|
+
## 7. 角色一致性操作清单(5 条)
|
|
65
|
+
|
|
66
|
+
1. **一张干净的图**:单人、无复杂背景(或透明 PNG)、不闭眼、分辨率落在 1024×1536 / 1472×1472 / 1536×1024,构图与目标一致(要半身就给半身)。
|
|
67
|
+
2. **关掉 Style Aware 再导图**,主提示词里的风格词别压太重,否则参考图的瞳孔、发丝细节会被风格覆盖。
|
|
68
|
+
3. **参考图管显性、角色提示词管隐性**:把表情、年龄、服装材质、动作习惯这些「看不见的」写进角色提示词,再生成一次。
|
|
69
|
+
4. **多角色走 Character Prompt + Add a Character**:主提示词只写场景与构图,两个角色各自写特征;发现串味就把共享词删干净,必要时先单人生成确认细节。
|
|
70
|
+
5. **算好 Anlas**:导入只花 2,但每次生成 +5(基础费另算)——批量试错前先想清楚要抽几次。
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# NovelAI 4.5 Full 提示词体系笔记
|
|
2
|
+
|
|
3
|
+
> 来源:B 站《【NAI入门教程】从零开始 60 分钟掌握最强二次元 AI 画图工具|NovelAI 4.5 Full(2025)》
|
|
4
|
+
> https://www.bilibili.com/video/BV1TeMbzwExw/ (61 分钟,7 章:准备工作 / 总览 / 提示词 / 高级设置 / 多角色 / 工具箱 / 氛围转移)
|
|
5
|
+
> 视频无字幕轨,本笔记基于音轨转写 + 关键画面核对,数字可在括注时间点复核。
|
|
6
|
+
|
|
7
|
+
## 一、模型与额度
|
|
8
|
+
|
|
9
|
+
- 4.5 分 **Full(完整版)** 与 **Curated(精选版)**:Curated 训练集不含 NSFW、也画不出,Full 无限制且功能更全,但"不代表效果一定更好"(06:49–07:10)。
|
|
10
|
+
- 角色知识库覆盖到 **2025 年 6 月** 前有概念的角色(14:34)。
|
|
11
|
+
- 正面提示词(Base + 角色提示词)合计上限 **512 token ≈ 380 英文单词**;负面(Undesired Content + 负面角色提示词)另算 **512 token**(07:28–08:01)。
|
|
12
|
+
- 勾选 `Quality tags enabled` 时自动补 **16 token** 通用质量词(07:45)。
|
|
13
|
+
|
|
14
|
+
## 二、提示词结构与书写顺序
|
|
15
|
+
|
|
16
|
+
两类写法:**词条式**(逗号分隔 tag)与**自然语言式**(4.5 已能还原"红立方体上方放蓝立方体、绿球紧贴左侧"这类空间关系)。
|
|
17
|
+
|
|
18
|
+
推荐九段式顺序(13:32–13:50,作者强调非强制,但有助于思路组织与稳定性):
|
|
19
|
+
|
|
20
|
+
1. 艺术家与风格
|
|
21
|
+
2. 角色数量与性别(one girl / two characters…)
|
|
22
|
+
3. 角色身份与性质(角色名 + 作品名,可直接调用知识库)
|
|
23
|
+
4. 身体特征
|
|
24
|
+
5. 服装与配饰
|
|
25
|
+
6. 动作与表情
|
|
26
|
+
7. 环境与背景
|
|
27
|
+
8. 光影与视角
|
|
28
|
+
9. 整体风格
|
|
29
|
+
|
|
30
|
+
关键取舍:**角色名写对后,4–6 段可大幅省略**(16:49);只有冷门角色才需要堆外观 tag。
|
|
31
|
+
|
|
32
|
+
角色提示词写法(14:54–16:40):
|
|
33
|
+
|
|
34
|
+
- 格式 `角色名 (作品名)`,可选中间插 `(皮肤/外观名)`;角色名与作品名必须拼写完全正确,大小写不敏感。
|
|
35
|
+
- 含空格的人名、多词作品名必须用**空格或下划线**隔开;括号推荐半角。
|
|
36
|
+
- 只认 ASCII 基本拉丁字符:带变音符号的名字要改写成无变音拼写,否则识别不到。
|
|
37
|
+
|
|
38
|
+
## 三、权重语法
|
|
39
|
+
|
|
40
|
+
- **花括号**:`{tag}` = ×1.1,`[tag]` = ×0.9,可叠加。
|
|
41
|
+
- **数字权重**(4.5 新增):`1.2::tag::`,tag 前后各两个**半角**冒号,最前面的冒号前写数字;全角无效。
|
|
42
|
+
- 不写结尾 `::` 时,数字会一直作用到后面的所有 tag,直到结束。
|
|
43
|
+
- 批量给一段 tag 同权重:`1.4::tagA, tagB, tagC::`。
|
|
44
|
+
- 以数字结尾的 tag(如 `z3z4`)后紧跟 `::` 会被误读为新权重开头,需在 tag 末尾补 `_`、逗号或空格(19:11–19:48)。
|
|
45
|
+
|
|
46
|
+
颜色提示:增强=红、降低=蓝、数字权重范围=绿(前提是没在齿轮里关掉"强调权重")。
|
|
47
|
+
|
|
48
|
+
**去色实验**(20:00–20:50):给 colorful 逐级加权 1.0 → 2.0 → 4.0/8.0,画面逐步失彩直至全灰。8 倍若用 `{}` 要 **22 个**(≈1.1²²≈8),2 倍要 7 个(≈1.95)。等价写法:正面 `-8::colorful::` 或负面 `8::colorful::`。
|
|
49
|
+
|
|
50
|
+
但权重是**非线性映射**,不是数字越大越听话;实战建议集中在 **1.0–2.0**(20:54–21:09)。
|
|
51
|
+
|
|
52
|
+
实战示例(21:15–23:40):`one girl` 2 倍防多余角色、角色身份 1.5 倍;"头发遮一只眼"给 **0.8** 防遮过头;"白色灯笼裤"给 2 倍却连带把构图改成回头侧身——该 tag 在训练集常与俏皮回望构图同现,**暗含构图影响的词比直白构图词更强势**;`white background` 加到 3–8 倍也只影响背景,因为它是条件信息而非画面主体。锁上半身用 `3.5::upper body close-up::`,同时删掉上半身看不到的服饰 tag。
|
|
53
|
+
|
|
54
|
+
## 四、强度 Power 与引用数 Frequency
|
|
55
|
+
|
|
56
|
+
- **Power**:模型训练中自然学到的默认强度;手写权重只是在其上放大/抑制。
|
|
57
|
+
- **Frequency**:tag 在 Danbooru 类图站的作品数,越高通常越强。
|
|
58
|
+
- 对照(24:22–24:52):初音未来(2007,87,401)Power 已封顶 **10000**;白上吹雪(2019,688)约 5200;25 年 6 月新角色(28)仅约 200。
|
|
59
|
+
- 关系近似**对数**:引用 10→1000 提升明显,2000→3000 几乎平坦,约 **3000 引用即触顶**(25:23–25:47)。
|
|
60
|
+
- 推论:新角色 tag 强度低 → 五官发型易漂、一致性差,多角色同框更易被污染。估算方式:Danbooru 查引用数(1girl 650 万、2girls 170 万),再用 NAID Tag Search 查相邻引用数对应的强度(该站 2024 年后停更)。
|
|
61
|
+
|
|
62
|
+
## 五、画面内文字
|
|
63
|
+
|
|
64
|
+
Base Prompt 写完后**空一行(Shift+Enter,直接回车会触发生成)**,再用大写 `Text:` 跟文字;配合 `text`、`english text` 生效。多条文字必须改用自然语言交代"谁说哪句、什么颜色、什么气泡",且只有第一段前写 `Text:`(26:51–29:40)。
|
|
65
|
+
|
|
66
|
+
## 六、角色提示词(多角色)
|
|
67
|
+
|
|
68
|
+
- 工作区下滑 → `Character Prompts` → 新增并选性别,**最多 6 个**;与基础提示词**共享 512 token**,风格仍受基础提示词影响(38:01–38:41)。
|
|
69
|
+
- 基础提示词只写:艺术家与风格、**精确角色数量**、环境背景、光影视角、整体风格;性别、身份、外观、服装、动作写进各角色栏(39:03–39:41)。
|
|
70
|
+
- 位置:默认 `Character Positions Global` 交给 AI,关掉后可手动指定 **5×5 = 25 格**(横 A–E、纵 1–5,原点左上)。示例角色 1 在 B3、角色 2 在 D3。
|
|
71
|
+
- 排布建议:角色周围 8 格别再放人(否则属性重叠、风格混合);边缘格易被裁切;方图放中间 9 格,竖图 B1–D5,横图 A2–E4(41:24–41:59)。
|
|
72
|
+
- **互动标签**(42:02 起,最实用):施动方 `source:动作`,受动方 `target:同一动作`;双向同动作写 `mutual:动作`,比两边都写 `imitate pose` 更准。要肢体接触就把两人放相邻或同格(都在 C3);cosplay 换装必须同坐标,且主提示词写 `one girl` / `one character`。
|
|
73
|
+
|
|
74
|
+
## 七、负面提示词与质量词
|
|
75
|
+
|
|
76
|
+
- 负面区即 `Undesired Content`,与负面角色提示词共享 512 token;界面有**预设**可选,作者建议"按需调预设,其余保持默认"(08:16–08:29)。
|
|
77
|
+
- 视频**没有给固定必备清单**,实际做法是:默认开 `Quality tags enabled`(自动 16 token 质量词)+ 用预设打底,再按出图问题追加;展示案例的负面提示词超过 300 token(30:17 画面注释)。
|
|
78
|
+
- 正负互补:压某词可正面 `-8::tag::`,也可负面 `8::tag::`(20:40)。
|
|
79
|
+
- 质量词实际形态:`quality, very aesthetic, absurdres, masterpiece, best quality`。
|
|
80
|
+
- 画师 tag 放最前,一两个画师名就能替代大段外观/风格描述,是省 token 的主要手段(13:34、16:52)。
|
|
81
|
+
|
|
82
|
+
## 八、参数与推荐值
|
|
83
|
+
|
|
84
|
+
| 参数 | 视频结论 |
|
|
85
|
+
|---|---|
|
|
86
|
+
| Steps | 默认 **23**;推荐 **23–28**;1–22 效果不佳,29–50 只涨点数(31:10–31:18) |
|
|
87
|
+
| Prompt Guidance | 默认 **5**;调低=提示词整体变弱、风格变差;调到 10 严重失真(32:00–33:30) |
|
|
88
|
+
| Variety+ | 控制 AI 主动发挥,与 Guidance 的"听不听话"是两件事 |
|
|
89
|
+
| Prompt Guidance Rescale | 能救高 Guidance 崩坏(10→0.6 回正常),但作者**不推荐**(34:22–34:49) |
|
|
90
|
+
| Sampler / Noise Schedule | 影响很小,保持默认(Euler Ancestral)(34:54–35:12) |
|
|
91
|
+
| Seed | 同提示词+同 seed ≈ 同图;换提示词同 seed = 构图相似、内容不同 |
|
|
92
|
+
| 分辨率 | 832×1216(竖)/ 1024×1024(方)/ 1216×832(横);**长宽乘积 < 约 108 万像素**时最高档会员免费(36:37、51:12),手动改尺寸自动按 32/64 对齐 |
|
|
93
|
+
| 尺寸档 | Normal 20 点 / Large 30 / Wallpaper 40 / Small 8(09:01) |
|
|
94
|
+
|
|
95
|
+
## 九、视频里可直接抄的示例
|
|
96
|
+
|
|
97
|
+
1)权重骨架(21:15 起的结构):`2::one girl::, 1.5::角色名 (作品名)::, 0.8::hair over one eye::, 2::white bloomers::, looking back, 3::white background::`
|
|
98
|
+
2)锁上半身:`3.5::upper body close-up::`,并存删所有下半身服饰 tag。
|
|
99
|
+
3)全灰实验:正面 `8::colorful::` 或负面 `8::colorful::`;等价 22 个 `{}`。
|
|
100
|
+
4)多角色互动:基础 `2girls, ...`;角色 1 `source:holding clothes`,角色 2 `target:holding clothes`。
|
|
101
|
+
5)展示案例元数据(30:17 画面,他人授权作品,仅供风格参考):
|
|
102
|
+
`quality, very aesthetic, absurdres, masterpiece, 1.4::flat color, red skin, dark skin::, shiny skin, dark theme, simple background, thick thighs, thick calves::, 1::1girl, solo, {alternate costume}, {{{blurred foreground}}}::, head down, look down, newsboy cap, blouse, overcoat, shy, crossbody bag, one hand on cup, street, blurry background, pants, wind, crowd, hand in pocket, from above, falling leaves, red leaf, no text, best quality, very aesthetic, absurdres`(STEPS 50 / GUIDANCE 5 / 2176×1408)
|
|
103
|
+
|
|
104
|
+
## 十、通用模板
|
|
105
|
+
|
|
106
|
+
1)**单人立绘(最通用)**
|
|
107
|
+
正面:`best quality, very aesthetic, absurdres, 1girl, 角色名 (作品名), solo, looking at viewer, upper body, simple background, depth of field, 画师名`
|
|
108
|
+
负面:`lowres, bad anatomy, bad hands, extra digits, worst quality, low quality, jpeg artifacts, signature, watermark, username, blurry`
|
|
109
|
+
|
|
110
|
+
2)**半身特写(锁构图)**
|
|
111
|
+
正面:`1girl, solo, 1.2::角色名 (作品名)::, 3.5::upper body close-up::, looking at viewer, from above, 1.5::blurry background::, 画师名, best quality`
|
|
112
|
+
负面:`full body, legs, wide shot, lowres, bad hands, extra fingers, watermark, text`
|
|
113
|
+
|
|
114
|
+
3)**双人同框(防污染)**
|
|
115
|
+
基础:`2girls, outdoors, cinematic lighting, 画师名, best quality`
|
|
116
|
+
角色1(C3):`1girl, 角色A (作品A), source:holding hands`
|
|
117
|
+
角色2(C4):`1girl, 角色B (作品B), target:holding hands`
|
|
118
|
+
负面:`3girls, multiple girls, character fusion, extra limbs, lowres, watermark`
|
|
119
|
+
|
|
120
|
+
4)**画面带字**
|
|
121
|
+
正面:`1girl, solo, holding pillow, best quality`(空行)`Text: LOVE`,配合 `text, english text, pink cursive text`
|
|
122
|
+
负面:`extra text, watermark, cropped text, lowres, bad hands`
|
|
123
|
+
|
|
124
|
+
5)**风格统一(一组图复用)**
|
|
125
|
+
正面:`best quality, very aesthetic, {画师A}, {画师B}, 1girl, solo, upper body, warm lighting, film grain, no text`
|
|
126
|
+
负面:`lowres, worst quality, blurry, oversaturated, watermark, signature, text`
|
package/docs/notes-v5.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# NovelAI V5 提示词笔记
|
|
2
|
+
|
|
3
|
+
来源:[【NAI5教程】2026最强二次元AI画图工具!|NovelAI V5 保姆级教程](https://www.bilibili.com/video/BV1zi8R6wES1/)(17:28,全程硬字幕)。下文时间戳均可回查。
|
|
4
|
+
|
|
5
|
+
## 一、V5 相对 V4.5 到底改了什么
|
|
6
|
+
|
|
7
|
+
- **数据集**:覆盖到 2026 年 7 月(V4.5 停在 25 年 6 月),新增更多版权角色与作画风格(0:45–1:10)。
|
|
8
|
+
- **两个版本差异变大了**:V5 Full 母体更完整、V5 Curated 数据集更小;同一提示词在两者上"表现差异大"的概率比以往更新更高(1:40–2:00)。选错版本,后面调提示词都是白费。
|
|
9
|
+
- **提示词上限**:V5 Full 为 750 token(约 1220 个中文汉字 / 1090 个日文汉字 / 6000 个英文字符),约为 V4.5 的 3 倍(5:15–5:40)。
|
|
10
|
+
- **自然语言是最大变化**:V4.5 只能吃"提示词",V5 能读完整句子。视频拿 pixiv 作者"九夜 恋梦"的 910 token 长文举例,同样的文本放 4.5 会明显吃不消,V5 Full 能还原氛围(6:20–7:00)。
|
|
11
|
+
- **tag 还有用,但只擅长静态属性**:角色、服装、构图照旧堆 tag;一旦涉及"谁对谁做了什么",tag 就废了——"A 一边蹭掉嘴角的西瓜汁,一边转头接过 B 递来的西瓜",用 tag 几乎画不出来,画面里两个角色基本没有互动(7:05–7:40)。
|
|
12
|
+
|
|
13
|
+
## 二、语言与画面内文字
|
|
14
|
+
|
|
15
|
+
- **写提示词的效果排序**:English ≈ 日本語 > 中文 ≈ 其他语言。中文"效果欠佳"但可用,所以推荐**英文为主、中文长句作辅助**(7:30–8:10、10:45–11:00)。
|
|
16
|
+
- **让文字出现在画面里**:英文/日文最好,中文差,其他语言基本生不出。做法是**用英文半角双引号把要生成的文字括起来**,模型就会照写;日文可用「」(9:00–9:30)。
|
|
17
|
+
- 中英混合提示词完全可行,作者自己也这么用(9:35)。
|
|
18
|
+
|
|
19
|
+
## 三、权重语法
|
|
20
|
+
|
|
21
|
+
- 写法是 `权重:词条`,逗号分隔。视频截图原样:`girl, Takamoto Tomori, 1.5:full body, looking at viewer, opened mouth,`,以及 `1.3:text, Chinese text, speech bubble. A white speech bubble with black clean text`(9:55–10:03)。
|
|
22
|
+
- **从 1.0 往上加,且是非线性的**:1.1→1.3 几乎没有变化,到 **1.5–1.8** 才明显,极端需求要到 2.0 甚至 3.0–4.0(10:05–10:40)。别指望 1.1 的微调。
|
|
23
|
+
- **混合风格时反过来**:不要每个风格词条都上 1.5–2,压到 **0.1–1.0** 区间微调,例如 `0.8:风格1, 0.2:风格2, 0.3:风格3, 0.2:风格4`,让总权重收敛(10:25–10:40)。
|
|
24
|
+
|
|
25
|
+
## 四、参数与 V5 新设置项
|
|
26
|
+
|
|
27
|
+
- 全片演示参数一致:**Steps 28 / Guidance 5.6 / Sampler Euler**(6:20、7:12、12:07 三处界面截图相同)。
|
|
28
|
+
- 大图预设 `42 steps | Wallpaper 大图`,一张 **62 点**(11:50–12:15)。步数直接吃点数,**先用 28 步试提示词**,满意了再上 42 步出大图。
|
|
29
|
+
- **Base 下拉**:V5 Full / V5 Curated(另有 Anime 模型);负向提示词仍是原来的 Undesired content 栏,视频没有专门讲写法。
|
|
30
|
+
- **新词条**:年代感 `year 2026`、`retro`、`meta: novel era`、`meta: golden era`;立绘/背景 `visual novel sprite`、`visual novel background`;透明底 `transparent background` + `has alpha` + `alpha transparency`(配"导演工具–RemoveBG"效果更好,5:50–6:20)。
|
|
31
|
+
- **画面复杂度**(直接加在提示词最后):`low complexity` / `medium complexity` / `high complexity` / `ultra complexity`。一般高质量插画用 **high**;low 与 ultra 属于"特殊风格化需求",会明显改变画风和观感(11:15–11:45)。
|
|
32
|
+
- **风格词条可存成 chunk(preset)**,画质/光影/构图 tag 不用每次重输(5:00–5:15)。
|
|
33
|
+
|
|
34
|
+
## 五、多角色与漫画
|
|
35
|
+
|
|
36
|
+
- **Character Prompts** 在主提示词栏下方,一个角色一条,角色名要带系列名,如 `aria (series, zero, zero...)`;Position 可选 AI's choice 或 Custom(13:50–14:10)。
|
|
37
|
+
- 位置从 4.5 的 **5×5 网格升级为自由拖动**,拖动后必须点 **Finish Editing Positions** 才保存;画面上编号与提示词顺序一一对应(14:10–14:40)。
|
|
38
|
+
- 演示一次排了 6 个角色编号。
|
|
39
|
+
|
|
40
|
+
## 六、视频点名的坑
|
|
41
|
+
|
|
42
|
+
1. 用 tag 硬堆多角色互动 → 画面无互动、无氛围,必须改写成句子。
|
|
43
|
+
2. 想让画面出文字却用中文描述 → 中文文字生成效果差,要英文/日文并加引号。
|
|
44
|
+
3. 权重卡在 1.1–1.3 反复微调 → 非线性,白费力气,直接上 1.5+。
|
|
45
|
+
4. 混合风格时把每个风格词条都加权 → 画面糊、风格打架,应 0.1–1.0 并控制总和。
|
|
46
|
+
5. 多角色位置贴太近 → 身份特征互相污染(截图中红框警告)。
|
|
47
|
+
6. 复杂度词条当"画质开关"乱加 → low/ultra 会改画风,只有特殊风格化才用。
|
|
48
|
+
7. 版本没选对(Full vs Curated)就调提示词 → 差异比以往更大,先定版本。
|
|
49
|
+
|
|
50
|
+
## 七、V5 提示词模板
|
|
51
|
+
|
|
52
|
+
**1) 单人静态插画(tag 为主)**
|
|
53
|
+
```
|
|
54
|
+
1girl, solo, silver hair, blue eyes, black school uniform, standing, looking at viewer, 1.5:detailed eyes, depth of field, high complexity
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**2) 双人互动(自然语言为主)**
|
|
58
|
+
```
|
|
59
|
+
1girl, 1boy, indoors, kitchen. She wipes the watermelon juice from the corner of her mouth with the back of her hand, then turns her head to take the slice of watermelon he is holding out to her. Warm afternoon light, medium shot.
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**3) 画面内出文字**
|
|
63
|
+
```
|
|
64
|
+
1girl, holding a sign, text "SALE 50%", white speech bubble with black clean text, 1.3:text
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**4) 风格混合(权重压在 0.1–1.0)**
|
|
68
|
+
```
|
|
69
|
+
0.8:<风格A>, 0.2:<风格B>, 0.3:<风格C>, 1girl, full body, outdoors, high complexity
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**5) 多角色自由定位**
|
|
73
|
+
```
|
|
74
|
+
主体:2girls, indoors, sitting on sofa, looking at viewer, high complexity
|
|
75
|
+
Character 1:aria (series, zero, zero...), pink hair, ...
|
|
76
|
+
Character 2:sunna (series, zero, zero...), blonde hair, ...
|
|
77
|
+
Position:Custom → 拖动 → Finish Editing Positions
|
|
78
|
+
```
|