image-router-mcp 0.3.0 → 0.4.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.md +11 -10
- package/README.zh-TW.md +11 -10
- package/dist/index.js +1 -1
- package/dist/providers/google.js +3 -0
- package/dist/providers/openai.js +15 -7
- package/dist/schemas.d.ts +2 -0
- package/dist/schemas.js +6 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,17 +27,17 @@ Run it directly from npm with `npx`. You only need an API key for the provider y
|
|
|
27
27
|
|
|
28
28
|
Model IDs are examples and defaults, not an allowlist. Other compatible model IDs can be supplied through the `model` argument.
|
|
29
29
|
|
|
30
|
-
### Model update notes (checked 2026-
|
|
30
|
+
### Model update notes (checked 2026-12-05)
|
|
31
31
|
|
|
32
|
-
- OpenAI: Select `gpt-image-2.6-sunburst` or `gpt-image-2.6-flare` for complexity control and SVG/GIF generation. For example, pass `model: "gpt-image-2.6-flare", output_format: "svg", n: 1` with your prompt. The default stays on 2.5 Sunburst. [Image guide](https://developers.openai.com/api/docs/guides/image-generation)
|
|
33
|
-
- Google: For new projects, select `gemini-nano-banana-2.1` for conversational edits, up to 14 references and medium thinking. The compatibility default `gemini-3.1-flash-image` is deprecated with no shutdown date announced. [Model card](https://aistudio.google.com/docs/models/gemini-nano-banana-2.1)
|
|
34
|
-
- xAI: Since November 2 the exact `grok-imagine-image-quality` and `grok-imagine-image-pro` slugs route to Imagine Image 2.0 at low quality. Use `grok-imagine-image-2.0` explicitly to select quality. [Migration guide](https://docs.
|
|
32
|
+
- OpenAI: Select `gpt-image-2.6-sunburst` or `gpt-image-2.6-flare` for complexity control and SVG/GIF output on both generation and raster edits (`input_images` with PNG, JPG/JPEG, or WebP). For example, pass `model: "gpt-image-2.6-flare", output_format: "svg", n: 1` with your prompt. Use `safety_identifier` instead of the deprecated `user` field. The default stays on 2.5 Sunburst. [Image guide](https://developers.openai.com/api/docs/guides/image-generation)
|
|
33
|
+
- Google: For new projects, select `gemini-nano-banana-2.1` for conversational edits, up to 14 references, `1K`/`2K`/`4K` sizes, and medium thinking. The compatibility default `gemini-3.1-flash-image` (which also supports `512`/`0.5K`) is deprecated with no shutdown date announced. `gemini-2.5-flash-image` is scheduled to shut down on March 15, 2027. [Model card](https://aistudio.google.com/docs/models/gemini-nano-banana-2.1)
|
|
34
|
+
- xAI: Since November 2 the exact `grok-imagine-image-quality` and `grok-imagine-image-pro` slugs route to Imagine Image 2.0 at low quality. Use `grok-imagine-image-2.0` explicitly to select quality. [Migration guide](https://docs.grok.com/developers/migration/imagine-image-quality-nov-2)
|
|
35
35
|
|
|
36
36
|
Model access depends on your provider account. No automatic fallback to another paid model is performed.
|
|
37
37
|
|
|
38
|
-
No configuration change is required. See the [
|
|
38
|
+
No configuration change is required. See the [December audit](https://github.com/JiaDians/image-router-mcp/blob/main/docs/provider-audits/2026-12-05.md) for API limits and dependency decisions.
|
|
39
39
|
|
|
40
|
-
If you pin an older OpenAI model,
|
|
40
|
+
If you pin an older OpenAI model, note that `gpt-image-1` (October 23, 2026) and `gpt-image-1-mini`, `gpt-image-1.5`, `chatgpt-image-latest` (December 1, 2026) have shut down, and `gpt-image-2` / `gpt-image-2-2026-04-21` are scheduled to shut down on February 10, 2027 (migrate to `gpt-image-2.6-sunburst` or `gpt-image-2.6-flare`). Explicit pins are not silently migrated. [Official deprecations](https://developers.openai.com/api/docs/deprecations)
|
|
41
41
|
|
|
42
42
|
## Prerequisites
|
|
43
43
|
|
|
@@ -158,7 +158,7 @@ Use `file` for large images. Use `inline` or `both` only when the MCP client can
|
|
|
158
158
|
| `return_mode` | No | `file` | `file`, `inline`, or `both`. |
|
|
159
159
|
| `inline_max_bytes` | No | `4194304` (4 MiB) | Maximum size of each inline image. |
|
|
160
160
|
| `n` | No | Provider default | Number of results, from 1 to 10, when supported. Google currently returns one image. |
|
|
161
|
-
| `user` | No | — | Optional end-user identifier for provider abuse monitoring. |
|
|
161
|
+
| `user` | No | — | Optional end-user identifier for provider abuse monitoring (for OpenAI, prefer `safety_identifier`). |
|
|
162
162
|
|
|
163
163
|
### OpenAI parameters
|
|
164
164
|
|
|
@@ -167,12 +167,13 @@ Use `file` for large images. Use `inline` or `both` only when the MCP client can
|
|
|
167
167
|
| `size` | `auto`, `1024x1024`, `1536x1024`, or another supported `WIDTHxHEIGHT` | Provider default |
|
|
168
168
|
| `quality` | `auto`, `low`, `medium`, `high`, `xhigh`, `max`, `standard`, `hd` (model-dependent) | Provider default |
|
|
169
169
|
| `background` | `transparent`, `opaque`, `auto` | Provider default |
|
|
170
|
-
| `output_format` | `png`, `jpeg`, `webp`, or 2.6 generation-
|
|
170
|
+
| `output_format` | `png`, `jpeg`, `webp`, or 2.6 generation/raster-edit `svg` / `gif`. SVG requires `n: 1`. | `png` |
|
|
171
171
|
| `complexity` | `low`, `medium`, `high` on 2.6, independently of `quality` | Provider default |
|
|
172
|
-
| `frame_count` / `frame_duration_ms` | GIF only: 2–16 frames, 20–2000 ms per frame | Provider default |
|
|
172
|
+
| `frame_count` / `frame_duration_ms` | GIF generation or edits only: 2–16 frames, 20–2000 ms per frame | Provider default |
|
|
173
173
|
| `markup` | Path to a transparent PNG overlay matching the first input image's dimensions after orientation, for GPT Image 2.5/2.6 edits | None |
|
|
174
174
|
| `output_compression` | Integer `0`–`100`, GPT Image JPEG/WebP output only | Provider default |
|
|
175
175
|
| `moderation` | `low`, `auto`, for GPT Image generation and editing (not sent to DALL-E) | Provider default |
|
|
176
|
+
| `safety_identifier` | Privacy-preserving end-user identifier (up to 128 chars), preferred over deprecated `user` | None |
|
|
176
177
|
| `style` | `vivid`, `natural`; used with DALL-E 3 | Provider default |
|
|
177
178
|
|
|
178
179
|
### Google parameters
|
|
@@ -180,7 +181,7 @@ Use `file` for large images. Use `inline` or `both` only when the MCP client can
|
|
|
180
181
|
| Parameter | Values or examples | Default |
|
|
181
182
|
| --- | --- | --- |
|
|
182
183
|
| `aspect_ratio` | For example `1:1`, `16:9`, `9:16`, `4:3`, or `3:2` | Provider default |
|
|
183
|
-
| `image_size` | `512`, `0.5K`, `1K`, `2K`, `4K`;
|
|
184
|
+
| `image_size` | `512`, `0.5K`, `1K`, `2K`, `4K`; `512`/`0.5K` is for `gemini-3.1-flash-image` only, Nano Banana 2.1 supports `1K`/`2K`/`4K`, Lite supports `1K` | Provider default |
|
|
184
185
|
| `output_format` | `png`, `jpeg` | Provider default |
|
|
185
186
|
| `thinking_level` | `minimal`, `high`, plus `medium` on Nano Banana 2.1 | Provider default |
|
|
186
187
|
| `previous_interaction_id` | `metadata.interactionId` from a previous Google result | None |
|
package/README.zh-TW.md
CHANGED
|
@@ -27,17 +27,17 @@
|
|
|
27
27
|
|
|
28
28
|
以上模型是範例與預設值,不是允許清單。可透過 `model` 參數傳入其他相容的模型 ID。
|
|
29
29
|
|
|
30
|
-
### 模型更新說明(2026-
|
|
30
|
+
### 模型更新說明(2026-12-05 查核)
|
|
31
31
|
|
|
32
|
-
- OpenAI:指定 `gpt-image-2.6-sunburst` 或 `gpt-image-2.6-flare`
|
|
33
|
-
- Google:新專案建議選用 `gemini-nano-banana-2.1`,可接續編輯、使用最多 14
|
|
34
|
-
- xAI:自 11 月 2 日起,`grok-imagine-image-quality` 與 `grok-imagine-image-pro` 兩個別名由供應商轉向 Imagine Image 2.0 的低品質。若要自行選擇品質,請指定 `grok-imagine-image-2.0`。[遷移指南](https://docs.
|
|
32
|
+
- OpenAI:指定 `gpt-image-2.6-sunburst` 或 `gpt-image-2.6-flare` 即可控制構圖複雜度,並在生成與點陣圖片編輯(PNG、JPG/JPEG、WebP 輸入)輸出 SVG 或動態 GIF。例如在提示詞之外傳入 `model: "gpt-image-2.6-flare", output_format: "svg", n: 1`。建議改用 `safety_identifier` 取代棄用的 `user`。預設仍為 2.5 Sunburst。[影像指南](https://developers.openai.com/api/docs/guides/image-generation)
|
|
33
|
+
- Google:新專案建議選用 `gemini-nano-banana-2.1`,可接續編輯、使用最多 14 張參考圖、`1K`/`2K`/`4K` 尺寸及中等思考等級。為相容舊設定(包含 `512`/`0.5K` 尺寸),本工具仍預設使用 `gemini-3.1-flash-image`。Google 已將其列為棄用,但尚未公告停用日;`gemini-2.5-flash-image` 停用日為 2027 年 3 月 15 日。[模型文件](https://aistudio.google.com/docs/models/gemini-nano-banana-2.1)
|
|
34
|
+
- xAI:自 11 月 2 日起,`grok-imagine-image-quality` 與 `grok-imagine-image-pro` 兩個別名由供應商轉向 Imagine Image 2.0 的低品質。若要自行選擇品質,請指定 `grok-imagine-image-2.0`。[遷移指南](https://docs.grok.com/developers/migration/imagine-image-quality-nov-2)
|
|
35
35
|
|
|
36
36
|
模型存取權依供應商帳戶而定。無法使用時,不會自動改呼叫其他付費模型。
|
|
37
37
|
|
|
38
|
-
升級不需修改原有設定。官方來源、限制及依賴選擇見[
|
|
38
|
+
升級不需修改原有設定。官方來源、限制及依賴選擇見[十二月查核紀錄](https://github.com/JiaDians/image-router-mcp/blob/main/docs/provider-audits/2026-12-05.md)。
|
|
39
39
|
|
|
40
|
-
若固定使用舊 OpenAI
|
|
40
|
+
若固定使用舊 OpenAI 模型,請留意:`gpt-image-1`(2026 年 10 月 23 日)以及 `gpt-image-1-mini`、`gpt-image-1.5`、`chatgpt-image-latest`(2026 年 12 月 1 日)均已停用,`gpt-image-2` 與 `gpt-image-2-2026-04-21` 預計於 2027 年 2 月 10 日停用,建議改用 `gpt-image-2.6-sunburst` 或 `gpt-image-2.6-flare`。本工具不會暗中替換指定模型。[官方棄用公告](https://developers.openai.com/api/docs/deprecations)
|
|
41
41
|
|
|
42
42
|
## 前置需求
|
|
43
43
|
|
|
@@ -158,7 +158,7 @@ OPENAI_API_KEY = "your_openai_key"
|
|
|
158
158
|
| `return_mode` | 否 | `file` | `file`、`inline` 或 `both`。 |
|
|
159
159
|
| `inline_max_bytes` | 否 | `4194304`(4 MiB) | 每張 inline 圖片允許的最大大小。 |
|
|
160
160
|
| `n` | 否 | 供應商預設值 | 供應商支援時的結果數量,範圍為 1 到 10,Google 目前回傳一張。 |
|
|
161
|
-
| `user` | 否 | — |
|
|
161
|
+
| `user` | 否 | — | 選用的終端使用者識別碼,供供應商進行濫用監控(OpenAI 建議改用 `safety_identifier`)。 |
|
|
162
162
|
|
|
163
163
|
### OpenAI 參數
|
|
164
164
|
|
|
@@ -167,12 +167,13 @@ OPENAI_API_KEY = "your_openai_key"
|
|
|
167
167
|
| `size` | `auto`、`1024x1024`、`1536x1024` 或其他支援的 `WIDTHxHEIGHT` | 供應商預設值 |
|
|
168
168
|
| `quality` | `auto`、`low`、`medium`、`high`、`xhigh`、`max`、`standard`、`hd`,依模型支援 | 供應商預設值 |
|
|
169
169
|
| `background` | `transparent`、`opaque`、`auto` | 供應商預設值 |
|
|
170
|
-
| `output_format` | `png`、`jpeg`、`webp`,或 2.6
|
|
170
|
+
| `output_format` | `png`、`jpeg`、`webp`,或 2.6 生成與點陣編輯支援的 `svg`、`gif`。SVG 限 `n: 1`。 | `png` |
|
|
171
171
|
| `complexity` | 2.6 支援 `low`、`medium`、`high`,與 `quality` 分開控制 | 供應商預設值 |
|
|
172
|
-
| `frame_count`/`frame_duration_ms` | 僅限 GIF
|
|
172
|
+
| `frame_count`/`frame_duration_ms` | 僅限 GIF 生成或編輯:2–16 幀,每幀 20–2000 毫秒 | 供應商預設值 |
|
|
173
173
|
| `markup` | 2.5/2.6 編輯用的透明 PNG 標註圖路徑,尺寸須符合第一張輸入圖校正方向後的尺寸 | 無 |
|
|
174
174
|
| `output_compression` | 整數 `0`–`100`,僅供 GPT Image 的 JPEG/WebP 輸出使用 | 供應商預設值 |
|
|
175
175
|
| `moderation` | `low`、`auto`,適用 GPT Image 生成與編輯,不傳給 DALL-E | 供應商預設值 |
|
|
176
|
+
| `safety_identifier` | 隱私保護的終端使用者識別碼(最多 128 字元),建議優先取代已棄用的 `user` | 無 |
|
|
176
177
|
| `style` | `vivid`、`natural`,供 DALL-E 3 使用 | 供應商預設值 |
|
|
177
178
|
|
|
178
179
|
### Google 參數
|
|
@@ -180,7 +181,7 @@ OPENAI_API_KEY = "your_openai_key"
|
|
|
180
181
|
| 參數 | 值或範例 | 預設值 |
|
|
181
182
|
| --- | --- | --- |
|
|
182
183
|
| `aspect_ratio` | 例如 `1:1`、`16:9`、`9:16`、`4:3` 或 `3:2` | 供應商預設值 |
|
|
183
|
-
| `image_size` | `512`、`0.5K`、`1K`、`2K`、`4K
|
|
184
|
+
| `image_size` | `512`、`0.5K`、`1K`、`2K`、`4K`,`512`/`0.5K` 僅限 `gemini-3.1-flash-image`,Nano Banana 2.1 支援 `1K`/`2K`/`4K`,Lite 限 `1K` | 供應商預設值 |
|
|
184
185
|
| `output_format` | `png`、`jpeg` | 供應商預設值 |
|
|
185
186
|
| `thinking_level` | `minimal`、`high`,Nano Banana 2.1 另支援 `medium` | 供應商預設值 |
|
|
186
187
|
| `previous_interaction_id` | 前次 Google 結果的 `metadata.interactionId` | 無 |
|
package/dist/index.js
CHANGED
|
@@ -35,7 +35,7 @@ export function createServer() {
|
|
|
35
35
|
});
|
|
36
36
|
server.registerTool("openai_generate_image", {
|
|
37
37
|
title: "OpenAI image generation and editing",
|
|
38
|
-
description: "Generate or edit GPT Images. Select gpt-image-2.6-sunburst or gpt-image-2.6-flare for complexity control and SVG/GIF generation. Use a local PNG markup overlay for GPT Image 2.5/2.6 edits. The default remains 2.5 Sunburst.",
|
|
38
|
+
description: "Generate or edit GPT Images. Select gpt-image-2.6-sunburst or gpt-image-2.6-flare for complexity control and SVG/GIF generation or raster edits. Use a local PNG markup overlay for GPT Image 2.5/2.6 edits. The default remains 2.5 Sunburst.",
|
|
39
39
|
inputSchema: openAIInputShape,
|
|
40
40
|
}, async (rawParams) => {
|
|
41
41
|
try {
|
package/dist/providers/google.js
CHANGED
|
@@ -19,6 +19,9 @@ export async function generateGoogleImage(params, client = getGoogleClient()) {
|
|
|
19
19
|
if (/^gemini-nano-banana-2\.1(?:-|$)/.test(model) && (params.input_images?.length ?? 0) > 14) {
|
|
20
20
|
throw new UserInputError("Nano Banana 2.1 supports up to 14 reference images.");
|
|
21
21
|
}
|
|
22
|
+
if (/^gemini-nano-banana-2\.1(?:-|$)/.test(model) && (params.image_size === "512" || params.image_size === "0.5K")) {
|
|
23
|
+
throw new UserInputError("Nano Banana 2.1 supports image_size 1K, 2K, or 4K. Use gemini-3.1-flash-image for 512px (0.5K).");
|
|
24
|
+
}
|
|
22
25
|
if (/^gemini-3\.1-flash-lite-image(?:-|$)/.test(model) && params.image_size && params.image_size !== "1K") {
|
|
23
26
|
throw new UserInputError("Gemini 3.1 Flash Lite Image supports only image_size 1K.");
|
|
24
27
|
}
|
package/dist/providers/openai.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createReadStream } from "node:fs";
|
|
2
2
|
import OpenAI from "openai";
|
|
3
|
-
import { bytesFromBase64, base64FromUrl } from "../files.js";
|
|
3
|
+
import { bytesFromBase64, base64FromUrl, mimeFromPath } from "../files.js";
|
|
4
4
|
import { requireEnv, UserInputError } from "../errors.js";
|
|
5
5
|
let openAIClient;
|
|
6
6
|
function getOpenAIClient() {
|
|
@@ -34,13 +34,16 @@ export async function generateOpenAIImage(params, client = getOpenAIClient()) {
|
|
|
34
34
|
const outputFormat = params.output_format ?? "png";
|
|
35
35
|
const inputImages = params.input_images ?? [];
|
|
36
36
|
const dallEModel = isDallEModel(model);
|
|
37
|
-
const
|
|
37
|
+
const svgOrGif = outputFormat === "svg" || outputFormat === "gif";
|
|
38
38
|
const pre25 = dallEModel || /^gpt-image-(?:1(?:[.-]|$)|2(?:-|$))/.test(model);
|
|
39
|
-
if ((
|
|
39
|
+
if ((svgOrGif || params.complexity) && (pre25 || /^gpt-image-2\.5(?:-|$)/.test(model))) {
|
|
40
40
|
throw new UserInputError("SVG, GIF and complexity require GPT Image 2.6 or a compatible newer model.");
|
|
41
41
|
}
|
|
42
|
-
if (
|
|
43
|
-
|
|
42
|
+
if (svgOrGif && inputImages.length > 0) {
|
|
43
|
+
for (const imagePath of inputImages) {
|
|
44
|
+
mimeFromPath(imagePath);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
44
47
|
if (outputFormat === "svg" && (params.n ?? 1) !== 1)
|
|
45
48
|
throw new UserInputError("SVG output requires n=1.");
|
|
46
49
|
if (outputFormat !== "gif" && (params.frame_count !== undefined || params.frame_duration_ms !== undefined)) {
|
|
@@ -59,6 +62,9 @@ export async function generateOpenAIImage(params, client = getOpenAIClient()) {
|
|
|
59
62
|
// SDK 6 keeps Node.js 20 support. It forwards the API's new quality values unchanged,
|
|
60
63
|
// but its type declarations predate GPT Image 2.5. Wire-format tests cover both endpoints.
|
|
61
64
|
const quality = params.quality;
|
|
65
|
+
const gifOptions = outputFormat === "gif"
|
|
66
|
+
? { frame_count: params.frame_count, frame_duration_ms: params.frame_duration_ms }
|
|
67
|
+
: {};
|
|
62
68
|
const common = {
|
|
63
69
|
model,
|
|
64
70
|
prompt: params.prompt,
|
|
@@ -69,11 +75,12 @@ export async function generateOpenAIImage(params, client = getOpenAIClient()) {
|
|
|
69
75
|
? { response_format: "b64_json" }
|
|
70
76
|
: {
|
|
71
77
|
background: params.background,
|
|
72
|
-
// SDK 6 serializes these newer formats
|
|
78
|
+
// SDK 6 serializes these newer formats and fields (including safety_identifier) at runtime.
|
|
73
79
|
output_format: outputFormat,
|
|
74
80
|
complexity: params.complexity,
|
|
75
81
|
output_compression: params.output_compression,
|
|
76
82
|
moderation: params.moderation,
|
|
83
|
+
...(params.safety_identifier !== undefined && { safety_identifier: params.safety_identifier }),
|
|
77
84
|
}),
|
|
78
85
|
};
|
|
79
86
|
const response = inputImages.length > 0
|
|
@@ -83,6 +90,7 @@ export async function generateOpenAIImage(params, client = getOpenAIClient()) {
|
|
|
83
90
|
}
|
|
84
91
|
return client.images.edit({
|
|
85
92
|
...common,
|
|
93
|
+
...gifOptions,
|
|
86
94
|
...(params.markup && { markup: createReadStream(params.markup) }),
|
|
87
95
|
quality: quality,
|
|
88
96
|
image: inputImages.length === 1
|
|
@@ -93,7 +101,7 @@ export async function generateOpenAIImage(params, client = getOpenAIClient()) {
|
|
|
93
101
|
: await client.images.generate({
|
|
94
102
|
...common,
|
|
95
103
|
quality,
|
|
96
|
-
...
|
|
104
|
+
...gifOptions,
|
|
97
105
|
...(dallEModel ? { style: params.style } : {}),
|
|
98
106
|
});
|
|
99
107
|
const data = "data" in response ? response.data ?? [] : [];
|
package/dist/schemas.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export declare const openAIInputShape: {
|
|
|
43
43
|
auto: "auto";
|
|
44
44
|
low: "low";
|
|
45
45
|
}>>;
|
|
46
|
+
readonly safety_identifier: z.ZodOptional<z.ZodString>;
|
|
46
47
|
readonly style: z.ZodOptional<z.ZodEnum<{
|
|
47
48
|
vivid: "vivid";
|
|
48
49
|
natural: "natural";
|
|
@@ -153,6 +154,7 @@ export declare const openAIParamsSchema: z.ZodObject<{
|
|
|
153
154
|
auto: "auto";
|
|
154
155
|
low: "low";
|
|
155
156
|
}>>;
|
|
157
|
+
safety_identifier: z.ZodOptional<z.ZodString>;
|
|
156
158
|
style: z.ZodOptional<z.ZodEnum<{
|
|
157
159
|
vivid: "vivid";
|
|
158
160
|
natural: "natural";
|
package/dist/schemas.js
CHANGED
|
@@ -19,7 +19,7 @@ const commonImageShape = {
|
|
|
19
19
|
.default(DEFAULT_INLINE_MAX_BYTES)
|
|
20
20
|
.describe("Maximum bytes allowed for each inline image response."),
|
|
21
21
|
n: z.number().int().min(1).max(10).optional().describe("Number of images to generate when the provider supports it."),
|
|
22
|
-
user: nonEmptyString.optional().describe("Optional end-user identifier for provider abuse monitoring."),
|
|
22
|
+
user: nonEmptyString.optional().describe("Optional end-user identifier for provider abuse monitoring. For OpenAI, prefer safety_identifier."),
|
|
23
23
|
};
|
|
24
24
|
export const openAIInputShape = {
|
|
25
25
|
...commonImageShape,
|
|
@@ -27,13 +27,14 @@ export const openAIInputShape = {
|
|
|
27
27
|
size: nonEmptyString.optional().describe("OpenAI size, such as auto, 1024x1024, 1536x1024, or any supported WIDTHxHEIGHT."),
|
|
28
28
|
quality: z.enum(["auto", "low", "medium", "high", "xhigh", "max", "standard", "hd"]).optional().describe("OpenAI quality. xhigh and max require GPT Image 2.5 or a compatible newer model. Higher quality can increase cost and latency."),
|
|
29
29
|
background: z.enum(["transparent", "opaque", "auto"]).optional().describe("OpenAI background option."),
|
|
30
|
-
output_format: z.enum(["png", "jpeg", "webp", "svg", "gif"]).default("png").describe("SVG and animated GIF
|
|
30
|
+
output_format: z.enum(["png", "jpeg", "webp", "svg", "gif"]).default("png").describe("PNG, JPEG, or WebP, plus SVG and animated GIF on GPT Image 2.6 generation or raster edits. SVG requires n=1."),
|
|
31
31
|
complexity: z.enum(["low", "medium", "high"]).optional().describe("GPT Image 2.6 planning complexity, independent of rendering quality."),
|
|
32
|
-
frame_count: z.number().int().min(2).max(16).optional().describe("GIF generation only. 2–16 frames (portable range across the guide and API reference)."),
|
|
33
|
-
frame_duration_ms: z.number().int().min(20).max(2000).optional().describe("GIF generation only. Frame delay in milliseconds, rounded by the provider to 10 ms."),
|
|
32
|
+
frame_count: z.number().int().min(2).max(16).optional().describe("GIF generation or edit only. 2–16 frames (portable range across the guide and API reference)."),
|
|
33
|
+
frame_duration_ms: z.number().int().min(20).max(2000).optional().describe("GIF generation or edit only. Frame delay in milliseconds, rounded by the provider to 10 ms."),
|
|
34
34
|
markup: nonEmptyString.optional().describe("Local transparent PNG annotation overlay for a GPT Image 2.5/2.6 edit. Match the first input image's oriented dimensions."),
|
|
35
35
|
output_compression: z.number().int().min(0).max(100).optional().describe("Output compression from 0 to 100 for JPEG or WebP GPT Image output."),
|
|
36
36
|
moderation: z.enum(["low", "auto"]).optional().describe("Moderation for GPT Image generation and editing. Omit to use the provider default. Not sent to DALL-E models."),
|
|
37
|
+
safety_identifier: nonEmptyString.max(128).optional().describe("Optional privacy-preserving end-user identifier (up to 128 chars) for OpenAI safety monitoring. Preferred over deprecated user."),
|
|
37
38
|
style: z.enum(["vivid", "natural"]).optional().describe("DALL-E 3 style option."),
|
|
38
39
|
};
|
|
39
40
|
export const googleInputShape = {
|
|
@@ -46,7 +47,7 @@ export const googleInputShape = {
|
|
|
46
47
|
image_size: z
|
|
47
48
|
.enum(["512", "0.5K", "1K", "2K", "4K"])
|
|
48
49
|
.optional()
|
|
49
|
-
.describe('Google image size where supported.
|
|
50
|
+
.describe('Google image size where supported. Nano Banana 2.1 supports 1K, 2K, and 4K; 512 (legacy 0.5K) is only supported on Gemini 3.1 Flash Image, and Lite supports 1K.'),
|
|
50
51
|
};
|
|
51
52
|
export const xaiInputShape = {
|
|
52
53
|
...commonImageShape,
|