@dickpy/dsh-imagegen 1.5.6 → 1.5.7
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 +426 -390
- package/lib/client.js.map +1 -1
- package/lib/index.js +181 -5
- package/package.json +81 -81
- package/src/canvas-store.ts +375 -375
- package/src/client/ImageGenPanel.tsx +2823 -2807
- package/src/client/SettingsCard.tsx +1128 -1128
- package/src/client/locales.ts +1515 -1509
- package/src/client/panel.module.css +7 -0
- package/src/engine.ts +998 -845
- package/src/gallery-store.ts +311 -311
- package/src/history-store.ts +275 -275
- package/src/image-storage-path.ts +12 -12
- package/src/index.ts +430 -429
- package/src/model-catalog.ts +149 -124
- package/src/presets.ts +95 -86
- package/src/prompt-enhancer.ts +151 -137
- package/src/protocol.ts +580 -580
package/src/model-catalog.ts
CHANGED
|
@@ -1,124 +1,149 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Model catalog: protocol-family detection and capability annotation shared by
|
|
3
|
-
* the engine, the settings card, and the panel. Known id patterns map onto the
|
|
4
|
-
* OpenAI-compatible image protocol families this plugin shapes requests for;
|
|
5
|
-
* anything unrecognized falls back to the generic OpenAI protocol (best
|
|
6
|
-
* effort) and is flagged as unknown so the UI can warn without blocking.
|
|
7
|
-
*
|
|
8
|
-
* Framework-free (pure data + regex), safe for the client bundle to inline.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export type ModelFamily = 'gpt-image' | 'dall-e' | 'grok' | 'nanobanana' | 'seedream' | 'zhipu' | 'qwen' | 'unknown'
|
|
12
|
-
|
|
13
|
-
/** Capability/identity annotation for one model id. */
|
|
14
|
-
export interface ModelCatalogEntry {
|
|
15
|
-
/** Family the request is shaped for. */
|
|
16
|
-
family: ModelFamily
|
|
17
|
-
/** Short badge label (en). */
|
|
18
|
-
label: string
|
|
19
|
-
/** Short badge label (zh). */
|
|
20
|
-
labelZh: string
|
|
21
|
-
/** Whether the family is known (false = best-effort OpenAI protocol). */
|
|
22
|
-
known: boolean
|
|
23
|
-
/** Whether the family supports image-to-image edits. */
|
|
24
|
-
supportsEdit: boolean
|
|
25
|
-
/** Whether the family natively takes aspect-ratio dials. */
|
|
26
|
-
supportsAspectRatio: boolean
|
|
27
|
-
/** Quality tiers the family interprets natively. */
|
|
28
|
-
qualityTiers: string[]
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const ENTRIES: Record<Exclude<ModelFamily, 'unknown'>, Omit<ModelCatalogEntry, 'family'>> = {
|
|
32
|
-
'gpt-image': {
|
|
33
|
-
label: 'gpt-image',
|
|
34
|
-
labelZh: 'GPT 图像',
|
|
35
|
-
known: true,
|
|
36
|
-
supportsEdit: true,
|
|
37
|
-
supportsAspectRatio: false,
|
|
38
|
-
qualityTiers: ['1K', '2K', '4K'],
|
|
39
|
-
},
|
|
40
|
-
'dall-e': {
|
|
41
|
-
label: 'DALL·E',
|
|
42
|
-
labelZh: 'DALL·E',
|
|
43
|
-
known: true,
|
|
44
|
-
supportsEdit: true,
|
|
45
|
-
supportsAspectRatio: false,
|
|
46
|
-
qualityTiers: ['auto'],
|
|
47
|
-
},
|
|
48
|
-
grok: {
|
|
49
|
-
label: 'grok',
|
|
50
|
-
labelZh: 'Grok',
|
|
51
|
-
known: true,
|
|
52
|
-
supportsEdit: true,
|
|
53
|
-
supportsAspectRatio: true,
|
|
54
|
-
qualityTiers: ['1K', '2K'],
|
|
55
|
-
},
|
|
56
|
-
nanobanana: {
|
|
57
|
-
label: 'nanobanana',
|
|
58
|
-
labelZh: 'Nano Banana',
|
|
59
|
-
known: true,
|
|
60
|
-
supportsEdit: true,
|
|
61
|
-
supportsAspectRatio: true,
|
|
62
|
-
qualityTiers: ['1K', '2K', '4K'],
|
|
63
|
-
},
|
|
64
|
-
seedream: {
|
|
65
|
-
label: 'seedream',
|
|
66
|
-
labelZh: 'Seedream',
|
|
67
|
-
known: true,
|
|
68
|
-
supportsEdit: true,
|
|
69
|
-
supportsAspectRatio: true,
|
|
70
|
-
qualityTiers: ['1K', '2K'],
|
|
71
|
-
},
|
|
72
|
-
zhipu: {
|
|
73
|
-
label: 'GLM-Image',
|
|
74
|
-
labelZh: '智谱图像',
|
|
75
|
-
known: true,
|
|
76
|
-
supportsEdit: false,
|
|
77
|
-
supportsAspectRatio: false,
|
|
78
|
-
qualityTiers: ['HD'],
|
|
79
|
-
},
|
|
80
|
-
qwen: {
|
|
81
|
-
label: 'qwen-image',
|
|
82
|
-
labelZh: '千问图像',
|
|
83
|
-
known: true,
|
|
84
|
-
supportsEdit: true,
|
|
85
|
-
supportsAspectRatio: true,
|
|
86
|
-
qualityTiers: ['auto'],
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Model catalog: protocol-family detection and capability annotation shared by
|
|
3
|
+
* the engine, the settings card, and the panel. Known id patterns map onto the
|
|
4
|
+
* OpenAI-compatible image protocol families this plugin shapes requests for;
|
|
5
|
+
* anything unrecognized falls back to the generic OpenAI protocol (best
|
|
6
|
+
* effort) and is flagged as unknown so the UI can warn without blocking.
|
|
7
|
+
*
|
|
8
|
+
* Framework-free (pure data + regex), safe for the client bundle to inline.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export type ModelFamily = 'gpt-image' | 'dall-e' | 'grok' | 'nanobanana' | 'seedream' | 'zhipu' | 'qwen' | 'minimax' | 'unknown'
|
|
12
|
+
|
|
13
|
+
/** Capability/identity annotation for one model id. */
|
|
14
|
+
export interface ModelCatalogEntry {
|
|
15
|
+
/** Family the request is shaped for. */
|
|
16
|
+
family: ModelFamily
|
|
17
|
+
/** Short badge label (en). */
|
|
18
|
+
label: string
|
|
19
|
+
/** Short badge label (zh). */
|
|
20
|
+
labelZh: string
|
|
21
|
+
/** Whether the family is known (false = best-effort OpenAI protocol). */
|
|
22
|
+
known: boolean
|
|
23
|
+
/** Whether the family supports image-to-image edits. */
|
|
24
|
+
supportsEdit: boolean
|
|
25
|
+
/** Whether the family natively takes aspect-ratio dials. */
|
|
26
|
+
supportsAspectRatio: boolean
|
|
27
|
+
/** Quality tiers the family interprets natively. */
|
|
28
|
+
qualityTiers: string[]
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const ENTRIES: Record<Exclude<ModelFamily, 'unknown'>, Omit<ModelCatalogEntry, 'family'>> = {
|
|
32
|
+
'gpt-image': {
|
|
33
|
+
label: 'gpt-image',
|
|
34
|
+
labelZh: 'GPT 图像',
|
|
35
|
+
known: true,
|
|
36
|
+
supportsEdit: true,
|
|
37
|
+
supportsAspectRatio: false,
|
|
38
|
+
qualityTiers: ['1K', '2K', '4K'],
|
|
39
|
+
},
|
|
40
|
+
'dall-e': {
|
|
41
|
+
label: 'DALL·E',
|
|
42
|
+
labelZh: 'DALL·E',
|
|
43
|
+
known: true,
|
|
44
|
+
supportsEdit: true,
|
|
45
|
+
supportsAspectRatio: false,
|
|
46
|
+
qualityTiers: ['auto'],
|
|
47
|
+
},
|
|
48
|
+
grok: {
|
|
49
|
+
label: 'grok',
|
|
50
|
+
labelZh: 'Grok',
|
|
51
|
+
known: true,
|
|
52
|
+
supportsEdit: true,
|
|
53
|
+
supportsAspectRatio: true,
|
|
54
|
+
qualityTiers: ['1K', '2K'],
|
|
55
|
+
},
|
|
56
|
+
nanobanana: {
|
|
57
|
+
label: 'nanobanana',
|
|
58
|
+
labelZh: 'Nano Banana',
|
|
59
|
+
known: true,
|
|
60
|
+
supportsEdit: true,
|
|
61
|
+
supportsAspectRatio: true,
|
|
62
|
+
qualityTiers: ['1K', '2K', '4K'],
|
|
63
|
+
},
|
|
64
|
+
seedream: {
|
|
65
|
+
label: 'seedream',
|
|
66
|
+
labelZh: 'Seedream',
|
|
67
|
+
known: true,
|
|
68
|
+
supportsEdit: true,
|
|
69
|
+
supportsAspectRatio: true,
|
|
70
|
+
qualityTiers: ['1K', '2K'],
|
|
71
|
+
},
|
|
72
|
+
zhipu: {
|
|
73
|
+
label: 'GLM-Image',
|
|
74
|
+
labelZh: '智谱图像',
|
|
75
|
+
known: true,
|
|
76
|
+
supportsEdit: false,
|
|
77
|
+
supportsAspectRatio: false,
|
|
78
|
+
qualityTiers: ['HD'],
|
|
79
|
+
},
|
|
80
|
+
qwen: {
|
|
81
|
+
label: 'qwen-image',
|
|
82
|
+
labelZh: '千问图像',
|
|
83
|
+
known: true,
|
|
84
|
+
supportsEdit: true,
|
|
85
|
+
supportsAspectRatio: true,
|
|
86
|
+
qualityTiers: ['auto'],
|
|
87
|
+
},
|
|
88
|
+
minimax: {
|
|
89
|
+
label: 'MiniMax',
|
|
90
|
+
labelZh: 'MiniMax 图像',
|
|
91
|
+
known: true,
|
|
92
|
+
supportsEdit: true,
|
|
93
|
+
supportsAspectRatio: true,
|
|
94
|
+
qualityTiers: ['auto'],
|
|
95
|
+
},
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** Documented upstream prompt hard limits (UTF-16 code units). The engine
|
|
99
|
+
* fast-fails on these before any network call and the panel counter shows
|
|
100
|
+
* them live; families absent here have no documented limit. */
|
|
101
|
+
const PROMPT_CHAR_LIMITS: Partial<Record<Exclude<ModelFamily, 'unknown'>, number>> = {
|
|
102
|
+
// MiniMax image-01 rejects prompts >= 1500 chars upstream (base_resp 2013).
|
|
103
|
+
minimax: 1500,
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** The documented prompt character limit for a model id, or null when the
|
|
107
|
+
* family has no known limit. Single source of truth for engine enforcement
|
|
108
|
+
* and the panel's live counter. */
|
|
109
|
+
export function promptCharLimit(model: string): number | null {
|
|
110
|
+
const { family } = describeModel(model)
|
|
111
|
+
return (family !== 'unknown' ? PROMPT_CHAR_LIMITS[family] : undefined) ?? null
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** Official Gemini image ids served by Nano Banana gateways. */
|
|
115
|
+
const NANOBANANA_GEMINI_IDS = new Set([
|
|
116
|
+
'gemini-3-pro-image',
|
|
117
|
+
'gemini-3-pro-image-preview',
|
|
118
|
+
'gemini-3.1-flash-image',
|
|
119
|
+
'gemini-3.1-flash-image-preview',
|
|
120
|
+
'gemini-3.1-flash-lite-image',
|
|
121
|
+
'gemini-2.5-flash-image',
|
|
122
|
+
])
|
|
123
|
+
|
|
124
|
+
/** Classify one upstream model id into its request-shaping family. */
|
|
125
|
+
export function describeModel(model: string): ModelCatalogEntry {
|
|
126
|
+
const id = model.trim()
|
|
127
|
+
if (/^gpt-image/i.test(id)) return { family: 'gpt-image', ...ENTRIES['gpt-image'] }
|
|
128
|
+
if (/^dall-e/i.test(id)) return { family: 'dall-e', ...ENTRIES['dall-e'] }
|
|
129
|
+
if (/^grok-imagine(?:-|$)/.test(id)) return { family: 'grok', ...ENTRIES.grok }
|
|
130
|
+
if (/^nanobanana/i.test(id) || NANOBANANA_GEMINI_IDS.has(id)) return { family: 'nanobanana', ...ENTRIES.nanobanana }
|
|
131
|
+
if (/^(?:doubao-)?seedream/i.test(id)) return { family: 'seedream', ...ENTRIES.seedream }
|
|
132
|
+
if (/^(?:glm-image|cogview(?:-|$))/i.test(id)) return { family: 'zhipu', ...ENTRIES.zhipu }
|
|
133
|
+
if (/^qwen-image(?:[-_.]|$)/i.test(id)) return { family: 'qwen', ...ENTRIES.qwen }
|
|
134
|
+
if (/^(?:minimax[-_/])?image-\d+/i.test(id)) return { family: 'minimax', ...ENTRIES.minimax }
|
|
135
|
+
return { family: 'unknown', label: 'unknown', labelZh: '未知协议', known: false, supportsEdit: true, supportsAspectRatio: false, qualityTiers: [] }
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** Conservative fallback for providers whose /models response only has ids.
|
|
139
|
+
* Metadata-aware filtering lives in prompt-enhancer.ts; this catches common
|
|
140
|
+
* image model naming conventions without treating every unknown model as an
|
|
141
|
+
* image model. */
|
|
142
|
+
export function isLikelyImageModelId(model: string): boolean {
|
|
143
|
+
return /(?:^|[-_.])(?:image|img|diffusion|flux|cogview|imagen|seedream|nanobanana|grok-imagine|dall-e|stable-diffusion|sdxl|pixart|kolors|ideogram|midjourney|recraft|hunyuan|jimeng|wanx|hidream|playground)(?:$|[-_.])/i.test(model.trim())
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** The family a model id routes its request through. */
|
|
147
|
+
export function modelFamily(model: string): ModelFamily {
|
|
148
|
+
return describeModel(model).family
|
|
149
|
+
}
|
package/src/presets.ts
CHANGED
|
@@ -1,86 +1,95 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Built-in provider catalog (presets). A preset is an official or well-known
|
|
3
|
-
* OpenAI-compatible endpoint with its known model list, so the user only fills
|
|
4
|
-
* in the API key. The list ships with the package and is served to the
|
|
5
|
-
* settings card through a host route, so it can later be refreshed online like
|
|
6
|
-
* the template library.
|
|
7
|
-
*
|
|
8
|
-
* Framework-free (pure data), safe for the host routes to serve directly.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type { ModelMapping } from './protocol.ts'
|
|
12
|
-
|
|
13
|
-
/** One built-in provider the settings card can instantiate a channel from. */
|
|
14
|
-
export interface PresetProvider {
|
|
15
|
-
/** Stable preset id stored on channels created from it ('' = custom). */
|
|
16
|
-
id: string
|
|
17
|
-
/** Display name shown in the picker (also the channel's default name). */
|
|
18
|
-
name: string
|
|
19
|
-
/** Official base URL prefilled into the channel. */
|
|
20
|
-
apiUrl: string
|
|
21
|
-
/** One-line description shown in the picker. */
|
|
22
|
-
hint: string
|
|
23
|
-
/** Known model list prefilled into the channel's model catalog. */
|
|
24
|
-
models: ModelMapping[]
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const IMAGE_PRESETS: PresetProvider[] = [
|
|
28
|
-
{
|
|
29
|
-
id: 'volc-ark-seedream',
|
|
30
|
-
name: '字节 · 火山方舟(Seedream)',
|
|
31
|
-
apiUrl: 'https://ark.cn-beijing.volces.com/api/v3',
|
|
32
|
-
hint: '字节跳动官方 Seedream 文生图/图生图入口',
|
|
33
|
-
models: [
|
|
34
|
-
{ alias: 'seedream-5.0-pro', id: 'seedream-5.0-pro' },
|
|
35
|
-
{ alias: 'seedream-5.0', id: 'seedream-5.0' },
|
|
36
|
-
{ alias: 'seedream-4.0', id: 'seedream-4.0' },
|
|
37
|
-
],
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
id: 'openai-official',
|
|
41
|
-
name: 'OpenAI 官方',
|
|
42
|
-
apiUrl: 'https://api.openai.com/v1',
|
|
43
|
-
hint: 'OpenAI 官方图像生成接口',
|
|
44
|
-
models: [
|
|
45
|
-
{ alias: 'gpt-image-2', id: 'gpt-image-2' },
|
|
46
|
-
],
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
id: 'zhipu-official',
|
|
50
|
-
name: '智谱 AI 官方',
|
|
51
|
-
apiUrl: 'https://open.bigmodel.cn/api/paas/v4',
|
|
52
|
-
hint: '智谱官方 GLM-Image 图像生成接口',
|
|
53
|
-
models: [
|
|
54
|
-
{ alias: 'glm-image', id: 'glm-image' },
|
|
55
|
-
],
|
|
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
|
-
},
|
|
72
|
-
{
|
|
73
|
-
id: '
|
|
74
|
-
name: '
|
|
75
|
-
apiUrl: 'https://api.
|
|
76
|
-
hint: '
|
|
77
|
-
models: [
|
|
78
|
-
{ alias: '
|
|
79
|
-
],
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Built-in provider catalog (presets). A preset is an official or well-known
|
|
3
|
+
* OpenAI-compatible endpoint with its known model list, so the user only fills
|
|
4
|
+
* in the API key. The list ships with the package and is served to the
|
|
5
|
+
* settings card through a host route, so it can later be refreshed online like
|
|
6
|
+
* the template library.
|
|
7
|
+
*
|
|
8
|
+
* Framework-free (pure data), safe for the host routes to serve directly.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { ModelMapping } from './protocol.ts'
|
|
12
|
+
|
|
13
|
+
/** One built-in provider the settings card can instantiate a channel from. */
|
|
14
|
+
export interface PresetProvider {
|
|
15
|
+
/** Stable preset id stored on channels created from it ('' = custom). */
|
|
16
|
+
id: string
|
|
17
|
+
/** Display name shown in the picker (also the channel's default name). */
|
|
18
|
+
name: string
|
|
19
|
+
/** Official base URL prefilled into the channel. */
|
|
20
|
+
apiUrl: string
|
|
21
|
+
/** One-line description shown in the picker. */
|
|
22
|
+
hint: string
|
|
23
|
+
/** Known model list prefilled into the channel's model catalog. */
|
|
24
|
+
models: ModelMapping[]
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const IMAGE_PRESETS: PresetProvider[] = [
|
|
28
|
+
{
|
|
29
|
+
id: 'volc-ark-seedream',
|
|
30
|
+
name: '字节 · 火山方舟(Seedream)',
|
|
31
|
+
apiUrl: 'https://ark.cn-beijing.volces.com/api/v3',
|
|
32
|
+
hint: '字节跳动官方 Seedream 文生图/图生图入口',
|
|
33
|
+
models: [
|
|
34
|
+
{ alias: 'seedream-5.0-pro', id: 'seedream-5.0-pro' },
|
|
35
|
+
{ alias: 'seedream-5.0', id: 'seedream-5.0' },
|
|
36
|
+
{ alias: 'seedream-4.0', id: 'seedream-4.0' },
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: 'openai-official',
|
|
41
|
+
name: 'OpenAI 官方',
|
|
42
|
+
apiUrl: 'https://api.openai.com/v1',
|
|
43
|
+
hint: 'OpenAI 官方图像生成接口',
|
|
44
|
+
models: [
|
|
45
|
+
{ alias: 'gpt-image-2', id: 'gpt-image-2' },
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: 'zhipu-official',
|
|
50
|
+
name: '智谱 AI 官方',
|
|
51
|
+
apiUrl: 'https://open.bigmodel.cn/api/paas/v4',
|
|
52
|
+
hint: '智谱官方 GLM-Image 图像生成接口',
|
|
53
|
+
models: [
|
|
54
|
+
{ alias: 'glm-image', id: 'glm-image' },
|
|
55
|
+
],
|
|
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
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 'minimax-official',
|
|
74
|
+
name: 'MiniMax 官方(国际站)',
|
|
75
|
+
apiUrl: 'https://api.minimax.io/v1',
|
|
76
|
+
hint: 'MiniMax 原生 /image_generation 接口:image-01(国内站请把地址改为 https://api.minimaxi.com/v1;/models 不列出图片模型,请直接使用预填目录)',
|
|
77
|
+
models: [
|
|
78
|
+
{ alias: 'image-01', id: 'image-01' },
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: 'xai-grok',
|
|
83
|
+
name: 'xAI(Grok)',
|
|
84
|
+
apiUrl: 'https://api.x.ai/v1',
|
|
85
|
+
hint: 'xAI 官方接口:Grok Imagine 系列',
|
|
86
|
+
models: [
|
|
87
|
+
{ alias: 'grok-imagine-image', id: 'grok-imagine-image' },
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
]
|
|
91
|
+
|
|
92
|
+
/** Look up one built-in provider by id. */
|
|
93
|
+
export function presetById(id: string): PresetProvider | undefined {
|
|
94
|
+
return IMAGE_PRESETS.find(preset => preset.id === id)
|
|
95
|
+
}
|