dsh-mo-image 0.4.1 → 0.5.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/CHANGELOG.md +15 -0
- package/README.md +21 -4
- package/THIRD-PARTY-NOTICES.md +32 -0
- package/lib/adapters.js +479 -76
- package/lib/client.js +1819 -288
- package/lib/config-guard.js +15 -2
- package/lib/index.js +79 -7
- package/lib/prompt-profiles.js +2 -1
- package/locale/messages.csv +30 -11
- package/package.json +2 -1
- package/skills/mo-image-editing/SKILL.md +1 -0
- package/skills/mo-image-generation/SKILL.md +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
|
+
## v0.5.0
|
|
4
|
+
|
|
5
|
+
1. ComfyUI 预设优化,现在可以适配几乎所有类型的模型。
|
|
6
|
+
2. ComfyUI 补上JSON格式工作流输入,方便用户使用不同的工作流(在模型列表中删除按钮左边的模型选项按钮中输入)。
|
|
7
|
+
3. 修复 FLUX.2 与 MOSS-Image 共存时选错文本编码器与 VAE 的问题(`qwen3.5_9b`、`_small` 归 MOSS,`qwen_3_4b`、`flux2-vae` 归 FLUX),此前会报矩阵形状不匹配。
|
|
8
|
+
4. ComfyUI 执行失败时不再笼统报「没有返回图片」,改为原样抛出节点异常信息。
|
|
9
|
+
5. 放宽了dsh的权限,给生图模型列表读取提供了工具,避免dsh无法读取生图模型列表。
|
|
10
|
+
6. 进行了一些UI上的优化。
|
|
11
|
+
|
|
12
|
+
## v0.5.0-a1
|
|
13
|
+
|
|
14
|
+
1. 生图模型选择器新增皮肤层:默认沿用原版对话模型选择器的类名与结构;检测到 `dsh-codex-model-effort-selector` 接管对话席时,自动切换为同款 Codex 弹层。
|
|
15
|
+
6. 未知接管型美化插件走触发器样式采样的通用降级,不再强行套原版外观。
|
|
16
|
+
8. Codex 皮肤的几何、色板与粒子分布改编自 dsh-codex-model-effort-selector(MIT)。
|
|
17
|
+
|
|
3
18
|
## v0.4.1
|
|
4
19
|
|
|
5
20
|
1. 优化了请求参数,减少模型调用错误的情况发生。
|
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
- 图片编辑:保留原图,只改指定部分
|
|
11
11
|
- 参考图:支持 1–16 张本地图片或 URL
|
|
12
12
|
- 多模型:不同提供商、不同模型可随时切换
|
|
13
|
+
- 选择器皮肤:默认跟随原版对话模型选择器;检测到 Codex 风格美化插件时自动切换同款弹层
|
|
13
14
|
- 模型感知提示词:按当前模型注入对应的写法、公式和约束
|
|
14
15
|
- 对话内直接显示生成结果
|
|
15
16
|
|
|
@@ -78,9 +79,12 @@ npm run release -- minor --dry-run # 只看会做什么
|
|
|
78
79
|
| API 地址 | OpenAI Images 兼容地址,通常以 /v1 结尾 |
|
|
79
80
|
| API 密钥 | 对应平台的 Key |
|
|
80
81
|
| 模型 ID | 例如 gpt-image-2.5-flare |
|
|
82
|
+
| 显示名称 | 可选;对话里的模型名,留空就用模型 ID |
|
|
81
83
|
|
|
82
84
|
保存后,在对话输入框右侧选择当前生图模型。
|
|
83
85
|
|
|
86
|
+
「模型目录」沿用 DSH 对话模型设置页的模型行:拖动手柄(或聚焦手柄后按上下方向键)调整顺序,顺序就是选择器里的顺序;「获取可用模型」会把上游列出的模型连同显示名一起带回来,已加入列表的模型默认勾选,勾选结果就是新的模型列表。
|
|
87
|
+
|
|
84
88
|
内置了几家官方或大型模型平台,也可以选择“自定义模型 API”,填写自部署或其他兼容接口。
|
|
85
89
|
|
|
86
90
|
## 多语言
|
|
@@ -94,6 +98,19 @@ npm run release -- minor --dry-run # 只看会做什么
|
|
|
94
98
|
- 宿主设置接口的报错会附带稳定的 `code`/`params`(见 [`lib/localized-error.js`](lib/localized-error.js)),前端按当前语言重写整句;工具调用和宿主日志仍保留原始中文,模型看到的提示词不受影响。新增宿主错误时,在 `SERVER_ERROR_CODES` 里加 code,并在 CSV 加 `serverError.<code>`。
|
|
95
99
|
- 缺 key 时按 DSH 的 locale 回退链回退到英文,再回退到 key;没有 locale 服务的环境(例如纯单测)回退到中文。
|
|
96
100
|
|
|
101
|
+
## 选择器皮肤
|
|
102
|
+
|
|
103
|
+
生图席挂在输入框右侧(`conversation.input.right`),默认沿用 DSH 原版对话模型选择器的类名与结构:类名从当前样式表解析,菜单、搜索、分组、键盘行为和原版对齐;只改 CSS 的主题会自动覆盖到它。
|
|
104
|
+
|
|
105
|
+
如果对话席被 [dsh-codex-model-effort-selector](https://github.com/ABING1111/dsh-codex-model-effort-selector) 这类接管型美化插件替换,插件会检测 `.cmes-*` DOM 并切换成同一套 Codex 皮肤:
|
|
106
|
+
|
|
107
|
+
- **质量**占据「推理等级」的位置:滑条按当前模型实际公布的档位排列(Auto 紧挨着 Off,不会被当成最高档),每档一色;拖动/键盘/Home/End 都可改档,最高档触发紫罗兰、星尘动画和「更快消耗使用额度」提示。
|
|
108
|
+
- 点弹层中间的档位标题进入 **provider → 模型**两级下钻,带搜索、当前勾选和「N 档」徽标。
|
|
109
|
+
- **⚡ Fast** 是左侧工具(纯视觉,和 Codex 一样,按会话记住;开启时滑条会走 fast-mode 动画;不挂悬停提示),**齿轮**是右侧「其他设置」工具,里面分组放尺寸和提示词优化,内容超高时可滚动。
|
|
110
|
+
- 弹层通过 portal 挂到 `document.body`,不赌输入区祖先没有 transform/filter/backdrop-filter,避免定位偏移和被裁剪。
|
|
111
|
+
|
|
112
|
+
未知的接管型插件没有公共协议,插件只采样它触发器的尺寸/字号/颜色做通用降级,弹层仍用宿主 token 自绘;这样并排不违和,但不承诺逐像素一致。想做到 1:1,需要和对方约定皮肤标记或 CSS 变量。
|
|
113
|
+
|
|
97
114
|
## 使用
|
|
98
115
|
|
|
99
116
|
直接对模型说:
|
|
@@ -121,11 +138,11 @@ npm run release -- minor --dry-run # 只看会做什么
|
|
|
121
138
|
|
|
122
139
|
## 质量档位
|
|
123
140
|
|
|
124
|
-
质量档位由「当前模型」决定,宿主通过 `/api/mo-image/config` 的 `capabilities`
|
|
141
|
+
质量档位由「当前模型」决定,宿主通过 `/api/mo-image/config` 的 `capabilities` 下发。原版皮肤里,没有官方质量参数的模型隐藏这一行;Codex 皮肤里显示「此模型未提供质量档位」,但尺寸和提示词优化仍可从弹层工具进入。GPT-Image 的 `Auto` 是模式而不是画质档,滑条里紧挨着 `Off` 放,不排到最高档。
|
|
125
142
|
|
|
126
143
|
| 模型族 | 质量行 | 选项 |
|
|
127
144
|
|---|---|---|
|
|
128
|
-
| OpenAI GPT-Image | 显示 | Off / Low / Medium / High
|
|
145
|
+
| OpenAI GPT-Image | 显示 | Off / Auto / Low / Medium / High |
|
|
129
146
|
| OpenAI DALL·E 3 | 显示 | Off / Standard / HD |
|
|
130
147
|
| Ideogram 3 | 显示 | Off / Turbo / Default / Quality |
|
|
131
148
|
| Google Gemini / Nano Banana | 隐藏 | 只有尺寸/比例,没有 quality |
|
|
@@ -143,7 +160,7 @@ npm run release -- minor --dry-run # 只看会做什么
|
|
|
143
160
|
|
|
144
161
|
## 提示词优化
|
|
145
162
|
|
|
146
|
-
|
|
163
|
+
生图模型选择器里新增「提示词优化」,默认 **On**(原版皮肤在首页一栏;Codex 皮肤在右侧齿轮「其他设置」页的「提示词」分组里):
|
|
147
164
|
|
|
148
165
|
- **On**:保持现在的行为,按当前模型的提示词方言扩写/整理 prompt。
|
|
149
166
|
- **Off**:要求模型尽量把用户原话直接传给生图工具,不扩写、不补风格/光线/构图,也不自动补 negative prompt;只有用户明确说“优化/改写提示词”时才优化。
|
|
@@ -372,4 +389,4 @@ $DSH_HOME/.credentials.yaml
|
|
|
372
389
|
|
|
373
390
|
## License
|
|
374
391
|
|
|
375
|
-
MIT
|
|
392
|
+
MIT。Codex 皮肤的几何、色板与粒子分布改编自 [dsh-codex-model-effort-selector](https://github.com/ABING1111/dsh-codex-model-effort-selector)(MIT),完整许可见 [THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md)。
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
## dsh-codex-model-effort-selector
|
|
4
|
+
|
|
5
|
+
The Codex-skin geometry (272×104 popover, 30px knob, rail padding), the
|
|
6
|
+
per-level colour ramps (light/dark), the deterministic sparkle/bloom
|
|
7
|
+
distribution, the ⚡ Fast toggle/`fast-mode` class contract, the peak
|
|
8
|
+
gradient/sparkle treatment and several interaction details in `lib/client.js`
|
|
9
|
+
are adapted from
|
|
10
|
+
[dsh-codex-model-effort-selector](https://github.com/ABING1111/dsh-codex-model-effort-selector).
|
|
11
|
+
|
|
12
|
+
MIT License
|
|
13
|
+
|
|
14
|
+
Copyright (c) 2026 dsh-codex-model-effort-selector contributors
|
|
15
|
+
|
|
16
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
17
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
18
|
+
in the Software without restriction, including without limitation the rights
|
|
19
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
20
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
21
|
+
furnished to do so, subject to the following conditions:
|
|
22
|
+
|
|
23
|
+
The above copyright notice and this permission notice shall be included in all
|
|
24
|
+
copies or substantial portions of the Software.
|
|
25
|
+
|
|
26
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
27
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
28
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
29
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
30
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
31
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
32
|
+
SOFTWARE.
|