diff --git a/src/components/nodes/nodeHeaderMedia.ts b/src/components/nodes/nodeHeaderMedia.ts index f01d8d3e..df4afb8e 100644 --- a/src/components/nodes/nodeHeaderMedia.ts +++ b/src/components/nodes/nodeHeaderMedia.ts @@ -95,7 +95,7 @@ export function getNodeHeaderMediaMeta( return { kind: "video", name: data.outputVideoRef || item?.id || fallbackTitle, - dimensions: data.resolution, + dimensions: undefined, }; } diff --git a/src/store/execution/generate3dExecutor.ts b/src/store/execution/generate3dExecutor.ts index 44925529..a6fa9dcb 100644 --- a/src/store/execution/generate3dExecutor.ts +++ b/src/store/execution/generate3dExecutor.ts @@ -108,12 +108,9 @@ export async function executeGenerate3D( const generationConfig: GenerationNodeConfig = { prompt: promptText || "", - aspectRatio: "16:9", - resolution: "", selectedModel: modelToUse, inputImages: images, imageCount: 1, - durationSeconds: 0, referenceSubjectList: nodeData.referenceSubjectList ?? [], parameters: parametersOverride ?? nodeData.parameters ?? {}, extraTaskParams: nodeData.extraTaskParams ?? {}, diff --git a/src/utils/__tests__/composerPricing.test.ts b/src/utils/__tests__/composerPricing.test.ts index 0def5419..58a5cf23 100644 --- a/src/utils/__tests__/composerPricing.test.ts +++ b/src/utils/__tests__/composerPricing.test.ts @@ -21,14 +21,12 @@ function model(overrides: Partial = {}): SelectedModel { function draft(overrides: Partial = {}): GenerationNodeConfig { return { prompt: "prompt", - aspectRatio: "16:9", - resolution: "1080p", selectedModel: model(), inputImages: [], imageCount: 1, - durationSeconds: 6, - soundEnabled: true, + referenceSubjectList: [], parameters: {}, + extraTaskParams: {}, ...overrides, }; } @@ -39,20 +37,17 @@ describe("composerPricing", () => { selectedModel: model({ modelId: "123", displayName: "Token billed video", - metadata: { - billingMethod: 2, - aiModelCode: "video-code", - aiModelCodeAlias: "video-alias", - }, + billingMethod: 2, + aiModelCode: "video-code", + aiModelCodeAlias: "video-alias", }), - resolution: "", - durationSeconds: 8, + parameters: { duration: 8 }, }), "video", 12); expect(payload).toEqual({ model_name: "video-alias", estimation_type: "auto", - parameters: {}, + parameters: { duration: 8 }, imageCount: 1, input_video_duration_seconds: 12, }); @@ -67,22 +62,22 @@ describe("composerPricing", () => { it("uses PopiServer estimate only for billingMethod 2 or Seedance models", () => { expect(buildPopiserverPointsEstimatePayload(draft({ - selectedModel: model({ metadata: { billingMethod: 2 } }), + selectedModel: model({ billingMethod: 2 }), }), "image", 0)).not.toBeNull(); expect(buildPopiserverPointsEstimatePayload(draft({ - selectedModel: model({ metadata: { billingMethod: 1 } }), + selectedModel: model({ billingMethod: 1 }), }), "image", 0)).toBeNull(); expect(buildPopiserverPointsEstimatePayload(draft({ selectedModel: model({ displayName: "Seedance Pro", - metadata: { billingMethod: 1 }, + billingMethod: 1, }), }), "video", 0)).not.toBeNull(); }); it("builds unified PopiServer quote requests", () => { const pointsPayload = buildPopiserverPointsEstimatePayload(draft({ - selectedModel: model({ metadata: { billingMethod: 2 } }), + selectedModel: model({ billingMethod: 2 }), }), "image", 0); const taskPricePayload = { aiModelId: 32 }; diff --git a/src/utils/__tests__/generationConfig.test.ts b/src/utils/__tests__/generationConfig.test.ts index 23032050..1ae97f7e 100644 --- a/src/utils/__tests__/generationConfig.test.ts +++ b/src/utils/__tests__/generationConfig.test.ts @@ -18,18 +18,24 @@ describe("generationConfig", () => { it("reads video generation config from node fields", () => { const data = { inputPrompt: "legacy prompt", + inputImages: [], + outputVideo: null, selectedModel: { ...defaultModel, - metadata: { aiModelId: 42 }, + aiModelId: 42, }, parameters: { resolution: "720p" }, + status: "idle", + error: null, + videoHistory: [], + selectedVideoHistoryIndex: 0, } as GenerateVideoNodeData; const config = readVideoGenerationConfig(data, defaultModel); expect(config.prompt).toBe("legacy prompt"); expect(config.parameters).toEqual({ resolution: "720p" }); - expect(config.selectedModel.metadata).toEqual({ aiModelId: 42 }); + expect(config.selectedModel.aiModelId).toBe(42); }); it("creates video node data with clean stored parameters", () => { @@ -85,21 +91,21 @@ describe("generationConfig", () => { modelId: "37", displayName: "Popi Video", capabilities: ["text-to-video"], - metadata: { - billingMethod: 1, - aiModelId: 37, - type: 2, - subType: 203, - aiModelCode: "seedance", - }, + billingMethod: 1, + aiModelId: 37, + type: 2, + subType: 203, + aiModelCode: "seedance", }, inputImages: [], imageCount: 4, + referenceSubjectList: [], parameters: { resolution: "720p", duration: 4, videoRatio: 20, }, + extraTaskParams: {}, }, "video" )