From 5b1b0ddb9a5813bb79bd20d648c30cfab7ae1625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Fri, 18 Sep 2026 23:31:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E9=BD=90=20GPT=20Image=202.5=20?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=9B=9E=E5=BD=92=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新模型标签、提交 payload 与固定模型断言 覆盖 gpt-image-2-c 历史恢复及参数回退告警 保留历史 fixture 原值并验证 nanobanana 默认不变 --- ...CanvasBasicGenerationComposerView.test.tsx | 6 +-- ...asCharacterGenerationComposerView.test.tsx | 6 +-- ...CanvasEditorGenerationIntegration.test.tsx | 6 +-- ...ImageCanvasGenerationComposerView.test.tsx | 2 +- .../ImageCanvasGenerationDialogModel.test.ts | 25 +++++----- ...eCanvasGenerationImageOptionsView.test.tsx | 23 ++++++---- .../ImageCanvasGenerationModel.test.ts | 46 +++++++++++++++++-- ...ageCanvasGenerationSubmissionModel.test.ts | 25 +++++----- ...CanvasIconSpritesheetComposerView.test.tsx | 6 +-- ...PublicationMaterialsDemoPanelView.test.tsx | 4 +- .../ImageCanvasQuickEditPanelView.test.tsx | 6 +-- ...mageCanvasSpecGenerationPanelView.test.tsx | 4 +- ...anvasGenerationSubmissionWorkflow.test.tsx | 10 ++-- 13 files changed, 106 insertions(+), 63 deletions(-) diff --git a/src/components/image-editor/ImageCanvasBasicGenerationComposerView.test.tsx b/src/components/image-editor/ImageCanvasBasicGenerationComposerView.test.tsx index 7cd021358..60e5d8e6c 100644 --- a/src/components/image-editor/ImageCanvasBasicGenerationComposerView.test.tsx +++ b/src/components/image-editor/ImageCanvasBasicGenerationComposerView.test.tsx @@ -232,10 +232,10 @@ describe('ImageCanvasBasicGenerationComposerView', () => { ); const modelPanel = screen.getByRole('menu', { name: '生成图片模型选项' }); fireEvent.click( - within(modelPanel).getByRole('button', { name: /gpt-image-2/ }), + within(modelPanel).getByRole('button', { name: /GPT Image 2\.5/ }), ); - expect(screen.getByLabelText('当前模型').textContent).toBe('gpt-image-2'); + expect(screen.getByLabelText('当前模型').textContent).toBe('gpt-image-2.5'); const submitButton = within(panel).getByRole('button', { name: '生成' }); expect(submitButton.textContent).toBe('生成5泥点'); }); @@ -284,7 +284,7 @@ describe('ImageCanvasBasicGenerationComposerView', () => { ).toBeTruthy(); expect( within(panel).getByRole('button', { - name: '快速编辑图片模型 gpt-image-2', + name: '快速编辑图片模型 GPT Image 2.5', }), ).toBeTruthy(); expect(within(panel).getByRole('button', { name: '修改' })).toBeTruthy(); diff --git a/src/components/image-editor/ImageCanvasCharacterGenerationComposerView.test.tsx b/src/components/image-editor/ImageCanvasCharacterGenerationComposerView.test.tsx index 05a538ab8..200498fa9 100644 --- a/src/components/image-editor/ImageCanvasCharacterGenerationComposerView.test.tsx +++ b/src/components/image-editor/ImageCanvasCharacterGenerationComposerView.test.tsx @@ -14,7 +14,7 @@ import type { SpecGenerationType, UploadTarget, } from './ImageCanvasEditorTypes'; -import { IMAGE_MODEL_GPT_IMAGE_2 } from './ImageCanvasGenerationModel'; +import { IMAGE_MODEL_GPT_IMAGE_2_5 } from './ImageCanvasGenerationModel'; function createDialog( patch: Partial = {}, @@ -165,9 +165,9 @@ describe('ImageCanvasCharacterGenerationComposerView', () => { fireEvent.click( screen.getByRole('button', { name: '生成图片模型 nanobanana2' }), ); - fireEvent.click(screen.getByRole('button', { name: 'gpt-image-2' })); + fireEvent.click(screen.getByRole('button', { name: 'GPT Image 2.5' })); - expect(rememberImageModel).toHaveBeenCalledWith(IMAGE_MODEL_GPT_IMAGE_2); + expect(rememberImageModel).toHaveBeenCalledWith(IMAGE_MODEL_GPT_IMAGE_2_5); expect(screen.getByRole('button', { name: '生成' }).textContent).toBe( '生成3泥点', ); diff --git a/src/components/image-editor/ImageCanvasEditorGenerationIntegration.test.tsx b/src/components/image-editor/ImageCanvasEditorGenerationIntegration.test.tsx index 004c9d5bd..d07e9a478 100644 --- a/src/components/image-editor/ImageCanvasEditorGenerationIntegration.test.tsx +++ b/src/components/image-editor/ImageCanvasEditorGenerationIntegration.test.tsx @@ -1807,7 +1807,7 @@ describe('ImageCanvasEditorView generation integration', () => { const characterPanel = screen.getByRole('dialog', { name: '生成角色形象', }); - selectGenerationModel(characterPanel, 'gpt-image-2'); + selectGenerationModel(characterPanel, 'GPT Image 2.5'); selectGenerationDimensions(characterPanel, '2:3', '2K'); setPlainTextEditorValue( within(characterPanel).getByLabelText('角色设定'), @@ -1822,7 +1822,7 @@ describe('ImageCanvasEditorView generation integration', () => { expect.objectContaining({ kind: 'character', prompt: '蓝衣剑士', - model: 'gpt-image-2', + model: 'gpt-image-2.5', aspectRatio: '2:3', imageSize: '2K', }), @@ -1838,7 +1838,7 @@ describe('ImageCanvasEditorView generation integration', () => { const iconPanel = screen.getByRole('dialog', { name: '生成图标素材' }); expect( within(iconPanel).getByRole('button', { - name: '生成图片模型 gpt-image-2', + name: '生成图片模型 GPT Image 2.5', }), ).toBeTruthy(); fireEvent.click( diff --git a/src/components/image-editor/ImageCanvasGenerationComposerView.test.tsx b/src/components/image-editor/ImageCanvasGenerationComposerView.test.tsx index ceb4edc9e..582b7f9da 100644 --- a/src/components/image-editor/ImageCanvasGenerationComposerView.test.tsx +++ b/src/components/image-editor/ImageCanvasGenerationComposerView.test.tsx @@ -445,7 +445,7 @@ describe('ImageCanvasGenerationComposerView', () => { ).toBeTruthy(); expect( within(panel).getByRole('button', { - name: '快速编辑图片模型 gpt-image-2', + name: '快速编辑图片模型 GPT Image 2.5', }), ).toBeTruthy(); expect(within(panel).getByRole('button', { name: '修改' })).toBeTruthy(); diff --git a/src/components/image-editor/ImageCanvasGenerationDialogModel.test.ts b/src/components/image-editor/ImageCanvasGenerationDialogModel.test.ts index c1b69ca4e..9787afda4 100644 --- a/src/components/image-editor/ImageCanvasGenerationDialogModel.test.ts +++ b/src/components/image-editor/ImageCanvasGenerationDialogModel.test.ts @@ -40,6 +40,7 @@ import { } from './ImageCanvasGenerationDialogModel'; import { IMAGE_MODEL_GPT_IMAGE_2, + IMAGE_MODEL_GPT_IMAGE_2_5, IMAGE_MODEL_NANOBANANA2, } from './ImageCanvasGenerationModel'; @@ -187,7 +188,7 @@ describe('ImageCanvasGenerationDialogModel', () => { ).toMatchObject({ mode: 'character', style: 'none', - imageModel: 'gpt-image-2', + imageModel: 'gpt-image-2.5', aspectRatio: '1:1', imageSize: '1K', characterSpecReference: null, @@ -260,7 +261,7 @@ describe('ImageCanvasGenerationDialogModel', () => { }), ).toMatchObject({ mode: 'ui-design', - imageModel: 'gpt-image-2', + imageModel: 'gpt-image-2.5', aspectRatio: '16:9', imageSize: '1K', uiDesignSpecReference: null, @@ -465,7 +466,7 @@ describe('ImageCanvasGenerationDialogModel', () => { status: 'idle', composerOpen: true, sourceLayerId: 'layer-source', - imageModel: 'gpt-image-2', + imageModel: 'gpt-image-2.5', aspectRatio: '4:3', imageSize: '1K', }); @@ -475,7 +476,7 @@ describe('ImageCanvasGenerationDialogModel', () => { size: '1024x768', aspectRatio: '4:3', imageSize: '1K', - model: 'gpt-image-2', + model: 'gpt-image-2.5', quickEditReferences: [], status: 'idle', }); @@ -516,7 +517,7 @@ describe('ImageCanvasGenerationDialogModel', () => { expect(createEditDialogDraft(sourceLayer)).toMatchObject({ prompt: '改成雨天', - imageModel: IMAGE_MODEL_GPT_IMAGE_2, + imageModel: IMAGE_MODEL_GPT_IMAGE_2_5, aspectRatio: '2:3', imageSize: '2K', }); @@ -737,7 +738,7 @@ describe('ImageCanvasGenerationDialogModel', () => { mode: 'generate', prompt: '普通图', sourceLayerId: 'layer-source', - imageModel: 'gpt-image-2', + imageModel: 'gpt-image-2.5', aspectRatio: '2:3', imageSize: '2K', style: 'none', @@ -778,7 +779,7 @@ describe('ImageCanvasGenerationDialogModel', () => { }), ).toMatchObject({ mode, - imageModel: IMAGE_MODEL_GPT_IMAGE_2, + imageModel: IMAGE_MODEL_GPT_IMAGE_2_5, aspectRatio: '2:3', imageSize: '2K', placeholder: { @@ -815,7 +816,7 @@ describe('ImageCanvasGenerationDialogModel', () => { mode: 'generate', prompt: '元数据提示词', generatedLayerId: 'layer-source', - imageModel: 'gpt-image-2', + imageModel: 'gpt-image-2.5', placeholder: { x: 120, y: 140, @@ -1149,7 +1150,7 @@ describe('ImageCanvasGenerationDialogModel', () => { ).toMatchObject({ mode: 'generate', prompt: '', - imageModel: IMAGE_MODEL_GPT_IMAGE_2, + imageModel: IMAGE_MODEL_GPT_IMAGE_2_5, aspectRatio: '2:3', imageSize: '2K', }); @@ -1204,7 +1205,7 @@ describe('ImageCanvasGenerationDialogModel', () => { prompt: '雨夜海边车站', sceneStylePreset: 'custom', sceneCustomStyle: '复古像素风', - imageModel: IMAGE_MODEL_GPT_IMAGE_2, + imageModel: IMAGE_MODEL_GPT_IMAGE_2_5, aspectRatio: '16:9', imageSize: '2K', generationReferences: [ @@ -1273,7 +1274,7 @@ describe('ImageCanvasGenerationDialogModel', () => { mode: 'scene', prompt: '雨夜海边车站', sceneStylePreset: 'watercolor', - imageModel: IMAGE_MODEL_GPT_IMAGE_2, + imageModel: IMAGE_MODEL_GPT_IMAGE_2_5, aspectRatio: '16:9', imageSize: '2K', }); @@ -1394,7 +1395,7 @@ describe('ImageCanvasGenerationDialogModel', () => { imageSize: '2K', }), ).toMatchObject({ - model: IMAGE_MODEL_GPT_IMAGE_2, + model: IMAGE_MODEL_GPT_IMAGE_2_5, aspectRatio: '16:9', imageSize: '2K', }); diff --git a/src/components/image-editor/ImageCanvasGenerationImageOptionsView.test.tsx b/src/components/image-editor/ImageCanvasGenerationImageOptionsView.test.tsx index 72b1ad1e7..0f19fbe58 100644 --- a/src/components/image-editor/ImageCanvasGenerationImageOptionsView.test.tsx +++ b/src/components/image-editor/ImageCanvasGenerationImageOptionsView.test.tsx @@ -9,6 +9,7 @@ import { ImageCanvasGenerationImageOptionsView } from './ImageCanvasGenerationIm import { calculateEditorImageGenerationPrice, IMAGE_MODEL_GPT_IMAGE_2, + IMAGE_MODEL_GPT_IMAGE_2_5, IMAGE_MODEL_NANOBANANA2, } from './ImageCanvasGenerationModel'; @@ -226,17 +227,19 @@ describe('ImageCanvasGenerationImageOptionsView', () => { expect( within(panel).getByRole('button', { name: 'nanobanana2' }), ).toBeTruthy(); - fireEvent.click(within(panel).getByRole('button', { name: 'gpt-image-2' })); + fireEvent.click( + within(panel).getByRole('button', { name: 'GPT Image 2.5' }), + ); expect(screen.getByRole('menu', { name: '生成图片模型选项' })).toBeTruthy(); - expect(rememberImageModel).toHaveBeenCalledWith(IMAGE_MODEL_GPT_IMAGE_2); + expect(rememberImageModel).toHaveBeenCalledWith(IMAGE_MODEL_GPT_IMAGE_2_5); expect(screen.getByLabelText('当前模型').textContent).toBe( - IMAGE_MODEL_GPT_IMAGE_2, + IMAGE_MODEL_GPT_IMAGE_2_5, ); expect(screen.getByLabelText('当前比例').textContent).toBe('9:16'); expect(screen.getByLabelText('当前尺寸').textContent).toBe('1K'); expect( - screen.getByRole('button', { name: '生成图片模型 gpt-image-2' }), + screen.getByRole('button', { name: '生成图片模型 GPT Image 2.5' }), ).toBeTruthy(); expect( screen.getByRole('button', { name: '生成角色形象' }).textContent, @@ -261,7 +264,7 @@ describe('ImageCanvasGenerationImageOptionsView', () => { ); const modelButton = screen.getByRole('button', { - name: '生成图片模型 gpt-image-2', + name: '生成图片模型 GPT Image 2.5', }) as HTMLButtonElement; expect(modelButton.disabled).toBe(true); @@ -302,12 +305,12 @@ describe('ImageCanvasGenerationImageOptionsView', () => { fireEvent.click( within(screen.getByRole('menu', { name: '生成图片模型选项' })).getByRole( 'button', - { name: 'gpt-image-2' }, + { name: 'GPT Image 2.5' }, ), ); expect(alertMock).toHaveBeenCalledWith( - '当前已有 8 张参考图,gpt-image-2 最多允许 4 张,请先删除多余参考图后再切换', + '当前已有 8 张参考图,GPT Image 2.5 最多允许 4 张,请先删除多余参考图后再切换', ); expect(screen.getByLabelText('当前参考图数量').textContent).toBe('8'); expect(screen.getByLabelText('当前模型').textContent).toBe( @@ -338,7 +341,7 @@ describe('ImageCanvasGenerationImageOptionsView', () => { fireEvent.click( within(screen.getByRole('menu', { name: '生成图片模型选项' })).getByRole( 'button', - { name: 'gpt-image-2' }, + { name: 'GPT Image 2.5' }, ), ); @@ -412,12 +415,12 @@ describe('ImageCanvasGenerationImageOptionsView', () => { fireEvent.click( within(screen.getByRole('menu', { name: '生成图片模型选项' })).getByRole( 'button', - { name: 'gpt-image-2' }, + { name: 'GPT Image 2.5' }, ), ); expect(screen.getByLabelText('当前模型').textContent).toBe( - IMAGE_MODEL_GPT_IMAGE_2, + IMAGE_MODEL_GPT_IMAGE_2_5, ); expect(screen.getByLabelText('当前比例').textContent).toBe('4:3'); expect(screen.getByLabelText('当前尺寸').textContent).toBe('1K'); diff --git a/src/components/image-editor/ImageCanvasGenerationModel.test.ts b/src/components/image-editor/ImageCanvasGenerationModel.test.ts index 5a08c5c05..fdfb344ca 100644 --- a/src/components/image-editor/ImageCanvasGenerationModel.test.ts +++ b/src/components/image-editor/ImageCanvasGenerationModel.test.ts @@ -48,6 +48,8 @@ import { getGenerationFrameAriaLabel, getGenerationFrameLabel, IMAGE_MODEL_GPT_IMAGE_2, + IMAGE_MODEL_GPT_IMAGE_2_5, + IMAGE_MODEL_GPT_IMAGE_2_C, IMAGE_MODEL_NANOBANANA2, isNormalizedCanvasGenerationInputs, isQuickEditSupportedLayer, @@ -237,7 +239,7 @@ describe('ImageCanvasGenerationModel', () => { applyEditorGenerationPricingConfig({ models: { ...EDITOR_MODEL_MUD_POINT_CONFIG, - [IMAGE_MODEL_GPT_IMAGE_2]: { + [IMAGE_MODEL_GPT_IMAGE_2_5]: { unit: 'perGeneration', prices: { '1K': 29, @@ -690,7 +692,17 @@ describe('ImageCanvasGenerationModel', () => { imageSize: '2K', }), ); - expect(valid).toMatchObject({ ok: true, warnings: [] }); + expect(valid).toMatchObject({ + ok: true, + inputs: { + fields: expect.arrayContaining([ + { id: 'model', title: '模型', value: IMAGE_MODEL_GPT_IMAGE_2_5 }, + ]), + }, + warnings: expect.arrayContaining([ + expect.objectContaining({ fieldIds: ['model'] }), + ]), + }); const alias = decodeCanvasGenerationInputs({ version: 2, @@ -714,6 +726,32 @@ describe('ImageCanvasGenerationModel', () => { ).toBe(IMAGE_MODEL_NANOBANANA2); }); + it('restores the concrete legacy GPT image value to GPT Image 2.5 with a warning', () => { + const decoded = decodeCanvasGenerationInputs({ + version: 2, + action: 'image.generate', + fields: [ + { id: 'prompt', title: '生成提示词', value: '旧模型素材' }, + { id: 'model', title: '模型', value: IMAGE_MODEL_GPT_IMAGE_2_C }, + { id: 'aspectRatio', title: '比例', value: '1:1' }, + { id: 'imageSize', title: '尺寸', value: '1K' }, + ], + references: [], + }); + + expect(decoded).toMatchObject({ + ok: true, + inputs: { + fields: expect.arrayContaining([ + { id: 'model', title: '模型', value: IMAGE_MODEL_GPT_IMAGE_2_5 }, + ]), + }, + warnings: expect.arrayContaining([ + expect.objectContaining({ fieldIds: ['model'] }), + ]), + }); + }); + it('falls invalid image and workflow parameters back within V2', () => { const image = decodeCanvasGenerationInputs({ version: 2, @@ -932,14 +970,14 @@ describe('ImageCanvasGenerationModel', () => { label: 'nanobanana2', value: 'gemini-3.1-flash-image-preview', }, - { label: 'gpt-image-2', value: 'gpt-image-2' }, + { label: 'GPT Image 2.5', value: 'gpt-image-2.5' }, ]); expect(buildQuickEditModelOptions('nanobanana2')).toEqual([ { label: 'nanobanana2', value: 'gemini-3.1-flash-image-preview', }, - { label: 'gpt-image-2', value: 'gpt-image-2' }, + { label: 'GPT Image 2.5', value: 'gpt-image-2.5' }, ]); expect( isQuickEditSupportedLayer({ diff --git a/src/components/image-editor/ImageCanvasGenerationSubmissionModel.test.ts b/src/components/image-editor/ImageCanvasGenerationSubmissionModel.test.ts index 7a7ec1dd8..f34db2f07 100644 --- a/src/components/image-editor/ImageCanvasGenerationSubmissionModel.test.ts +++ b/src/components/image-editor/ImageCanvasGenerationSubmissionModel.test.ts @@ -4,6 +4,7 @@ import { EDITOR_ICON_DESCRIPTION_MAX_CHARS } from '../../services/image-editor/e import type { CanvasLayer } from './ImageCanvasEditorTypes'; import { IMAGE_MODEL_GPT_IMAGE_2, + IMAGE_MODEL_GPT_IMAGE_2_5, IMAGE_MODEL_NANOBANANA2, } from './ImageCanvasGenerationModel'; import { @@ -333,14 +334,14 @@ describe('ImageCanvasGenerationSubmissionModel', () => { expect(plan).toMatchObject({ kind: 'edit', editInput: { - model: IMAGE_MODEL_GPT_IMAGE_2, + model: IMAGE_MODEL_GPT_IMAGE_2_5, aspectRatio: '2:3', imageSize: '2K', size: '1365x2048', }, generationInputs: expect.objectContaining({ fields: expect.arrayContaining([ - { id: 'model', title: '模型', value: IMAGE_MODEL_GPT_IMAGE_2 }, + { id: 'model', title: '模型', value: IMAGE_MODEL_GPT_IMAGE_2_5 }, { id: 'aspectRatio', title: '比例', value: '2:3' }, { id: 'imageSize', title: '尺寸', value: '2K' }, ]), @@ -384,7 +385,7 @@ describe('ImageCanvasGenerationSubmissionModel', () => { sourceLayer, editInput: { size: '1024x768', - model: IMAGE_MODEL_GPT_IMAGE_2, + model: IMAGE_MODEL_GPT_IMAGE_2_5, aspectRatio: '4:3', imageSize: '1K', referenceImageSrcs: ['data:image/png;base64,style'], @@ -420,7 +421,7 @@ describe('ImageCanvasGenerationSubmissionModel', () => { ], }), }, - rememberImageModel: IMAGE_MODEL_GPT_IMAGE_2, + rememberImageModel: IMAGE_MODEL_GPT_IMAGE_2_5, }); }); @@ -650,7 +651,7 @@ describe('ImageCanvasGenerationSubmissionModel', () => { input: { prompt: '白发骑士', kind: 'character', - model: 'gpt-image-2', + model: 'gpt-image-2.5', screenColor: 'auto', segModel: 'birefnet', style: 'pixelArt', @@ -665,7 +666,7 @@ describe('ImageCanvasGenerationSubmissionModel', () => { assetKind: 'character', title: '角色形象 9', }, - rememberImageModel: 'gpt-image-2', + rememberImageModel: 'gpt-image-2.5', }); expect(plan.kind === 'image' ? plan.result.generationInputs : null).toEqual( expect.objectContaining({ @@ -727,7 +728,7 @@ describe('ImageCanvasGenerationSubmissionModel', () => { normalizedPrompt: '设计移动端商城首页', input: { kind: 'ui-design', - model: IMAGE_MODEL_GPT_IMAGE_2, + model: IMAGE_MODEL_GPT_IMAGE_2_5, aspectRatio: '16:9', imageSize: '1K', referenceImageSrcs: [ @@ -762,7 +763,7 @@ describe('ImageCanvasGenerationSubmissionModel', () => { ], }), }, - rememberImageModel: IMAGE_MODEL_GPT_IMAGE_2, + rememberImageModel: IMAGE_MODEL_GPT_IMAGE_2_5, }); }); @@ -802,7 +803,7 @@ describe('ImageCanvasGenerationSubmissionModel', () => { prompt: expect.stringContaining('【宣发素材类型】游戏首图'), size: '720x540', kind: 'publication-material', - model: 'gpt-image-2', + model: 'gpt-image-2.5', aspectRatio: '4:3', imageSize: '1K', referenceImageSrcs: ['data:image/png;base64,ref'], @@ -950,7 +951,7 @@ describe('ImageCanvasGenerationSubmissionModel', () => { expect(plan.input).toEqual( expect.objectContaining({ kind: 'publication-material', - model: 'gpt-image-2', + model: 'gpt-image-2.5', size: '1280x720', aspectRatio: '16:9', imageSize: '1K', @@ -1080,7 +1081,7 @@ describe('ImageCanvasGenerationSubmissionModel', () => { referenceId: 'resource-icon-spec', referenceImageSrcs: ['data:image/png;base64,ref'], iconDescriptions: ['返回按钮\n\n设置按钮'], - model: 'gpt-image-2', + model: 'gpt-image-2.5', screenColor: 'auto', segModel: 'birefnet', style: 'pixelArt', @@ -1110,7 +1111,7 @@ describe('ImageCanvasGenerationSubmissionModel', () => { }, ], }), - rememberImageModel: 'gpt-image-2', + rememberImageModel: 'gpt-image-2.5', resultTitle: '冒险游戏图标', }); }); diff --git a/src/components/image-editor/ImageCanvasIconSpritesheetComposerView.test.tsx b/src/components/image-editor/ImageCanvasIconSpritesheetComposerView.test.tsx index f1c4d4bfc..c44630bfe 100644 --- a/src/components/image-editor/ImageCanvasIconSpritesheetComposerView.test.tsx +++ b/src/components/image-editor/ImageCanvasIconSpritesheetComposerView.test.tsx @@ -249,11 +249,11 @@ describe('ImageCanvasIconSpritesheetComposerView', () => { ); const modelPanel = screen.getByRole('menu', { name: '生成图片模型选项' }); fireEvent.click( - within(modelPanel).getByRole('button', { name: 'gpt-image-2' }), + within(modelPanel).getByRole('button', { name: 'GPT Image 2.5' }), ); - expect(rememberImageModel).toHaveBeenCalledWith('gpt-image-2'); - expect(screen.getByLabelText('当前模型').textContent).toBe('gpt-image-2'); + expect(rememberImageModel).toHaveBeenCalledWith('gpt-image-2.5'); + expect(screen.getByLabelText('当前模型').textContent).toBe('gpt-image-2.5'); expect(screen.getByLabelText('当前尺寸').textContent).toBe('1K'); expect(screen.getByRole('button', { name: '生成' }).textContent).toBe( '生成3泥点', diff --git a/src/components/image-editor/ImageCanvasPublicationMaterialsDemoPanelView.test.tsx b/src/components/image-editor/ImageCanvasPublicationMaterialsDemoPanelView.test.tsx index d6f5f47ad..aabefce7e 100644 --- a/src/components/image-editor/ImageCanvasPublicationMaterialsDemoPanelView.test.tsx +++ b/src/components/image-editor/ImageCanvasPublicationMaterialsDemoPanelView.test.tsx @@ -49,14 +49,14 @@ function PublicationPanelHarness({ } describe('ImageCanvasPublicationMaterialsDemoPanelView', () => { - it('locks publication material model selection to gpt-image-2', () => { + it('locks publication material model selection to GPT Image 2.5', () => { const rememberImageModel = vi.fn(); render( , ); const modelButton = screen.getByRole('button', { - name: '宣发素材模型 gpt-image-2', + name: '宣发素材模型 GPT Image 2.5', }) as HTMLButtonElement; const description = screen.getByRole('textbox', { name: '游戏首图一句话描述游戏', diff --git a/src/components/image-editor/ImageCanvasQuickEditPanelView.test.tsx b/src/components/image-editor/ImageCanvasQuickEditPanelView.test.tsx index 98f8e90a1..106c6230f 100644 --- a/src/components/image-editor/ImageCanvasQuickEditPanelView.test.tsx +++ b/src/components/image-editor/ImageCanvasQuickEditPanelView.test.tsx @@ -107,9 +107,9 @@ describe('ImageCanvasQuickEditPanelView', () => { screen.getByRole('button', { name: '快速编辑模型 nanobanana2' }), ); expect(screen.getByRole('button', { name: 'nanobanana2' })).toBeTruthy(); - fireEvent.click(screen.getByRole('button', { name: 'gpt-image-2' })); - expect(screen.getByLabelText('当前模型').textContent).toBe('gpt-image-2'); - expect(rememberImageModel).toHaveBeenCalledWith('gpt-image-2'); + fireEvent.click(screen.getByRole('button', { name: 'GPT Image 2.5' })); + expect(screen.getByLabelText('当前模型').textContent).toBe('gpt-image-2.5'); + expect(rememberImageModel).toHaveBeenCalledWith('gpt-image-2.5'); }); it('renders the failure message inside the quick edit alert', () => { diff --git a/src/components/image-editor/ImageCanvasSpecGenerationPanelView.test.tsx b/src/components/image-editor/ImageCanvasSpecGenerationPanelView.test.tsx index 9a4121c39..b4839b7c4 100644 --- a/src/components/image-editor/ImageCanvasSpecGenerationPanelView.test.tsx +++ b/src/components/image-editor/ImageCanvasSpecGenerationPanelView.test.tsx @@ -197,7 +197,7 @@ describe('ImageCanvasSpecGenerationPanelView', () => { name: '生成图片尺寸 16:9·2K', }) as HTMLButtonElement; const modelButton = screen.getByRole('button', { - name: '生成图片模型 gpt-image-2', + name: '生成图片模型 GPT Image 2.5', }) as HTMLButtonElement; expect(dimensionsButton.disabled).toBe(true); @@ -256,7 +256,7 @@ describe('ImageCanvasSpecGenerationPanelView', () => { ); const submitButton = screen.getByRole('button', { name: '生成UI设计图' }); const modelButton = screen.getByRole('button', { - name: '生成图片模型 gpt-image-2', + name: '生成图片模型 GPT Image 2.5', }) as HTMLButtonElement; expect(submitButton.textContent).toBe('生成3泥点'); diff --git a/src/components/image-editor/useImageCanvasGenerationSubmissionWorkflow.test.tsx b/src/components/image-editor/useImageCanvasGenerationSubmissionWorkflow.test.tsx index b481fdb2c..a58a4d366 100644 --- a/src/components/image-editor/useImageCanvasGenerationSubmissionWorkflow.test.tsx +++ b/src/components/image-editor/useImageCanvasGenerationSubmissionWorkflow.test.tsx @@ -1178,7 +1178,7 @@ describe('useImageCanvasGenerationSubmissionWorkflow', () => { prompt: '把当前图改成雨天', sourceReferenceId: 'resource-source', size: '1024x768', - model: 'gpt-image-2', + model: 'gpt-image-2.5', targetLayerId: 'layer-source', assetLabel: '源图 快速编辑', }), @@ -1461,7 +1461,7 @@ describe('useImageCanvasGenerationSubmissionWorkflow', () => { referenceImageSrcs: [ 'generated-character-drafts/editor/generation-references/reference.png', ], - model: 'gpt-image-2', + model: 'gpt-image-2.5', targetLayerId: 'layer-source', }), ); @@ -3803,7 +3803,7 @@ describe('useImageCanvasGenerationSubmissionWorkflow', () => { size: '720x1280', kind: 'publication-material', assetKind: 'publication-material', - model: 'gpt-image-2', + model: 'gpt-image-2.5', aspectRatio: '9:16', imageSize: '1K', referenceImageSrcs: [ @@ -4102,7 +4102,7 @@ describe('useImageCanvasGenerationSubmissionWorkflow', () => { expect.objectContaining({ referenceId: 'resource-icon-spec', iconDescriptions: ['返回按钮\n设置按钮'], - model: 'gpt-image-2', + model: 'gpt-image-2.5', assetLabel: '复古操作图标', canvasCompletion: expect.objectContaining({ title: '复古操作图标', @@ -4125,7 +4125,7 @@ describe('useImageCanvasGenerationSubmissionWorkflow', () => { 'icon:idle:open:layer-icon-spritesheet-1:placeholder:-', ); expect(screen.getByTestId('remembered-model').textContent).toBe( - 'gpt-image-2', + 'gpt-image-2.5', ); expect(screen.getByTestId('generation-warning').textContent).toBe( '图集已生成,但自动拆分未完成:连通域数量不足',