dsh-image-gen 0.6.8 → 0.6.9

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 CHANGED
@@ -1,21 +1,201 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 dsh-image-gen 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.
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 shanliuling
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.en.md CHANGED
@@ -18,7 +18,7 @@
18
18
  <a href="https://github.com/shanliuling/dsh-image-gen/actions/workflows/ci.yml"><img src="https://github.com/shanliuling/dsh-image-gen/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
19
19
  <a href="https://dsh-insights.com/p/shanliuling/dsh-image-gen"><img src="https://dsh-insights.com/badge/shanliuling/dsh-image-gen.svg" alt="DSH Insights health" /></a>
20
20
  <a href="https://github.com/shanliuling/dsh-image-gen/stargazers"><img src="https://img.shields.io/github/stars/shanliuling/dsh-image-gen?style=flat-square" alt="GitHub stars" /></a>
21
- <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-f5c542?style=flat-square" alt="License: MIT" /></a>
21
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-f5c542?style=flat-square" alt="License: Apache-2.0" /></a>
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
 
@@ -113,7 +113,9 @@ pnpm dsh plugin --profile web add ./dsh-image-gen
113
113
 
114
114
  After restarting DSH, open:
115
115
 
116
- **Settings → Plugins → Plugin Configuration → Image Generation**
116
+ **Settings → Plugins → Image Generation**
117
+
118
+ > On DSH 0.1.5 and earlier the entry is **Settings → Plugins → Plugin Configuration → Image Generation**; the same plugin build supports both.
117
119
 
118
120
  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.
119
121
 
@@ -321,7 +323,9 @@ Bring private image generation on your local GPU directly into Agent conversatio
321
323
  <details>
322
324
  <summary><strong>What should I do if “Image Generation” is missing after installation?</strong></summary>
323
325
 
324
- Fully restart the current DSH Profile, then inspect the plugin configuration:
326
+ 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**.
327
+
328
+ If it is missing in both places, fully restart the current DSH Profile, then inspect the plugin configuration:
325
329
 
326
330
  ```bash
327
331
  dsh --profile web --dump-config
@@ -382,7 +386,7 @@ Feedback is welcome through [Issues](https://github.com/shanliuling/dsh-image-ge
382
386
 
383
387
  ## License
384
388
 
385
- This project is open source under the [MIT License](LICENSE).
389
+ This project is open source under the [Apache License 2.0](LICENSE).
386
390
 
387
391
  <div align="center">
388
392
 
package/README.md CHANGED
@@ -18,7 +18,7 @@
18
18
  <a href="https://github.com/shanliuling/dsh-image-gen/actions/workflows/ci.yml"><img src="https://github.com/shanliuling/dsh-image-gen/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
19
19
  <a href="https://dsh-insights.com/p/shanliuling/dsh-image-gen"><img src="https://dsh-insights.com/badge/shanliuling/dsh-image-gen.svg" alt="DSH Insights health" /></a>
20
20
  <a href="https://github.com/shanliuling/dsh-image-gen/stargazers"><img src="https://img.shields.io/github/stars/shanliuling/dsh-image-gen?style=flat-square" alt="GitHub stars" /></a>
21
- <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-f5c542?style=flat-square" alt="License: MIT" /></a>
21
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-f5c542?style=flat-square" alt="License: Apache-2.0" /></a>
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
 
@@ -113,7 +113,9 @@ pnpm dsh plugin --profile web add ./dsh-image-gen
113
113
 
114
114
  重启 DSH 后进入:
115
115
 
116
- **设置 → 插件 → 插件配置 → 图像生成**
116
+ **设置 → 插件 → 图像生成**
117
+
118
+ > DSH 0.1.5 及更早版本的入口为「设置 → 插件 → 插件配置 → 图像生成」,插件已同时兼容两种入口。
117
119
 
118
120
  选择 Provider,填写自己的 API Key,并按需调整模型、Endpoint / Base URL 与工作区保存选项。填好 Key 后可点击**「测试连接」**验证可用性,或点击**「拉取模型」**一键获取该厂商支持的全部生图模型,无需手动查文档。使用 ComfyUI 时,请填写 DSH Host 可访问的服务地址,并导入 **API Format Workflow JSON**。
119
121
 
@@ -321,7 +323,9 @@ pnpm dsh plugin --profile web add ./dsh-image-gen
321
323
  <details>
322
324
  <summary><strong>安装后找不到“图像生成”设置怎么办?</strong></summary>
323
325
 
324
- 先完全重启当前 DSH Profile,再检查插件配置:
326
+ 设置入口随 DSH 版本不同:0.1.6 及以上位于「设置 → 插件 → 图像生成」,0.1.5 及更早位于「设置 → 插件 → 插件配置 → 图像生成」。
327
+
328
+ 若两处都没有,先完全重启当前 DSH Profile,再检查插件配置:
325
329
 
326
330
  ```bash
327
331
  dsh --profile web --dump-config
@@ -382,7 +386,7 @@ pnpm run pack:check
382
386
 
383
387
  ## License
384
388
 
385
- 本项目基于 [MIT License](LICENSE) 开源。
389
+ 本项目基于 [Apache License 2.0](LICENSE) 开源。
386
390
 
387
391
  <div align="center">
388
392
 
package/lib/client.js CHANGED
@@ -122005,7 +122005,7 @@ img.ProseMirror-separator {
122005
122005
  `;
122006
122006
  //#endregion
122007
122007
  //#region lib/types/client/index.js
122008
- console.info(`[dsh-image-gen] canvas bundle 2026-09-14T15:26:26.831Z`);
122008
+ console.info(`[dsh-image-gen] canvas bundle 2026-09-20T15:13:07.204Z`);
122009
122009
  /** Right-sidebar tab-type registration id (DSH 0.1.5 `sidebarRightTabs`). */
122010
122010
  const SIDEBAR_STUDIO_TAB_ID = "dsh-image-gen/studio";
122011
122011
  /** The tab kind: a page type opened by kind, recognizing no resource address. */
@@ -122066,6 +122066,7 @@ img.ProseMirror-separator {
122066
122066
  keyCleared: "已清除 Key",
122067
122067
  clearKeyFailed: "清除 Key 失败",
122068
122068
  saveKeyFailed: "保存 Key 失败",
122069
+ saveKeyFirst: "请先保存 API Key,再拉取模型或测试连接。",
122069
122070
  clearKeyUnsupported: "当前版本 DSH 不支持在此清除 Key,请到凭据管理中删除。",
122070
122071
  endpoint: "接口地址",
122071
122072
  reset: "重置",
@@ -122080,6 +122081,18 @@ img.ProseMirror-separator {
122080
122081
  editExtra: "附加 JSON 字段",
122081
122082
  editExtraPlaceholder: "{\"watermark\": false, \"prompt_extend\": true}",
122082
122083
  editExtraHint: "仅 JSON 形态生效;会合并到请求体末尾,可覆盖默认字段。留空表示不附加。",
122084
+ arkOutputFormat: "输出格式",
122085
+ arkOutputFormatPng: "PNG(无损,带透明通道)",
122086
+ arkOutputFormatJpeg: "JPEG(方舟默认,有损)",
122087
+ arkOutputFormatHint: "JPEG 会在主体边缘留下压缩色斑,抠图时变成难去掉的彩色毛边。要后期加工就选 PNG。",
122088
+ arkWatermark: "AI 生成水印",
122089
+ arkWatermarkOn: "添加(方舟默认)",
122090
+ arkWatermarkOff: "不添加",
122091
+ arkWatermarkHint: "方舟默认在右下角烙上“AI 生成”标识。做游戏素材或需要后期处理时关掉。",
122092
+ arkBackground: "背景",
122093
+ arkBackgroundOpaque: "不透明(方舟默认)",
122094
+ arkBackgroundTransparent: "透明",
122095
+ arkBackgroundHint: "仅图生图有效,且要求参考图本身带透明通道;文生图会被方舟拒绝,因此这一项只在图生图时发出。",
122083
122096
  editExtraInvalid: "附加 JSON 字段必须是合法的 JSON 对象。",
122084
122097
  endpointHintSeedream: "火山方舟兼容的 /api/v3 地址。",
122085
122098
  endpointHintDashScope: "阿里云百炼 DashScope 官方接口地址。",
@@ -122195,6 +122208,7 @@ img.ProseMirror-separator {
122195
122208
  keyCleared: "Key cleared",
122196
122209
  clearKeyFailed: "Failed to clear key",
122197
122210
  saveKeyFailed: "Failed to save the key",
122211
+ saveKeyFirst: "Save the API key first, then fetch models or test the connection.",
122198
122212
  clearKeyUnsupported: "This DSH build cannot clear keys here; remove it from credential management instead.",
122199
122213
  endpoint: "Endpoint / Base URL",
122200
122214
  reset: "Reset",
@@ -122209,6 +122223,18 @@ img.ProseMirror-separator {
122209
122223
  editExtra: "Extra JSON fields",
122210
122224
  editExtraPlaceholder: "{\"watermark\": false, \"prompt_extend\": true}",
122211
122225
  editExtraHint: "Only used with the JSON format; merged into the request body last and may override defaults. Leave empty for none.",
122226
+ arkOutputFormat: "Output format",
122227
+ arkOutputFormatPng: "PNG (lossless, keeps an alpha channel)",
122228
+ arkOutputFormatJpeg: "JPEG (Ark default, lossy)",
122229
+ arkOutputFormatHint: "JPEG ringing around the subject turns into coloured fringing that is hard to remove when cutting the background out. Pick PNG if you plan to edit the result.",
122230
+ arkWatermark: "AI generated watermark",
122231
+ arkWatermarkOn: "Add (Ark default)",
122232
+ arkWatermarkOff: "Do not add",
122233
+ arkWatermarkHint: "Ark stamps an \"AI generated\" mark into the bottom-right corner by default. Turn it off for game assets or any post-processing.",
122234
+ arkBackground: "Background",
122235
+ arkBackgroundOpaque: "Opaque (Ark default)",
122236
+ arkBackgroundTransparent: "Transparent",
122237
+ arkBackgroundHint: "Image-to-image only, and every reference image must already carry an alpha channel; Ark rejects it for text-to-image, so it is sent on edits alone.",
122212
122238
  editExtraInvalid: "Extra JSON fields must be a valid JSON object.",
122213
122239
  endpointHintSeedream: "Volcengine Ark compatible /api/v3 base URL.",
122214
122240
  endpointHintDashScope: "Official Aliyun DashScope endpoint.",
@@ -122621,16 +122647,25 @@ img.ProseMirror-separator {
122621
122647
  } };
122622
122648
  const injectSettingsItem = (owner) => {
122623
122649
  const ownerRegister = owner.slots.register.bind(owner.slots);
122650
+ const injectSettingsFace = () => ({
122651
+ scope,
122652
+ credentials: credentialsProxy,
122653
+ credentialsAvailable,
122654
+ locale,
122655
+ credentialEvents
122656
+ });
122657
+ owner.slots.inject("settings.plugins.tab", () => ownerRegister({
122658
+ name: "settings.plugins.tab",
122659
+ id: IMAGE_GENERATION_NAMESPACE,
122660
+ order: 30,
122661
+ label: () => locale?.getSnapshot?.()?.active?.startsWith("en") ? "Image generation" : "图像生成",
122662
+ locale,
122663
+ inject: injectSettingsFace
122664
+ }, ImageGenerationSettingsCard));
122624
122665
  owner.slots.inject("settings.plugin.item", () => ownerRegister({
122625
122666
  name: "settings.plugin.item",
122626
122667
  key: IMAGE_GENERATION_NAMESPACE,
122627
- inject: () => ({
122628
- scope,
122629
- credentials: credentialsProxy,
122630
- credentialsAvailable,
122631
- locale,
122632
- credentialEvents
122633
- })
122668
+ inject: injectSettingsFace
122634
122669
  }, ImageGenerationSettingsCard));
122635
122670
  };
122636
122671
  const injectComposerPill = (owner) => {
@@ -122793,7 +122828,10 @@ img.ProseMirror-separator {
122793
122828
  activeWorkflow: "",
122794
122829
  timeoutSeconds: DEFAULT_COMFYUI_TIMEOUT_MS / 1e3,
122795
122830
  editFormat: "multipart",
122796
- editExtraText: ""
122831
+ editExtraText: "",
122832
+ outputFormat: "jpeg",
122833
+ watermark: true,
122834
+ background: "opaque"
122797
122835
  };
122798
122836
  }
122799
122837
  /** Settings field each cloud provider persists its model under. */
@@ -122862,6 +122900,11 @@ img.ProseMirror-separator {
122862
122900
  ...provider === "openai-compat" ? {
122863
122901
  editFormat: value?.openaiCompatEditFormat === "jsonImageUrlArray" ? "jsonImageUrlArray" : "multipart",
122864
122902
  editExtraText: editExtraTextOf(value?.openaiCompatEditExtra)
122903
+ } : {},
122904
+ ...provider === "seedream" ? {
122905
+ outputFormat: value?.seedreamOutputFormat === "png" ? "png" : "jpeg",
122906
+ watermark: value?.seedreamWatermark !== false,
122907
+ background: value?.seedreamBackground === "transparent" ? "transparent" : "opaque"
122865
122908
  } : {}
122866
122909
  };
122867
122910
  return rows;
@@ -123074,6 +123117,11 @@ img.ProseMirror-separator {
123074
123117
  workflows: resolveComfyUIWorkflows(value ?? {}),
123075
123118
  activeWorkflow: activeComfyUIWorkflow(value ?? {})?.name ?? "",
123076
123119
  timeoutSeconds: Math.max(1, Math.round((value?.comfyuiTimeoutMs ?? 3e5) / 1e3))
123120
+ } : {},
123121
+ ...provider === "seedream" ? {
123122
+ outputFormat: value?.seedreamOutputFormat === "png" ? "png" : "jpeg",
123123
+ watermark: value?.seedreamWatermark !== false,
123124
+ background: value?.seedreamBackground === "transparent" ? "transparent" : "opaque"
123077
123125
  } : {}
123078
123126
  };
123079
123127
  return next;
@@ -123205,6 +123253,11 @@ img.ProseMirror-separator {
123205
123253
  await props.scope.set("openaiCompatEditFormat", row.editFormat);
123206
123254
  await props.scope.set("openaiCompatEditExtra", editExtra);
123207
123255
  }
123256
+ if (provider === "seedream") {
123257
+ await props.scope.set("seedreamOutputFormat", row.outputFormat);
123258
+ await props.scope.set("seedreamWatermark", row.watermark);
123259
+ await props.scope.set("seedreamBackground", row.background);
123260
+ }
123208
123261
  if (row.keyInput.trim().length > 0) {
123209
123262
  const keyRef = cloudCredentialRef(provider);
123210
123263
  if (keyRef === void 0) throw new Error(t("comfyuiNoKey"));
@@ -123219,7 +123272,10 @@ img.ProseMirror-separator {
123219
123272
  }
123220
123273
  updateRow(provider, {
123221
123274
  message: t("saved"),
123222
- messageIsError: false
123275
+ messageIsError: false,
123276
+ testResult: void 0,
123277
+ modelFetchMessage: "",
123278
+ modelFetchIsError: false
123223
123279
  });
123224
123280
  } catch (cause) {
123225
123281
  updateRow(provider, {
@@ -123232,6 +123288,14 @@ img.ProseMirror-separator {
123232
123288
  };
123233
123289
  /** Probe through the host route so the browser side never touches credential values. */
123234
123290
  const testConnection = async (provider) => {
123291
+ if (rows[provider].keyInput.trim().length > 0) {
123292
+ updateRow(provider, {
123293
+ message: t("saveKeyFirst"),
123294
+ messageIsError: false,
123295
+ testResult: void 0
123296
+ });
123297
+ return;
123298
+ }
123235
123299
  updateRow(provider, {
123236
123300
  testing: true,
123237
123301
  testResult: void 0,
@@ -123258,6 +123322,13 @@ img.ProseMirror-separator {
123258
123322
  };
123259
123323
  /** Pull the provider's image-capable model ids through the host route (Google and the OpenAI family). */
123260
123324
  const fetchProviderModels = async (provider) => {
123325
+ if (rows[provider].keyInput.trim().length > 0) {
123326
+ updateRow(provider, {
123327
+ modelFetchMessage: t("saveKeyFirst"),
123328
+ modelFetchIsError: false
123329
+ });
123330
+ return;
123331
+ }
123261
123332
  updateRow(provider, {
123262
123333
  fetchingModels: true,
123263
123334
  modelFetchMessage: "",
@@ -123606,7 +123677,7 @@ img.ProseMirror-separator {
123606
123677
  (0, react_jsx_runtime.jsx)("button", {
123607
123678
  type: "button",
123608
123679
  className: "dsh-ig-btn-secondary",
123609
- disabled: row.fetchingModels || !snapshot.writable,
123680
+ disabled: row.fetchingModels || row.saving || !snapshot.writable,
123610
123681
  onClick: () => {
123611
123682
  fetchProviderModels(provider);
123612
123683
  },
@@ -123660,6 +123731,92 @@ img.ProseMirror-separator {
123660
123731
  })
123661
123732
  ]
123662
123733
  }) : null,
123734
+ provider === "seedream" ? (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
123735
+ (0, react_jsx_runtime.jsxs)("label", {
123736
+ className: "dsh-ig-field",
123737
+ children: [
123738
+ (0, react_jsx_runtime.jsx)("span", {
123739
+ className: "dsh-ig-label",
123740
+ children: t("arkOutputFormat")
123741
+ }),
123742
+ (0, react_jsx_runtime.jsxs)("select", {
123743
+ className: "dsh-ig-input",
123744
+ value: row.outputFormat,
123745
+ onChange: (event) => {
123746
+ updateRow(provider, { outputFormat: event.target.value === "png" ? "png" : "jpeg" });
123747
+ },
123748
+ disabled: !snapshot.writable,
123749
+ children: [(0, react_jsx_runtime.jsx)("option", {
123750
+ value: "jpeg",
123751
+ children: t("arkOutputFormatJpeg")
123752
+ }), (0, react_jsx_runtime.jsx)("option", {
123753
+ value: "png",
123754
+ children: t("arkOutputFormatPng")
123755
+ })]
123756
+ }),
123757
+ (0, react_jsx_runtime.jsx)("span", {
123758
+ className: "dsh-ig-hint",
123759
+ children: t("arkOutputFormatHint")
123760
+ })
123761
+ ]
123762
+ }),
123763
+ (0, react_jsx_runtime.jsxs)("label", {
123764
+ className: "dsh-ig-field",
123765
+ children: [
123766
+ (0, react_jsx_runtime.jsx)("span", {
123767
+ className: "dsh-ig-label",
123768
+ children: t("arkWatermark")
123769
+ }),
123770
+ (0, react_jsx_runtime.jsxs)("select", {
123771
+ className: "dsh-ig-input",
123772
+ value: row.watermark ? "on" : "off",
123773
+ onChange: (event) => {
123774
+ updateRow(provider, { watermark: event.target.value === "on" });
123775
+ },
123776
+ disabled: !snapshot.writable,
123777
+ children: [(0, react_jsx_runtime.jsx)("option", {
123778
+ value: "on",
123779
+ children: t("arkWatermarkOn")
123780
+ }), (0, react_jsx_runtime.jsx)("option", {
123781
+ value: "off",
123782
+ children: t("arkWatermarkOff")
123783
+ })]
123784
+ }),
123785
+ (0, react_jsx_runtime.jsx)("span", {
123786
+ className: "dsh-ig-hint",
123787
+ children: t("arkWatermarkHint")
123788
+ })
123789
+ ]
123790
+ }),
123791
+ (0, react_jsx_runtime.jsxs)("label", {
123792
+ className: "dsh-ig-field",
123793
+ children: [
123794
+ (0, react_jsx_runtime.jsx)("span", {
123795
+ className: "dsh-ig-label",
123796
+ children: t("arkBackground")
123797
+ }),
123798
+ (0, react_jsx_runtime.jsxs)("select", {
123799
+ className: "dsh-ig-input",
123800
+ value: row.background,
123801
+ onChange: (event) => {
123802
+ updateRow(provider, { background: event.target.value === "transparent" ? "transparent" : "opaque" });
123803
+ },
123804
+ disabled: !snapshot.writable,
123805
+ children: [(0, react_jsx_runtime.jsx)("option", {
123806
+ value: "opaque",
123807
+ children: t("arkBackgroundOpaque")
123808
+ }), (0, react_jsx_runtime.jsx)("option", {
123809
+ value: "transparent",
123810
+ children: t("arkBackgroundTransparent")
123811
+ })]
123812
+ }),
123813
+ (0, react_jsx_runtime.jsx)("span", {
123814
+ className: "dsh-ig-hint",
123815
+ children: t("arkBackgroundHint")
123816
+ })
123817
+ ]
123818
+ })
123819
+ ] }) : null,
123663
123820
  provider === "openai-compat" && row.editFormat === "jsonImageUrlArray" ? (0, react_jsx_runtime.jsxs)("label", {
123664
123821
  className: "dsh-ig-field",
123665
123822
  children: [
@@ -123695,7 +123852,7 @@ img.ProseMirror-separator {
123695
123852
  (0, react_jsx_runtime.jsx)("button", {
123696
123853
  type: "button",
123697
123854
  className: "dsh-ig-btn-secondary",
123698
- disabled: row.testing,
123855
+ disabled: row.testing || row.saving,
123699
123856
  onClick: () => {
123700
123857
  testConnection(provider);
123701
123858
  },
@@ -123713,7 +123870,7 @@ img.ProseMirror-separator {
123713
123870
  (0, react_jsx_runtime.jsx)("button", {
123714
123871
  className: "dsh-ig-save",
123715
123872
  type: "submit",
123716
- disabled: row.saving || !snapshot.writable,
123873
+ disabled: row.saving || row.testing || row.fetchingModels || !snapshot.writable,
123717
123874
  children: row.saving ? t("saving") : t("save")
123718
123875
  })
123719
123876
  ]