@dickpy/dsh-imagegen 1.5.2 → 1.5.3
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.md +2 -1
- package/lib/client.js +808 -323
- package/lib/client.js.map +1 -1
- package/lib/index.js +166 -2
- package/package.json +1 -1
- package/src/client/ImageGenPanel.tsx +5 -0
- package/src/client/SettingsCard.tsx +9 -3
- package/src/client/helpers.ts +71 -33
- package/src/client/index.ts +59 -7
- package/src/client/locales.ts +385 -2
- package/src/client/use-language.ts +14 -0
- package/src/engine.ts +148 -0
- package/src/index.ts +1 -1
- package/src/model-catalog.ts +10 -1
- package/src/presets.ts +15 -0
- package/src/protocol.ts +1 -1
package/src/model-catalog.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Framework-free (pure data + regex), safe for the client bundle to inline.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
export type ModelFamily = 'gpt-image' | 'dall-e' | 'grok' | 'nanobanana' | 'seedream' | 'zhipu' | 'unknown'
|
|
11
|
+
export type ModelFamily = 'gpt-image' | 'dall-e' | 'grok' | 'nanobanana' | 'seedream' | 'zhipu' | 'qwen' | 'unknown'
|
|
12
12
|
|
|
13
13
|
/** Capability/identity annotation for one model id. */
|
|
14
14
|
export interface ModelCatalogEntry {
|
|
@@ -77,6 +77,14 @@ const ENTRIES: Record<Exclude<ModelFamily, 'unknown'>, Omit<ModelCatalogEntry, '
|
|
|
77
77
|
supportsAspectRatio: false,
|
|
78
78
|
qualityTiers: ['HD'],
|
|
79
79
|
},
|
|
80
|
+
qwen: {
|
|
81
|
+
label: 'qwen-image',
|
|
82
|
+
labelZh: '千问图像',
|
|
83
|
+
known: true,
|
|
84
|
+
supportsEdit: true,
|
|
85
|
+
supportsAspectRatio: true,
|
|
86
|
+
qualityTiers: ['auto'],
|
|
87
|
+
},
|
|
80
88
|
}
|
|
81
89
|
|
|
82
90
|
/** Official Gemini image ids served by Nano Banana gateways. */
|
|
@@ -98,6 +106,7 @@ export function describeModel(model: string): ModelCatalogEntry {
|
|
|
98
106
|
if (/^nanobanana/i.test(id) || NANOBANANA_GEMINI_IDS.has(id)) return { family: 'nanobanana', ...ENTRIES.nanobanana }
|
|
99
107
|
if (/^(?:doubao-)?seedream/i.test(id)) return { family: 'seedream', ...ENTRIES.seedream }
|
|
100
108
|
if (/^(?:glm-image|cogview(?:-|$))/i.test(id)) return { family: 'zhipu', ...ENTRIES.zhipu }
|
|
109
|
+
if (/^qwen-image(?:[-_.]|$)/i.test(id)) return { family: 'qwen', ...ENTRIES.qwen }
|
|
101
110
|
return { family: 'unknown', label: 'unknown', labelZh: '未知协议', known: false, supportsEdit: true, supportsAspectRatio: false, qualityTiers: [] }
|
|
102
111
|
}
|
|
103
112
|
|
package/src/presets.ts
CHANGED
|
@@ -54,6 +54,21 @@ export const IMAGE_PRESETS: PresetProvider[] = [
|
|
|
54
54
|
{ alias: 'glm-image', id: 'glm-image' },
|
|
55
55
|
],
|
|
56
56
|
},
|
|
57
|
+
{
|
|
58
|
+
id: 'aliyun-dashscope-qwen',
|
|
59
|
+
name: '阿里云百炼(Qwen-Image)',
|
|
60
|
+
apiUrl: 'https://dashscope.aliyuncs.com/api/v1',
|
|
61
|
+
hint: '阿里云百炼 DashScope 原生接口:通义千问 Qwen-Image 系列(该渠道不可复用于提示词增强)',
|
|
62
|
+
models: [
|
|
63
|
+
{ alias: 'qwen-image-3.0-pro', id: 'qwen-image-3.0-pro' },
|
|
64
|
+
{ alias: 'qwen-image-3.0', id: 'qwen-image-3.0' },
|
|
65
|
+
{ alias: 'qwen-image-2.0-pro', id: 'qwen-image-2.0-pro' },
|
|
66
|
+
{ alias: 'qwen-image-2.0', id: 'qwen-image-2.0' },
|
|
67
|
+
{ alias: 'qwen-image-max', id: 'qwen-image-max' },
|
|
68
|
+
{ alias: 'qwen-image-plus', id: 'qwen-image-plus' },
|
|
69
|
+
{ alias: 'qwen-image', id: 'qwen-image' },
|
|
70
|
+
],
|
|
71
|
+
},
|
|
57
72
|
{
|
|
58
73
|
id: 'xai-grok',
|
|
59
74
|
name: 'xAI(Grok)',
|
package/src/protocol.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
export const IMAGEGEN_SETTINGS_NAMESPACE = 'dsh-imagegen'
|
|
9
9
|
|
|
10
10
|
/** Published package version shared by the host updater and the client UI. */
|
|
11
|
-
export const PLUGIN_VERSION = '1.5.
|
|
11
|
+
export const PLUGIN_VERSION = '1.5.3'
|
|
12
12
|
|
|
13
13
|
/** Same-origin route family (loopback-only, mirroring the dsh-ssh fence). */
|
|
14
14
|
export const SETTINGS_API = {
|