dsh-image-gen 0.8.6 → 0.9.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/README.en.md CHANGED
@@ -22,6 +22,10 @@
22
22
  <a href="https://linux.do/"><img src="https://img.shields.io/badge/LINUX%20DO-Community-555?style=flat-square" alt="LINUX DO" /></a>
23
23
  </p>
24
24
 
25
+ <p>
26
+ <a href="https://atomgit.com/shanliuling/dsh-image-gen"><img src="https://atomgit.com/shanliuling/dsh-image-gen/star/new_badge.svg" alt="AtomGit" height="55" /></a>
27
+ </p>
28
+
25
29
  <p>
26
30
  <a href="#quick-start">Quick Start</a> ·
27
31
  <a href="#core-capabilities">Core Capabilities</a> ·
@@ -111,11 +115,17 @@ pnpm dsh plugin --profile web add ./dsh-image-gen
111
115
 
112
116
  ### 2. Configure a Provider
113
117
 
114
- After restarting DSH, open:
118
+ After restarting DSH, click the **Plugins** icon in the left sidebar, then click **dsh-image-gen** under **Installed** — the Image Generation settings form lives on the plugin's detail page:
115
119
 
116
- **Settings → Plugins → Image Generation**
120
+ **Plugins panel → Installed → dsh-image-gen**
117
121
 
118
- > On DSH 0.1.5 and earlier the entry is **Settings → Plugins → Plugin Configuration → Image Generation**; the same plugin build supports both.
122
+ <div align="center">
123
+ <img src="docs/assets/readme/plugins-entry.webp" alt="Click Plugins in the left sidebar, then dsh-image-gen under Installed" width="100%" />
124
+ <br />
125
+ <sub>Click the Plugins icon in the left sidebar, then dsh-image-gen under Installed to open its detail page.</sub>
126
+ </div>
127
+
128
+ > DSH 0.1.5 and earlier have no Plugins panel; the entry there is **Settings → Plugins → Plugin Configuration → Image Generation**. The same plugin build supports both.
119
129
 
120
130
  Choose a Provider, enter your API key, and adjust the model, Endpoint / Base URL, and workspace-save options as needed. Once the key is stored, click **Test connection** to verify it, or **Fetch models** to pull every image-capable model the provider offers—no manual lookups needed. For ComfyUI, enter an address reachable by the DSH Host and import an **API Format Workflow JSON** file.
121
131
 
@@ -138,10 +148,10 @@ Keep the character and composition unchanged, then add black sunglasses to the c
138
148
  <br />
139
149
 
140
150
  <div align="center">
141
- <img src="docs/assets/readme/provider-settings.webp" alt="DSH Plugin Settings" width="46%" />
151
+ <img src="docs/assets/readme/plugin-detail.webp" alt="Provider settings form on the dsh-image-gen detail page" width="46%" />
142
152
  <img src="docs/assets/readme/chat-example.webp" alt="Chat generation and editing example" width="46%" />
143
153
  <br />
144
- <sub>Left: Provider Settings · Right: In-chat generation, editing, and continuous refinement.</sub>
154
+ <sub>Left: Provider settings on the plugin detail page · Right: In-chat generation, editing, and continuous refinement.</sub>
145
155
  </div>
146
156
 
147
157
  <br />
@@ -312,8 +322,8 @@ Bring private image generation on your local GPU directly into Agent conversatio
312
322
  | Provider | Aspect ratios | Quality tiers |
313
323
  | :--- | :--- | :--- |
314
324
  | Google Gemini | 1:1 · 3:2 · 2:3 · 4:3 · 3:4 · 4:5 · 5:4 · 16:9 · 9:16 · 21:9 | 1K / 2K / 4K |
315
- | OpenAI Images | 1:1 · 3:2 · 2:3 · 4:3 · 3:4 · 16:9 · 9:16 | auto / low / medium / high |
316
- | OpenAI Compatible | Driven by `openaiCompatSizes` (default 1:1 · 3:2 · 2:3) | Same table (default standard) |
325
+ | OpenAI Images | gpt-image-2 family: 1:1 · 3:2 · 2:3 · 4:3 · 3:4 · 16:9 · 9:16 | Resolution: 1K / 2K (also 4K for landscape/portrait widescreen); separate quality: auto / low / medium / high |
326
+ | OpenAI Compatible | Driven by `openaiCompatSizes` (default 1:1 · 3:2 · 2:3) | Resolution from the size table; separate configurable quality, omitted by default |
317
327
  | ByteDance Seedream | auto · 1:1 · 3:2 · 2:3 · 4:3 · 3:4 · 16:9 · 9:16 · 21:9 | 2K / 3K / 4K |
318
328
  | Aliyun DashScope | 1:1 · 3:2 · 2:3 · 4:3 · 3:4 · 16:9 · 9:16 | standard |
319
329
  | xAI Grok Imagine | auto · 1:1 · 3:2 · 2:3 · 4:3 · 3:4 · 16:9 · 9:16 · 21:9 | 1K / 2K |
@@ -323,7 +333,12 @@ Bring private image generation on your local GPU directly into Agent conversatio
323
333
  | Google subscription | auto · 1:1 · 3:2 · 2:3 · 4:3 · 3:4 · 4:5 · 5:4 · 16:9 · 9:16 · 21:9 | standard / HD (4K) |
324
334
 
325
335
  > An `auto` ratio lets the model pick the framing from the prompt; tiers the upstream dropped (e.g. Seedream 5.0's 1K) are never exposed.
326
- > OpenAI Compatible (relay) pickers are driven by the `openaiCompatSizes` setting, shaped as ratio → tier → pixels, e.g. `{ "16:9": { "2K": "2048x1152" } }`; an empty table keeps the legacy 1:1 / 3:2 / 2:3 + standard behavior.
336
+ > Google subscription discovers account projects with valid platform enums and includes the ordinary daily endpoint as a compatibility fallback. If discovery returns no project, the legacy compatibility project is still tried but is not cached as an actual account project. Generation failures retain redacted discovery, eligibility, and per-endpoint diagnostics instead of only the last 429. The subscription “Test connection” checks stored sign-in status; successful generation verifies image access for that account. A Code Assist `UNSUPPORTED_CLIENT` response alone does not establish that image generation is unavailable.
337
+ > Studio exposes separate aspect ratio, resolution, and generation quality controls for OpenAI and compatible providers. Resolution labels show pixel dimensions. Comparison and regeneration preserve these separate parameters.
338
+ > Official OpenAI size presets can be customized with `openaiSizes`, shaped as ratio → tier → pixels, e.g. `{ "16:9": { "2K": "2048x1152", "4K": "3840x2160" } }`. For the gpt-image-2 family, dimensions must be multiples of 16, the longest edge at most 3840, aspect ratio within 1:3–3:1, and total pixels within 655360–8294400. Outputs above 3686400 pixels have experimental upstream support. See the [official API reference](https://developers.openai.com/api/reference/resources/images/methods/generate). Older GPT Image models retain their three standard sizes.
339
+ > Compatible providers use `openaiCompatSizes` in the same format; an empty table retains the legacy sizes. `openaiCompatQuality` sets the default generation quality (empty means omitted), and `openaiCompatQualityOptions` sets Studio choices. Choosing “Provider default (omit)” omits quality for that request. Conversation tools also accept independent `size` and `quality` parameters.
340
+ > “Generation extra fields” maps to `openaiCompatExtraBody`, e.g. `{ "watermark": false }`. These fields apply only to generation, merge after standard fields, and can override matching keys; `false` and nested objects are preserved. Editing continues to use `openaiCompatEditExtra`. For JSON image URL array edits, `openaiCompatEditSizeMode` defaults to `auto`; set it to `selected` to send the selected dimensions. EditExtra can still override size.
341
+ > The workbench shows “Visible watermark: Channel default / Off / On” beside ratio and resolution, checking generation and editing separately. Seedream, native DashScope Qwen Image, and recognized official SenseNova and Qwen compatible endpoints enable it automatically; recognized compatible endpoints also select their JSON edit contracts automatically. SenseNova matches `https://token.sensenova.cn/v1` and `sensenova-u1.5-lite`; Qwen matches official workspace hosts under `/compatible-mode/v1` with Qwen Image 3.0/3.0 Pro or 2.1 Pro/Turbo. Other compatible channels can bind a boolean `watermark`, `watermark_enabled`, or `parameters.watermark` through the matching operation's extra fields; editing requires a JSON format. Unknown channels and Zhipu display a disabled “Support unconfirmed” control; interfaces without a confirmed switch also show an explanation. A model name alone does not identify an unknown relay. Channel default preserves configured fields or omits the parameter; an explicit choice overrides only the watermark field and is retained for batches, comparison models supporting the operation, and regeneration.
327
342
 
328
343
  </details>
329
344
 
@@ -344,7 +359,7 @@ Bring private image generation on your local GPU directly into Agent conversatio
344
359
  <details>
345
360
  <summary><strong>What should I do if “Image Generation” is missing after installation?</strong></summary>
346
361
 
347
- The settings entry depends on the DSH version: 0.1.6 and newer place it at **Settings → Plugins → Image Generation**, while 0.1.5 and earlier place it at **Settings → Plugins → Plugin Configuration → Image Generation**.
362
+ The settings entry depends on the DSH version: 0.1.6 and newer place it on the plugin's detail page (click **Plugins** in the left sidebar, then dsh-image-gen under **Installed**), while 0.1.5 and earlier place it at **Settings → Plugins → Plugin Configuration → Image Generation**.
348
363
 
349
364
  If it is missing in both places, fully restart the current DSH Profile, then inspect the plugin configuration:
350
365
 
@@ -410,6 +425,10 @@ Saving settings on modern DSH requires the actually loaded `@deepseek-ai/schemas
410
425
 
411
426
  Feedback is welcome through [Issues](https://github.com/shanliuling/dsh-image-gen/issues). Read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a Pull Request.
412
427
 
428
+ ## Acknowledgements
429
+
430
+ - [AtomGit](https://atomgit.com/shanliuling/dsh-image-gen): Hosts a copy of the project for users in China to browse and download the source code.
431
+
413
432
  ## License
414
433
 
415
434
  This project is open source under the [Apache License 2.0](LICENSE).
package/README.md CHANGED
@@ -22,6 +22,10 @@
22
22
  <a href="https://linux.do/"><img src="https://img.shields.io/badge/LINUX%20DO-社区友链-555?style=flat-square" alt="LINUX DO" /></a>
23
23
  </p>
24
24
 
25
+ <p>
26
+ <a href="https://atomgit.com/shanliuling/dsh-image-gen"><img src="https://atomgit.com/shanliuling/dsh-image-gen/star/new_badge.svg" alt="AtomGit" height="55" /></a>
27
+ </p>
28
+
25
29
  <p>
26
30
  <a href="#快速开始">快速开始</a> ·
27
31
  <a href="#核心能力">核心能力</a> ·
@@ -111,11 +115,17 @@ pnpm dsh plugin --profile web add ./dsh-image-gen
111
115
 
112
116
  ### 2. 配置 Provider
113
117
 
114
- 重启 DSH 后进入:
118
+ 重启 DSH 后,点击左侧边栏的 **「插件」** 图标打开插件面板,在 **「已安装」** 分区点击 **dsh-image-gen**,进入插件详情页即可看到「图像生成」配置表单:
115
119
 
116
- **设置 → 插件 → 图像生成**
120
+ **插件面板 → 已安装 → dsh-image-gen**
117
121
 
118
- > DSH 0.1.5 及更早版本的入口为「设置 → 插件 → 插件配置 → 图像生成」,插件已同时兼容两种入口。
122
+ <div align="center">
123
+ <img src="docs/assets/readme/plugins-entry.webp" alt="在左侧边栏点击「插件」,于「已安装」分区点击 dsh-image-gen 进入详情页" width="100%" />
124
+ <br />
125
+ <sub>点击左侧边栏「插件」图标,在「已安装」分区点击 dsh-image-gen 进入插件详情页。</sub>
126
+ </div>
127
+
128
+ > DSH 0.1.5 及更早版本没有插件面板,入口仍为「设置 → 插件 → 插件配置 → 图像生成」;插件已同时兼容两种入口。
119
129
 
120
130
  选择 Provider,填写自己的 API Key,并按需调整模型、Endpoint / Base URL 与工作区保存选项。填好 Key 后可点击**「测试连接」**验证可用性,或点击**「拉取模型」**一键获取该厂商支持的全部生图模型,无需手动查文档。使用 ComfyUI 时,请填写 DSH Host 可访问的服务地址,并导入 **API Format Workflow JSON**。
121
131
 
@@ -138,10 +148,10 @@ pnpm dsh plugin --profile web add ./dsh-image-gen
138
148
  <br />
139
149
 
140
150
  <div align="center">
141
- <img src="docs/assets/readme/provider-settings.webp" alt="DSH 插件配置界面" width="46%" />
151
+ <img src="docs/assets/readme/plugin-detail.webp" alt="dsh-image-gen 插件详情页中的 Provider 配置表单" width="46%" />
142
152
  <img src="docs/assets/readme/chat-example.webp" alt="对话生图与风格重构效果" width="46%" />
143
153
  <br />
144
- <sub>左:Provider 配置 · 右:在 DSH 对话中直接生图、图生图与连续编辑。</sub>
154
+ <sub>左:插件详情页中的 Provider 配置 · 右:在 DSH 对话中直接生图、图生图与连续编辑。</sub>
145
155
  </div>
146
156
 
147
157
  <br />
@@ -312,8 +322,8 @@ pnpm dsh plugin --profile web add ./dsh-image-gen
312
322
  | Provider | 比例 | 清晰度 |
313
323
  | :----------------- | :---------------------------------------------------------------- | :-------------------------------------- |
314
324
  | Google Gemini | 1:1 · 3:2 · 2:3 · 4:3 · 3:4 · 4:5 · 5:4 · 16:9 · 9:16 · 21:9 | 1K / 2K / 4K |
315
- | OpenAI Images | 1:1 · 3:2 · 2:3 · 4:3 · 3:4 · 16:9 · 9:16 | 自动 / low / medium / high |
316
- | OpenAI Compatible | 由 `openaiCompatSizes` 配置决定(默认 1:1 · 3:2 · 2:3) | 同上(默认 standard) |
325
+ | OpenAI Images | gpt-image-2 系列支持 1:1 · 3:2 · 2:3 · 4:3 · 3:4 · 16:9 · 9:16 | 分辨率 1K / 2K(宽屏、竖屏另有 4K);生成质量独立选择 auto / low / medium / high |
326
+ | OpenAI Compatible | 由 `openaiCompatSizes` 配置决定(默认 1:1 · 3:2 · 2:3) | 分辨率由尺寸表决定;生成质量独立配置,默认不发送 |
317
327
  | ByteDance Seedream | 自动 · 1:1 · 3:2 · 2:3 · 4:3 · 3:4 · 16:9 · 9:16 · 21:9 | 2K / 3K / 4K |
318
328
  | Aliyun DashScope | 1:1 · 3:2 · 2:3 · 4:3 · 3:4 · 16:9 · 9:16 | 标准 |
319
329
  | xAI Grok Imagine | 自动 · 1:1 · 3:2 · 2:3 · 4:3 · 3:4 · 16:9 · 9:16 · 21:9 | 1K / 2K |
@@ -323,7 +333,12 @@ pnpm dsh plugin --profile web add ./dsh-image-gen
323
333
  | Google 订阅 | 自动 · 1:1 · 3:2 · 2:3 · 4:3 · 3:4 · 4:5 · 5:4 · 16:9 · 9:16 · 21:9 | 标准 / 高清(4K) |
324
334
 
325
335
  > 「自动」比例表示由模型按 Prompt 自行决定构图;上游已移除的档位(如 Seedream 5.0 的 1K)插件不会暴露。
326
- > OpenAI Compatible(中转站)的比例与清晰度由设置中的 `openaiCompatSizes` 表驱动,格式为「比例 → 档位 → 像素」,例如 `{ "16:9": { "2K": "2048x1152" } }`;留空时保持 1:1 / 3:2 / 2:3 + standard 的兼容行为。
336
+ > Google 订阅会使用有效的平台枚举发现账号项目,并提供普通 daily 入口作为兼容回退。未返回项目时保留旧兼容项目尝试,但不会把它缓存成账号真实项目;若生图仍失败,错误会保留项目发现、账号资格及各生图入口的脱敏响应,避免只显示最后一个 429。设置中的订阅「测试连接」只检查登录记录,实际生图成功才验证该账号的生图链路;`UNSUPPORTED_CLIENT` 的 Code Assist 提示也不单独判定生图不可用。
337
+ > OpenAI 与兼容渠道的 Studio 控件分别显示「比例 / 分辨率 / 生成质量」,分辨率选项会显示实际像素。多模型对比及再次生成也保留这两类参数。
338
+ > OpenAI 官方可通过设置中的 `openaiSizes` 自定义尺寸表,格式为「比例 → 档位 → 像素」,例如 `{ "16:9": { "2K": "2048x1152", "4K": "3840x2160" } }`。gpt-image-2 系列按官方限制校验:边长为 16 的倍数、最大 3840、比例在 1:3 到 3:1、总像素 655360–8294400;超过 3686400 像素的输出属于上游实验支持。[官方说明](https://developers.openai.com/api/reference/resources/images/methods/generate)。旧版 GPT Image 模型仍只使用三种标准尺寸。
339
+ > OpenAI Compatible 的尺寸表为 `openaiCompatSizes`,格式相同;留空时保持原来的标准尺寸。`openaiCompatQuality` 设置默认生成质量(留空不发送),`openaiCompatQualityOptions` 设置 Studio 可选值。选择「渠道默认(不发送)」可在单次请求中省略 quality;对话工具也支持独立的 `size` 和 `quality` 参数。
340
+ > 兼容渠道的「文生图额外字段」对应 `openaiCompatExtraBody`,例如 `{ "watermark": false }`。它仅用于文生图,在常规字段之后合并,可覆盖同名参数;`false` 和嵌套对象都会保留。图生图继续使用 `openaiCompatEditExtra`;JSON 图片 URL 数组格式的 `openaiCompatEditSizeMode` 默认 `auto`,改为 `selected` 才发送所选尺寸,EditExtra 仍可覆盖该尺寸。
341
+ > 工作台在比例、分辨率旁提供「可见水印:渠道默认 / 关闭 / 开启」,分别判断文生图和图生图支持情况。Seedream、通义原生 Qwen Image,以及已确认的商汤和通义官方兼容接口自动启用;官方兼容接口同时自动使用对应的 JSON 编辑格式。商汤匹配 `https://token.sensenova.cn/v1` 与 `sensenova-u1.5-lite`;通义匹配官方工作空间域名的 `/compatible-mode/v1` 与 Qwen Image 3.0/3.0 Pro、2.1 Pro/Turbo。其他兼容渠道可通过对应操作的额外字段绑定布尔值 `watermark`、`watermark_enabled` 或 `parameters.watermark`;图生图绑定仅用于 JSON 编辑格式。未知渠道和智谱显示禁用的「支持未确认」,无已确认开关的接口也显示说明。不会仅凭模型名识别未知中转。渠道默认保留原配置或省略参数,单次选择只覆盖水印字段;批量生成、支持该操作的对比模型及再次生成会保留选择。
327
342
 
328
343
  </details>
329
344
 
@@ -344,7 +359,7 @@ pnpm dsh plugin --profile web add ./dsh-image-gen
344
359
  <details>
345
360
  <summary><strong>安装后找不到“图像生成”设置怎么办?</strong></summary>
346
361
 
347
- 设置入口随 DSH 版本不同:0.1.6 及以上位于「设置 → 插件 → 图像生成」,0.1.5 及更早位于「设置 → 插件 → 插件配置 → 图像生成」。
362
+ 设置入口随 DSH 版本不同:0.1.6 及以上位于插件详情页(点击左侧边栏「插件」图标,在「已安装」分区进入 dsh-image-gen),0.1.5 及更早位于「设置 → 插件 → 插件配置 → 图像生成」。
348
363
 
349
364
  若两处都没有,先完全重启当前 DSH Profile,再检查插件配置:
350
365
 
@@ -410,6 +425,10 @@ pnpm run test:package
410
425
 
411
426
  欢迎通过 [Issues](https://github.com/shanliuling/dsh-image-gen/issues) 反馈问题,或阅读 [CONTRIBUTING.md](CONTRIBUTING.md) 后提交 Pull Request。
412
427
 
428
+ ## 鸣谢
429
+
430
+ - [AtomGit](https://atomgit.com/shanliuling/dsh-image-gen):为本项目提供国内代码托管,方便国内用户访问与获取源码。
431
+
413
432
  ## License
414
433
 
415
434
  本项目基于 [Apache License 2.0](LICENSE) 开源。