更新主站 GPT Image 2.5 生成边界
将 GPT 专用新任务与锁定模型切换为 gpt-image-2.5 保留 nanobanana 普通生成默认行为 将历史 gpt-image-2 与 gpt-image-2-c 归一并触发参数回退告警
This commit is contained in:
@@ -44,6 +44,7 @@ import {
|
||||
|
||||
// 中文注释:与 api-server/src/editor_generation_config.rs 保持同名模型定价语义,前端仅作为展示兜底。
|
||||
export const IMAGE_MODEL_GPT_IMAGE_2 = 'gpt-image-2';
|
||||
export const IMAGE_MODEL_GPT_IMAGE_2_C = 'gpt-image-2-c';
|
||||
export const IMAGE_MODEL_GPT_IMAGE_2_5 = 'gpt-image-2.5';
|
||||
export const IMAGE_MODEL_NANOBANANA2 = 'gemini-3.1-flash-image-preview';
|
||||
export const DEFAULT_IMAGE_MODEL = IMAGE_MODEL_NANOBANANA2;
|
||||
@@ -638,9 +639,23 @@ export function normalizeEditorImageModel(model: string | null | undefined) {
|
||||
if (IMAGE_MODEL_NANOBANANA_ALIASES.has(normalizedModel)) {
|
||||
return IMAGE_MODEL_NANOBANANA2;
|
||||
}
|
||||
if (
|
||||
normalizedModel === IMAGE_MODEL_GPT_IMAGE_2 ||
|
||||
normalizedModel === IMAGE_MODEL_GPT_IMAGE_2_C
|
||||
) {
|
||||
return IMAGE_MODEL_GPT_IMAGE_2_5;
|
||||
}
|
||||
return normalizedModel;
|
||||
}
|
||||
|
||||
export function isLegacyEditorImageModel(model: string | null | undefined) {
|
||||
const normalizedModel = model?.trim();
|
||||
return (
|
||||
normalizedModel === IMAGE_MODEL_GPT_IMAGE_2 ||
|
||||
normalizedModel === IMAGE_MODEL_GPT_IMAGE_2_C
|
||||
);
|
||||
}
|
||||
|
||||
export function getEditorImageModelDisplayName(
|
||||
model: string | null | undefined,
|
||||
) {
|
||||
@@ -1398,6 +1413,7 @@ export function decodeCanvasGenerationInputs(
|
||||
defaultAspectRatio: string;
|
||||
fixedAspectRatios?: readonly string[];
|
||||
}) => {
|
||||
const rawModel = fields.find((field) => field.id === 'model')?.value;
|
||||
const imageModels = EDITOR_IMAGE_MODEL_OPTIONS.map(
|
||||
(option) => option.value,
|
||||
);
|
||||
@@ -1408,6 +1424,9 @@ export function decodeCanvasGenerationInputs(
|
||||
defaultModel,
|
||||
normalizeEditorImageModel,
|
||||
);
|
||||
if (typeof rawModel === 'string' && isLegacyEditorImageModel(rawModel)) {
|
||||
addFallbackWarning(['model']);
|
||||
}
|
||||
const dimensions =
|
||||
EDITOR_IMAGE_DIMENSION_OPTIONS[
|
||||
model as keyof typeof EDITOR_IMAGE_DIMENSION_OPTIONS
|
||||
|
||||
Reference in New Issue
Block a user