Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.
TypeScript ai-artartificial-intelligencegenerative-artimage-generationimg2imginpaintinglatent-diffusionlinuxmacosoutpaintingstable-diffusiontxt2imgwindows
feat(webv2): the Video widget — panel shell and workbench integration
Lincoln Stein70962c48a02b
diff --git a/invokeai/frontend/webv2/performance/browser-baseline.json b/invokeai/frontend/webv2/performance/browser-baseline.jsonindex 73d371ff29..37f9afb22e 100644--- a/invokeai/frontend/webv2/performance/browser-baseline.json+++ b/invokeai/frontend/webv2/performance/browser-baseline.json@@ -1,6 +1,6 @@{- "browserExecutable": "/home/toast/.cache/ms-playwright/chromium-1234/chrome-linux64/chrome",- "capturedAt": "2026-08-20",+ "browserExecutable": "/home/lstein/.cache/ms-playwright/chromium-1234/chrome-linux64/chrome",+ "capturedAt": "2026-08-21","routes": [{"activatedResourceBaseline": {@@ -25,13 +25,13 @@"scriptRequestCount": 0,"totalRawBytes": 0},- "domContentLoadedMedianMs": 109.60000000149012,+ "domContentLoadedMedianMs": 147,"id": "launchpad","layoutAckMedianMs": 0,"layoutReturnSwitchMedianMs": 0,"layoutSwitchMedianMs": 0,- "loadMedianMs": 109.80000000074506,- "longestTaskMaxMs": 66,+ "loadMedianMs": 147,+ "longestTaskMaxMs": 74,"owner": "app","projectSwitchMedianMs": 0,"readyMark": "invokeai:ready:launchpad",@@ -41,24 +41,24 @@"fontRawBytes": 23664,"imageRawBytes": 0,"largestAssetRawBytes": 746569,- "otherRawBytes": 141447,+ "otherRawBytes": 143008,"requestCount": 37,- "scriptRawBytes": 1620215,+ "scriptRawBytes": 1620456,"scriptRequestCount": 33,- "totalRawBytes": 1787485+ "totalRawBytes": 1789287},"resourceLimits": {"cssRawBytes": 2181,"fontRawBytes": 23901,"imageRawBytes": 0,"largestAssetRawBytes": 754035,- "otherRawBytes": 142862,+ "otherRawBytes": 144439,"requestCount": 37,- "scriptRawBytes": 1636418,+ "scriptRawBytes": 1636661,"scriptRequestCount": 33,- "totalRawBytes": 1805360+ "totalRawBytes": 1807180},- "routeReadyMedianMs": 247.90000000223517,+ "routeReadyMedianMs": 310.3999996185303,"scriptSourceOwnerSet": "launchpad-static","stateProfile": "empty"},@@ -85,13 +85,13 @@"scriptRequestCount": 0,"totalRawBytes": 0},- "domContentLoadedMedianMs": 106.60000000149012,+ "domContentLoadedMedianMs": 152.40000009536743,"id": "launchpad","layoutAckMedianMs": 0,"layoutReturnSwitchMedianMs": 0,"layoutSwitchMedianMs": 0,- "loadMedianMs": 106.80000000074506,- "longestTaskMaxMs": 65,+ "loadMedianMs": 152.5,+ "longestTaskMaxMs": 72,"owner": "app","projectSwitchMedianMs": 0,"readyMark": "invokeai:ready:launchpad",@@ -101,24 +101,24 @@"fontRawBytes": 23664,"imageRawBytes": 0,"largestAssetRawBytes": 746569,- "otherRawBytes": 141447,+ "otherRawBytes": 143008,"requestCount": 37,- "scriptRawBytes": 1620215,+ "scriptRawBytes": 1620456,"scriptRequestCount": 33,- "totalRawBytes": 1787485+ "totalRawBytes": 1789287},"resourceLimits": {"cssRawBytes": 2181,"fontRawBytes": 23901,"imageRawBytes": 0,"largestAssetRawBytes": 754035,- "otherRawBytes": 142862,+ "otherRawBytes": 144439,"requestCount": 37,- "scriptRawBytes": 1636418,+ "scriptRawBytes": 1636661,"scriptRequestCount": 33,- "totalRawBytes": 1805360+ "totalRawBytes": 1807180},- "routeReadyMedianMs": 263.80000000074506,+ "routeReadyMedianMs": 337.30000019073486,"scriptSourceOwnerSet": "launchpad-static","stateProfile": "representative"},@@ -145,15 +145,15 @@"scriptRequestCount": 0,"totalRawBytes": 0},- "domContentLoadedMedianMs": 116.69999999925494,+ "domContentLoadedMedianMs": 136,"id": "editor-minimal","layoutAckMedianMs": 0,"layoutReturnSwitchMedianMs": 0,"layoutSwitchMedianMs": 0,- "loadMedianMs": 116.80000000074506,- "longestTaskMaxMs": 87,+ "loadMedianMs": 136.09999990463257,+ "longestTaskMaxMs": 101,"owner": "workbench",- "projectSwitchMedianMs": 33.5,+ "projectSwitchMedianMs": 42.80000019073486,"readyMark": "invokeai:ready:widget:center:preview","remediationTicket": "deepen-widget-registry-loading","resourceBaseline": {@@ -161,24 +161,24 @@"fontRawBytes": 23664,"imageRawBytes": 156376,"largestAssetRawBytes": 746569,- "otherRawBytes": 141447,- "requestCount": 112,- "scriptRawBytes": 3086165,- "scriptRequestCount": 107,- "totalRawBytes": 3409811+ "otherRawBytes": 143008,+ "requestCount": 114,+ "scriptRawBytes": 3117993,+ "scriptRequestCount": 109,+ "totalRawBytes": 3443200},"resourceLimits": {"cssRawBytes": 2181,"fontRawBytes": 23901,"imageRawBytes": 157940,"largestAssetRawBytes": 754035,- "otherRawBytes": 142862,- "requestCount": 112,- "scriptRawBytes": 3117027,- "scriptRequestCount": 107,- "totalRawBytes": 3443910+ "otherRawBytes": 144439,+ "requestCount": 114,+ "scriptRawBytes": 3149173,+ "scriptRequestCount": 109,+ "totalRawBytes": 3477632},- "routeReadyMedianMs": 648.7999999970198,+ "routeReadyMedianMs": 697.5999999046326,"scriptSourceOwnerSet": "editor-minimal-static","stateProfile": "empty"},@@ -205,15 +205,15 @@"scriptRequestCount": 0,"totalRawBytes": 0},- "domContentLoadedMedianMs": 108.80000000074506,+ "domContentLoadedMedianMs": 146.5,"id": "editor-minimal","layoutAckMedianMs": 0,"layoutReturnSwitchMedianMs": 0,"layoutSwitchMedianMs": 0,- "loadMedianMs": 108.80000000074506,- "longestTaskMaxMs": 171,+ "loadMedianMs": 146.59999990463257,+ "longestTaskMaxMs": 182,"owner": "workbench",- "projectSwitchMedianMs": 49.70000000298023,+ "projectSwitchMedianMs": 57.80000019073486,"readyMark": "invokeai:ready:widget:center:preview","remediationTicket": "deepen-widget-registry-loading","resourceBaseline": {@@ -221,24 +221,24 @@"fontRawBytes": 23664,"imageRawBytes": 156376,"largestAssetRawBytes": 746569,- "otherRawBytes": 141447,- "requestCount": 112,- "scriptRawBytes": 3086165,- "scriptRequestCount": 107,- "totalRawBytes": 3409811+ "otherRawBytes": 143008,+ "requestCount": 114,+ "scriptRawBytes": 3117993,+ "scriptRequestCount": 109,+ "totalRawBytes": 3443200},"resourceLimits": {"cssRawBytes": 2181,"fontRawBytes": 23901,"imageRawBytes": 157940,"largestAssetRawBytes": 754035,- "otherRawBytes": 142862,- "requestCount": 112,- "scriptRawBytes": 3117027,- "scriptRequestCount": 107,- "totalRawBytes": 3443910+ "otherRawBytes": 144439,+ "requestCount": 114,+ "scriptRawBytes": 3149173,+ "scriptRequestCount": 109,+ "totalRawBytes": 3477632},- "routeReadyMedianMs": 422.19999999925494,+ "routeReadyMedianMs": 529.5,"scriptSourceOwnerSet": "editor-minimal-static","stateProfile": "representative"},@@ -247,31 +247,31 @@"cssRawBytes": 0,"fontRawBytes": 0,"imageRawBytes": 0,- "largestAssetRawBytes": 135403,+ "largestAssetRawBytes": 136446,"otherRawBytes": 0,"requestCount": 6,- "scriptRawBytes": 287837,+ "scriptRawBytes": 288880,"scriptRequestCount": 6,- "totalRawBytes": 287837+ "totalRawBytes": 288880},"activatedResourceLimits": {"cssRawBytes": 0,"fontRawBytes": 0,"imageRawBytes": 0,- "largestAssetRawBytes": 136758,+ "largestAssetRawBytes": 137811,"otherRawBytes": 0,"requestCount": 6,- "scriptRawBytes": 290716,+ "scriptRawBytes": 291769,"scriptRequestCount": 6,- "totalRawBytes": 290716+ "totalRawBytes": 291769},- "domContentLoadedMedianMs": 110.39999999850988,+ "domContentLoadedMedianMs": 144.09999990463257,"id": "editor-canvas",- "layoutAckMedianMs": 2.100000001490116,- "layoutReturnSwitchMedianMs": 36.899999998509884,- "layoutSwitchMedianMs": 65.40000000223517,- "loadMedianMs": 110.5,- "longestTaskMaxMs": 90,+ "layoutAckMedianMs": 8.799999713897705,+ "layoutReturnSwitchMedianMs": 34.09999990463257,+ "layoutSwitchMedianMs": 75.09999990463257,+ "loadMedianMs": 144.19999980926514,+ "longestTaskMaxMs": 103,"owner": "canvas","projectSwitchMedianMs": 0,"readyMark": "invokeai:ready:widget:center:canvas",@@ -281,24 +281,24 @@"fontRawBytes": 23664,"imageRawBytes": 156376,"largestAssetRawBytes": 746569,- "otherRawBytes": 141447,- "requestCount": 118,- "scriptRawBytes": 3374002,- "scriptRequestCount": 113,- "totalRawBytes": 3697648+ "otherRawBytes": 143008,+ "requestCount": 120,+ "scriptRawBytes": 3406873,+ "scriptRequestCount": 115,+ "totalRawBytes": 3732080},"resourceLimits": {"cssRawBytes": 2181,"fontRawBytes": 23901,"imageRawBytes": 157940,"largestAssetRawBytes": 754035,- "otherRawBytes": 142862,- "requestCount": 118,- "scriptRawBytes": 3407743,- "scriptRequestCount": 113,- "totalRawBytes": 3734625+ "otherRawBytes": 144439,+ "requestCount": 120,+ "scriptRawBytes": 3440942,+ "scriptRequestCount": 115,+ "totalRawBytes": 3769401},- "routeReadyMedianMs": 989.5,+ "routeReadyMedianMs": 1155.3000001907349,"scriptSourceOwnerSet": "editor-canvas-static","stateProfile": "empty"},@@ -307,31 +307,31 @@"cssRawBytes": 0,"fontRawBytes": 0,"imageRawBytes": 0,- "largestAssetRawBytes": 135403,+ "largestAssetRawBytes": 136446,"otherRawBytes": 0,"requestCount": 6,- "scriptRawBytes": 287837,+ "scriptRawBytes": 288880,"scriptRequestCount": 6,- "totalRawBytes": 287837+ "totalRawBytes": 288880},"activatedResourceLimits": {"cssRawBytes": 0,"fontRawBytes": 0,"imageRawBytes": 0,- "largestAssetRawBytes": 136758,+ "largestAssetRawBytes": 137811,"otherRawBytes": 0,"requestCount": 6,- "scriptRawBytes": 290716,+ "scriptRawBytes": 291769,"scriptRequestCount": 6,- "totalRawBytes": 290716+ "totalRawBytes": 291769},- "domContentLoadedMedianMs": 110,+ "domContentLoadedMedianMs": 131.40000009536743,"id": "editor-canvas",- "layoutAckMedianMs": 2.2999999970197678,- "layoutReturnSwitchMedianMs": 36.399999998509884,- "layoutSwitchMedianMs": 177.59999999776483,- "loadMedianMs": 110.09999999776483,- "longestTaskMaxMs": 341,+ "layoutAckMedianMs": 4.099999904632568,+ "layoutReturnSwitchMedianMs": 32.90000009536743,+ "layoutSwitchMedianMs": 192.5,+ "loadMedianMs": 131.59999990463257,+ "longestTaskMaxMs": 379,"owner": "canvas","projectSwitchMedianMs": 0,"readyMark": "invokeai:ready:widget:center:canvas",@@ -341,24 +341,24 @@"fontRawBytes": 23664,"imageRawBytes": 156376,"largestAssetRawBytes": 746569,- "otherRawBytes": 141447,- "requestCount": 118,- "scriptRawBytes": 3374002,- "scriptRequestCount": 113,- "totalRawBytes": 3697648+ "otherRawBytes": 143008,+ "requestCount": 120,+ "scriptRawBytes": 3406873,+ "scriptRequestCount": 115,+ "totalRawBytes": 3732080},"resourceLimits": {"cssRawBytes": 2181,"fontRawBytes": 23901,"imageRawBytes": 157940,"largestAssetRawBytes": 754035,- "otherRawBytes": 142862,- "requestCount": 118,- "scriptRawBytes": 3407743,- "scriptRequestCount": 113,- "totalRawBytes": 3734625+ "otherRawBytes": 144439,+ "requestCount": 120,+ "scriptRawBytes": 3440942,+ "scriptRequestCount": 115,+ "totalRawBytes": 3769401},- "routeReadyMedianMs": 1210.300000000745,+ "routeReadyMedianMs": 1307,"scriptSourceOwnerSet": "editor-canvas-static","stateProfile": "representative"},@@ -385,13 +385,13 @@"scriptRequestCount": 6,"totalRawBytes": 379966},- "domContentLoadedMedianMs": 107.69999999925494,+ "domContentLoadedMedianMs": 140.80000019073486,"id": "editor-workflow",- "layoutAckMedianMs": 2.300000000745058,- "layoutReturnSwitchMedianMs": 31.800000000745058,- "layoutSwitchMedianMs": 88.39999999850988,- "loadMedianMs": 107.80000000074506,- "longestTaskMaxMs": 88,+ "layoutAckMedianMs": 9.599999904632568,+ "layoutReturnSwitchMedianMs": 30.40000009536743,+ "layoutSwitchMedianMs": 92.59999990463257,+ "loadMedianMs": 141,+ "longestTaskMaxMs": 99,"owner": "workflow","projectSwitchMedianMs": 0,"readyMark": "invokeai:ready:widget:center:workflow",@@ -401,24 +401,24 @@"fontRawBytes": 23664,"imageRawBytes": 156376,"largestAssetRawBytes": 746569,- "otherRawBytes": 141447,- "requestCount": 119,- "scriptRawBytes": 3446955,- "scriptRequestCount": 113,- "totalRawBytes": 3786014+ "otherRawBytes": 143008,+ "requestCount": 121,+ "scriptRawBytes": 3478783,+ "scriptRequestCount": 115,+ "totalRawBytes": 3819403},"resourceLimits": {"cssRawBytes": 17748,"fontRawBytes": 23901,"imageRawBytes": 157940,"largestAssetRawBytes": 754035,- "otherRawBytes": 142862,- "requestCount": 119,- "scriptRawBytes": 3481425,- "scriptRequestCount": 113,- "totalRawBytes": 3823875+ "otherRawBytes": 144439,+ "requestCount": 121,+ "scriptRawBytes": 3513571,+ "scriptRequestCount": 115,+ "totalRawBytes": 3857598},- "routeReadyMedianMs": 1011.3999999985099,+ "routeReadyMedianMs": 1151.5,"scriptSourceOwnerSet": "editor-workflow-static","stateProfile": "empty"},@@ -445,13 +445,13 @@"scriptRequestCount": 6,"totalRawBytes": 379966},- "domContentLoadedMedianMs": 109,+ "domContentLoadedMedianMs": 149.09999990463257,"id": "editor-workflow",- "layoutAckMedianMs": 2.400000002235174,- "layoutReturnSwitchMedianMs": 40.100000001490116,- "layoutSwitchMedianMs": 126.80000000074506,- "loadMedianMs": 109.10000000149012,- "longestTaskMaxMs": 334,+ "layoutAckMedianMs": 3,+ "layoutReturnSwitchMedianMs": 38.40000009536743,+ "layoutSwitchMedianMs": 132.7000002861023,+ "loadMedianMs": 149.19999980926514,+ "longestTaskMaxMs": 372,"owner": "workflow","projectSwitchMedianMs": 0,"readyMark": "invokeai:ready:widget:center:workflow",@@ -461,24 +461,24 @@"fontRawBytes": 23664,"imageRawBytes": 156376,"largestAssetRawBytes": 746569,- "otherRawBytes": 141447,- "requestCount": 119,- "scriptRawBytes": 3446955,- "scriptRequestCount": 113,- "totalRawBytes": 3786014+ "otherRawBytes": 143008,+ "requestCount": 121,+ "scriptRawBytes": 3478783,+ "scriptRequestCount": 115,+ "totalRawBytes": 3819403},"resourceLimits": {"cssRawBytes": 17748,"fontRawBytes": 23901,"imageRawBytes": 157940,"largestAssetRawBytes": 754035,- "otherRawBytes": 142862,- "requestCount": 119,- "scriptRawBytes": 3481425,- "scriptRequestCount": 113,- "totalRawBytes": 3823875+ "otherRawBytes": 144439,+ "requestCount": 121,+ "scriptRawBytes": 3513571,+ "scriptRequestCount": 115,+ "totalRawBytes": 3857598},- "routeReadyMedianMs": 1130.5,+ "routeReadyMedianMs": 1289.0999999046326,"scriptSourceOwnerSet": "editor-workflow-static","stateProfile": "representative"},@@ -505,13 +505,13 @@"scriptRequestCount": 0,"totalRawBytes": 0},- "domContentLoadedMedianMs": 111.89999999850988,+ "domContentLoadedMedianMs": 141.80000019073486,"id": "editor-gallery","layoutAckMedianMs": 0,"layoutReturnSwitchMedianMs": 0,- "layoutSwitchMedianMs": 24.299999997019768,- "loadMedianMs": 112,- "longestTaskMaxMs": 88,+ "layoutSwitchMedianMs": 31.40000009536743,+ "loadMedianMs": 141.90000009536743,+ "longestTaskMaxMs": 109,"owner": "gallery","projectSwitchMedianMs": 0,"readyMark": "invokeai:ready:widget:center:gallery",@@ -521,24 +521,24 @@"fontRawBytes": 23664,"imageRawBytes": 156376,"largestAssetRawBytes": 746569,- "otherRawBytes": 141447,- "requestCount": 112,- "scriptRawBytes": 3086165,- "scriptRequestCount": 107,- "totalRawBytes": 3409811+ "otherRawBytes": 143008,+ "requestCount": 114,+ "scriptRawBytes": 3117993,+ "scriptRequestCount": 109,+ "totalRawBytes": 3443200},"resourceLimits": {"cssRawBytes": 2181,"fontRawBytes": 23901,"imageRawBytes": 157940,"largestAssetRawBytes": 754035,- "otherRawBytes": 142862,- "requestCount": 112,- "scriptRawBytes": 3117027,- "scriptRequestCount": 107,- "totalRawBytes": 3443910+ "otherRawBytes": 144439,+ "requestCount": 114,+ "scriptRawBytes": 3149173,+ "scriptRequestCount": 109,+ "totalRawBytes": 3477632},- "routeReadyMedianMs": 1217.5,+ "routeReadyMedianMs": 1390.9000000953674,"scriptSourceOwnerSet": "editor-minimal-static","stateProfile": "empty"},@@ -565,13 +565,13 @@"scriptRequestCount": 0,"totalRawBytes": 0},- "domContentLoadedMedianMs": 109.69999999925494,+ "domContentLoadedMedianMs": 136.5,"id": "editor-gallery","layoutAckMedianMs": 0,"layoutReturnSwitchMedianMs": 0,- "layoutSwitchMedianMs": 86.89999999850988,- "loadMedianMs": 109.89999999850988,- "longestTaskMaxMs": 177,+ "layoutSwitchMedianMs": 100.59999990463257,+ "loadMedianMs": 136.59999990463257,+ "longestTaskMaxMs": 188,"owner": "gallery","projectSwitchMedianMs": 0,"readyMark": "invokeai:ready:widget:center:gallery",@@ -581,24 +581,24 @@"fontRawBytes": 23664,"imageRawBytes": 156376,"largestAssetRawBytes": 746569,- "otherRawBytes": 141447,- "requestCount": 112,- "scriptRawBytes": 3086165,- "scriptRequestCount": 107,- "totalRawBytes": 3409811+ "otherRawBytes": 143008,+ "requestCount": 114,+ "scriptRawBytes": 3117993,+ "scriptRequestCount": 109,+ "totalRawBytes": 3443200},"resourceLimits": {"cssRawBytes": 2181,"fontRawBytes": 23901,"imageRawBytes": 157940,"largestAssetRawBytes": 754035,- "otherRawBytes": 142862,- "requestCount": 112,- "scriptRawBytes": 3117027,- "scriptRequestCount": 107,- "totalRawBytes": 3443910+ "otherRawBytes": 144439,+ "requestCount": 114,+ "scriptRawBytes": 3149173,+ "scriptRequestCount": 109,+ "totalRawBytes": 3477632},- "routeReadyMedianMs": 1412.699999999255,+ "routeReadyMedianMs": 1589.0999999046326,"scriptSourceOwnerSet": "editor-minimal-static","stateProfile": "representative"}@@ -1041,6 +1041,7 @@"source:src/app/SocketHubRuntime.tsx","source:src/app/ThemeController.tsx","source:src/app/UpscaleUiAdapter.tsx",+ "source:src/app/VideoUiAdapter.tsx","source:src/app/WorkbenchApp.tsx","source:src/app/WorkflowUiAdapter.tsx","source:src/app/accountLifecycle.ts",@@ -1316,6 +1317,13 @@"source:src/features/upscale/core/settings.ts","source:src/features/upscale/index.ts","source:src/features/upscale/ui/UpscaleUiContext.tsx",+ "source:src/features/video/core/dimensions.ts",+ "source:src/features/video/core/graph.ts",+ "source:src/features/video/core/settings.ts",+ "source:src/features/video/core/videoPolicies.ts",+ "source:src/features/video/core/widgetValues.ts",+ "source:src/features/video/index.ts",+ "source:src/features/video/ui/VideoUiContext.tsx","source:src/features/workflow/core/buildGraph.ts","source:src/features/workflow/core/connectors.ts","source:src/features/workflow/core/document.ts",@@ -1819,6 +1827,7 @@"source:src/workbench/widgets/server-status/manifest.ts","source:src/workbench/widgets/upscale/manifest.ts","source:src/workbench/widgets/version-status/manifest.ts",+ "source:src/workbench/widgets/video/manifest.ts","source:src/workbench/widgets/workflow/manifest.ts","source:src/workbench/workbenchState.ts","source:src/workbench/workbenchStore.ts"@@ -1949,6 +1958,7 @@"source:src/app/SocketHubRuntime.tsx","source:src/app/ThemeController.tsx","source:src/app/UpscaleUiAdapter.tsx",+ "source:src/app/VideoUiAdapter.tsx","source:src/app/WorkbenchApp.tsx","source:src/app/WorkflowUiAdapter.tsx","source:src/app/accountLifecycle.ts",@@ -2225,6 +2235,13 @@"source:src/features/upscale/core/settings.ts","source:src/features/upscale/index.ts","source:src/features/upscale/ui/UpscaleUiContext.tsx",+ "source:src/features/video/core/dimensions.ts",+ "source:src/features/video/core/graph.ts",+ "source:src/features/video/core/settings.ts",+ "source:src/features/video/core/videoPolicies.ts",+ "source:src/features/video/core/widgetValues.ts",+ "source:src/features/video/index.ts",+ "source:src/features/video/ui/VideoUiContext.tsx","source:src/features/workflow/core/buildGraph.ts","source:src/features/workflow/core/connectors.ts","source:src/features/workflow/core/document.ts",@@ -2828,6 +2845,7 @@"source:src/workbench/widgets/server-status/manifest.ts","source:src/workbench/widgets/upscale/manifest.ts","source:src/workbench/widgets/version-status/manifest.ts",+ "source:src/workbench/widgets/video/manifest.ts","source:src/workbench/widgets/workflow/manifest.ts","source:src/workbench/workbenchState.ts","source:src/workbench/workbenchStore.ts"@@ -2969,6 +2987,7 @@"source:src/app/SocketHubRuntime.tsx","source:src/app/ThemeController.tsx","source:src/app/UpscaleUiAdapter.tsx",+ "source:src/app/VideoUiAdapter.tsx","source:src/app/WorkbenchApp.tsx","source:src/app/WorkflowUiAdapter.tsx","source:src/app/accountLifecycle.ts",@@ -3264,6 +3283,13 @@"source:src/features/upscale/core/settings.ts","source:src/features/upscale/index.ts","source:src/features/upscale/ui/UpscaleUiContext.tsx",+ "source:src/features/video/core/dimensions.ts",+ "source:src/features/video/core/graph.ts",+ "source:src/features/video/core/settings.ts",+ "source:src/features/video/core/videoPolicies.ts",+ "source:src/features/video/core/widgetValues.ts",+ "source:src/features/video/index.ts",+ "source:src/features/video/ui/VideoUiContext.tsx","source:src/features/workflow/core/buildGraph.ts","source:src/features/workflow/core/connectors.ts","source:src/features/workflow/core/document.ts",@@ -3811,6 +3837,7 @@"source:src/workbench/widgets/server-status/manifest.ts","source:src/workbench/widgets/upscale/manifest.ts","source:src/workbench/widgets/version-status/manifest.ts",+ "source:src/workbench/widgets/video/manifest.ts","source:src/workbench/widgets/workflow/manifest.ts","source:src/workbench/workbenchState.ts","source:src/workbench/workbenchStore.ts"diff --git a/invokeai/frontend/webv2/public/locales/en.json b/invokeai/frontend/webv2/public/locales/en.jsonindex ba230b3f89..05fc6a288e 100644--- a/invokeai/frontend/webv2/public/locales/en.json+++ b/invokeai/frontend/webv2/public/locales/en.json@@ -1473,7 +1473,8 @@"serverStatus": "Server Status","upscale": "Upscale","versionStatus": "Version",- "workflow": "Workflow"+ "workflow": "Workflow",+ "video": "Video"},"generate": {"activeCount_one": "{{count}} active",@@ -2974,6 +2975,36 @@"chipLabel": "Version 7.0","description": "Invoke V7 shell version 7.0.","label": "Version"+ },+ "video": {+ "accelerator": "{{label}} (fast)",+ "acceleratorHelp": "Runs the {{label}} distillation LoRA at {{steps}} steps. Slower but sometimes higher-quality results with it off.",+ "acceleratorMissing": "Accelerator LoRA not installed",+ "acceleratorMissingDescription": "Install the {{label}} LoRA from Model Manager to enable the fast path.",+ "aspectRatio": "Aspect Ratio",+ "cfg": "CFG",+ "cfgLowNoise": "CFG (Low Noise)",+ "cfgLowNoiseHelp": "Guidance for the low-noise half of the A14B expert schedule.",+ "derivedSize": "Output size: {{width}} × {{height}}",+ "derivedSizeUnavailable": "Output size unavailable for the current settings.",+ "dimensions": "Dimensions",+ "fixedFps": "This model generates at a fixed {{fps}} FPS.",+ "fps": "FPS",+ "frames": "Frames",+ "framesDuration": "{{seconds}} s at the current frame rate",+ "mainModel": "Model",+ "model": "Model",+ "modelRequired": "Select a Wan 2.2 or MiniMax H3 model.",+ "randomizeSeed": "Random",+ "seed": "Seed",+ "selectModel": "Select a video model…",+ "settingsAdjusted": "Settings adjusted",+ "settingsAdjustedDescription": "Adjusted for the selected model: {{labels}}.",+ "sharedPromptDescription": "The prompt is shared with the Generate panel.",+ "shuffleSeed": "New random seed",+ "steps": "Steps",+ "swapAspectRatio": "Swap orientation",+ "targetResolution": "Target Resolution"}},"workflowLibrary": {diff --git a/invokeai/frontend/webv2/src/app/VideoUiAdapter.tsx b/invokeai/frontend/webv2/src/app/VideoUiAdapter.tsxnew file mode 100644index 0000000000..05702499a1--- /dev/null+++ b/invokeai/frontend/webv2/src/app/VideoUiAdapter.tsx@@ -0,0 +1,66 @@+import type { VideoUiAdapter } from '@features/video';+import type { ReactNode } from 'react';++import { areProjectPromptDraftsEqual, getPromptDraftFromValues } from '@features/generation/settings';+import { VideoUiProvider } from '@features/video';+import { useWorkbenchPreferenceSelector } from '@workbench/settings/store';+import { getProjectWidgetValues } from '@workbench/widgetState';+import { useActiveProjectSelector, useWorkbenchCommands } from '@workbench/WorkbenchContext';+import { useCallback, useMemo } from 'react';++/**+ * Production binding of Video's UI port: maps the video widget instance and+ * the shared prompt draft out of the Workbench aggregate. No second adapter is+ * expected.+ */+export const VideoUiAdapterProvider = ({ children }: { children: ReactNode }) => {+ const project = useActiveProjectSelector(+ (activeProject) => {+ const instance = Object.values(activeProject.widgetInstances).find((candidate) => candidate.typeId === 'video');++ return {+ projectId: activeProject.id,+ promptDraft: getPromptDraftFromValues(getProjectWidgetValues(activeProject, 'generate')),+ rawValues: instance?.state.values ?? {},+ };+ },+ (left, right) =>+ left.projectId === right.projectId &&+ areProjectPromptDraftsEqual(left.promptDraft, right.promptDraft) &&+ left.rawValues === right.rawValues+ );+ // Syntax highlighting is a per-user preference, not a property of the+ // project, so it is joined here rather than read off the document.+ const showPromptSyntaxHighlighting = useWorkbenchPreferenceSelector(+ (preferences) => preferences.showPromptSyntaxHighlighting+ );+ const commands = useWorkbenchCommands();+ // The port's callbacks are keyed to the project, not to its contents: rebuilding+ // them whenever `rawValues` changes would hand every consumer new function+ // identities on each keystroke, re-rendering memoized fields that did not change.+ const { projectId } = project;+ const patchPromptDraft = useCallback<VideoUiAdapter['patchPromptDraft']>(+ (values) => commands.generation.patchPromptDraft(values, 'video', projectId),+ [commands, projectId]+ );+ const patchValues = useCallback<VideoUiAdapter['patchValues']>(+ (values, origin) => commands.widgets.patchValues('video', values, projectId, origin),+ [commands, projectId]+ );+ const reportError = useCallback<VideoUiAdapter['reportError']>(+ (message) => commands.notifications.reportError({ area: 'video', message, namespace: 'generation' }),+ [commands]+ );+ const adapter = useMemo<VideoUiAdapter>(+ () => ({+ ...project,+ patchPromptDraft,+ patchValues,+ reportError,+ showPromptSyntaxHighlighting,+ }),+ [patchPromptDraft, patchValues, project, reportError, showPromptSyntaxHighlighting]+ );++ return <VideoUiProvider adapter={adapter}>{children}</VideoUiProvider>;+};diff --git a/invokeai/frontend/webv2/src/app/workbenchPorts.test.tsx b/invokeai/frontend/webv2/src/app/workbenchPorts.test.tsxindex 269e06d899..0400fa3241 100644--- a/invokeai/frontend/webv2/src/app/workbenchPorts.test.tsx+++ b/invokeai/frontend/webv2/src/app/workbenchPorts.test.tsx@@ -5,6 +5,7 @@ import { GenerationUiAdapterProvider } from './GenerationUiAdapter';import { ModelsUiAdapterProvider } from './ModelsUiAdapter';import { QueueUiAdapterProvider } from './QueueUiAdapter';import { UpscaleUiAdapterProvider } from './UpscaleUiAdapter';+import { VideoUiAdapterProvider } from './VideoUiAdapter';import { workbenchUiPortProviders } from './workbenchPorts';import { WorkflowUiAdapterProvider } from './WorkflowUiAdapter';@@ -16,6 +17,7 @@ describe('workbench UI port composition', () => {GalleryUiAdapterProvider,GenerationUiAdapterProvider,UpscaleUiAdapterProvider,+ VideoUiAdapterProvider,WorkflowUiAdapterProvider,]);});diff --git a/invokeai/frontend/webv2/src/app/workbenchPorts.tsx b/invokeai/frontend/webv2/src/app/workbenchPorts.tsxindex a881fb2f2a..41a7e7b7f9 100644--- a/invokeai/frontend/webv2/src/app/workbenchPorts.tsx+++ b/invokeai/frontend/webv2/src/app/workbenchPorts.tsx@@ -7,6 +7,7 @@ import { GenerationUiAdapterProvider } from './GenerationUiAdapter';import { ModelsUiAdapterProvider } from './ModelsUiAdapter';import { QueueUiAdapterProvider } from './QueueUiAdapter';import { UpscaleUiAdapterProvider } from './UpscaleUiAdapter';+import { VideoUiAdapterProvider } from './VideoUiAdapter';import { WorkflowUiAdapterProvider } from './WorkflowUiAdapter';export const workbenchUiPortProviders: ReadonlyArray<ProviderComponent> = [@@ -15,8 +16,9 @@ export const workbenchUiPortProviders: ReadonlyArray<ProviderComponent> = [GalleryUiAdapterProvider,GenerationUiAdapterProvider,UpscaleUiAdapterProvider,+ VideoUiAdapterProvider,WorkflowUiAdapterProvider,];-/** All six feature UI ports, composed once at module scope (identity must be render-stable). */+/** All seven feature UI ports, composed once at module scope (identity must be render-stable). */export const WorkbenchUiPorts = composeProviders(workbenchUiPortProviders);diff --git a/invokeai/frontend/webv2/src/architecture/featureInterfaces.ts b/invokeai/frontend/webv2/src/architecture/featureInterfaces.tsindex 9ec8ecea3b..fd13bdc5e1 100644--- a/invokeai/frontend/webv2/src/architecture/featureInterfaces.ts+++ b/invokeai/frontend/webv2/src/architecture/featureInterfaces.ts@@ -23,6 +23,6 @@ export const FEATURE_PUBLIC_INTERFACES: Readonly<Record<string, readonly string[nodes: [],queue: ['contracts', 'devices', 'launchpad', 'menu', 'queries', 'react', 'reveal', 'utility', 'widget'],upscale: ['widget'],- video: [],+ video: ['widget'],workflow: ['contracts', 'graph', 'paletteSearch', 'preview', 'queries', 'react', 'utility', 'widget'],};diff --git a/invokeai/frontend/webv2/src/features/queue/core/submissionRules.ts b/invokeai/frontend/webv2/src/features/queue/core/submissionRules.tsindex 84500c5833..a4b5ee82e1 100644--- a/invokeai/frontend/webv2/src/features/queue/core/submissionRules.ts+++ b/invokeai/frontend/webv2/src/features/queue/core/submissionRules.ts@@ -6,6 +6,7 @@ export const BACKEND_SUBMITTABLE_SOURCE_IDS = ['generate','workflow','upscale',+ 'video','canvas',] as const satisfies readonly QueueSourceId[];diff --git a/invokeai/frontend/webv2/src/features/queue/core/types.ts b/invokeai/frontend/webv2/src/features/queue/core/types.tsindex 687b1d6ced..63481e1655 100644--- a/invokeai/frontend/webv2/src/features/queue/core/types.ts+++ b/invokeai/frontend/webv2/src/features/queue/core/types.ts@@ -18,7 +18,7 @@ export interface QueueBackendGraph {}export type QueueResultDestination = 'canvas' | 'gallery';-export type QueueSourceId = 'canvas' | 'generate' | 'upscale' | 'workflow';+export type QueueSourceId = 'canvas' | 'generate' | 'upscale' | 'video' | 'workflow';export interface QueueSubmissionPresentation {batchCount: number;diff --git a/invokeai/frontend/webv2/src/features/video/core/settings.test.ts b/invokeai/frontend/webv2/src/features/video/core/settings.test.tsindex 319b634d82..0b99d46ff7 100644--- a/invokeai/frontend/webv2/src/features/video/core/settings.test.ts+++ b/invokeai/frontend/webv2/src/features/video/core/settings.test.ts@@ -174,9 +174,9 @@ describe('isVideoSourceClip', () => {describe('normalizeVideoWidgetValues / cloneVideoWidgetValues', () => {const model = { base: 'wan', key: 'wan-key', name: 'Wan', type: 'main' as const, variant: 't2v_a14b' };- it('requires a main model config', () => {- expect(normalizeVideoWidgetValues({ ...createSettings(), model })).not.toBeNull();- expect(normalizeVideoWidgetValues({ ...createSettings(), model: { key: 'x' } })).toBeNull();+ it('carries a valid main model and nulls an invalid one', () => {+ expect(normalizeVideoWidgetValues({ ...createSettings(), model })?.model).toEqual(model);+ expect(normalizeVideoWidgetValues({ ...createSettings(), model: { key: 'x' } })?.model).toBeNull();});it('clones deeply enough that mutating the clone leaves the original untouched', () => {@@ -185,8 +185,10 @@ describe('normalizeVideoWidgetValues / cloneVideoWidgetValues', () => {expect(clone).toEqual(values);(clone.firstFrameImage as { image_name: string }).image_name = 'mutated.png';- clone.model.key = 'mutated';+ if (clone.model) {+ clone.model.key = 'mutated';+ }expect(values.firstFrameImage?.image_name).toBe('first.png');- expect(values.model.key).toBe('wan-key');+ expect(values.model?.key).toBe('wan-key');});});diff --git a/invokeai/frontend/webv2/src/features/video/core/settings.ts b/invokeai/frontend/webv2/src/features/video/core/settings.tsindex 830302f3ec..2873e878a2 100644--- a/invokeai/frontend/webv2/src/features/video/core/settings.ts+++ b/invokeai/frontend/webv2/src/features/video/core/settings.ts@@ -234,15 +234,22 @@ export const isVideoSettings = (values: unknown): values is VideoSettings => {export const normalizeVideoWidgetValues = (values: unknown): VideoWidgetValues | null => {const settings = normalizeVideoSettings(values);- if (!settings || !isRecord(values) || !isMainModelConfig(values.model)) {+ if (!settings || !isRecord(values)) {return null;}- return { ...settings, model: values.model };+ return { ...settings, model: isMainModelConfig(values.model) ? values.model : null };};-export const isVideoWidgetValues = (values: unknown): values is VideoWidgetValues =>- isVideoSettings(values) && isMainModelConfig((values as unknown as Record<string, unknown>).model);+export const isVideoWidgetValues = (values: unknown): values is VideoWidgetValues => {+ if (!isVideoSettings(values)) {+ return false;+ }++ const model = (values as unknown as Record<string, unknown>).model;++ return model === null || isMainModelConfig(model);+};export const cloneVideoWidgetValues = (values: VideoWidgetValues): VideoWidgetValues & Record<string, unknown> => ({...values,@@ -253,7 +260,7 @@ export const cloneVideoWidgetValues = (values: VideoWidgetValues): VideoWidgetVah3TransformerModel: values.h3TransformerModel ? { ...values.h3TransformerModel } : null,lastFrameImage: values.lastFrameImage ? { ...values.lastFrameImage } : null,loras: values.loras.map((lora) => ({ ...lora, model: { ...lora.model } })),- model: { ...values.model },+ model: values.model ? { ...values.model } : null,sourceVideo: values.sourceVideo ? { ...values.sourceVideo } : null,vae: values.vae ? { ...values.vae } : null,wanLowNoiseModel: values.wanLowNoiseModel ? { ...values.wanLowNoiseModel } : null,diff --git a/invokeai/frontend/webv2/src/features/video/core/types.ts b/invokeai/frontend/webv2/src/features/video/core/types.tsindex 9d92239c5d..dc011a2b45 100644--- a/invokeai/frontend/webv2/src/features/video/core/types.ts+++ b/invokeai/frontend/webv2/src/features/video/core/types.ts@@ -95,5 +95,6 @@ export interface VideoSettings {}export interface VideoWidgetValues extends VideoSettings {- model: MainModelConfig;+ /** The selected main model; null until the user picks one (or none is installed). */+ model: MainModelConfig | null;}diff --git a/invokeai/frontend/webv2/src/features/video/core/widgetValues.test.ts b/invokeai/frontend/webv2/src/features/video/core/widgetValues.test.tsnew file mode 100644index 0000000000..df0a1358f3--- /dev/null+++ b/invokeai/frontend/webv2/src/features/video/core/widgetValues.test.ts@@ -0,0 +1,149 @@+import type { GenerationModelCatalogItem, MainModelConfig } from '@features/generation/contracts';++import { describe, expect, it } from 'vitest';++import { getAcceleratorToggleResult } from './videoPolicies';+import {+ createDefaultVideoWidgetValues,+ getVideoWidgetValidationReasons,+ resolveVideoSeed,+ syncVideoWidgetValuesWithModels,+} from './widgetValues';++const wanModel = (variant: string, format = 'diffusers', key = `wan-${variant}-${format}`): MainModelConfig => ({+ base: 'wan',+ format,+ key,+ name: `Wan 2.2 ${variant}`,+ type: 'main',+ variant,+});++const h3Model = (format = 'diffusers', key = `h3-${format}`): MainModelConfig => ({+ base: 'minimax-h3',+ format,+ key,+ name: 'MiniMax H3',+ type: 'main',+ variant: 'fl2va',+});++const lora = (name: string, base = 'wan', variant: string | null = 'a14b'): GenerationModelCatalogItem => ({+ base,+ key: `lora-${name}`,+ name,+ type: 'lora',+ variant,+});++const WAN_VAE_16 = { base: 'wan', key: 'vae16', latent_channels: 16, name: 'Wan 2.1 VAE', type: 'vae' as const };++describe('createDefaultVideoWidgetValues', () => {+ it('seeds the first supported installed model and its family defaults', () => {+ const wan = wanModel('t2v_a14b');+ const values = createDefaultVideoWidgetValues([lora('Style'), wan, h3Model()]);++ expect(values.model?.key).toBe(wan.key);+ expect(values.numFrames).toBe(81);+ expect(values.steps).toBe(40);+ });++ it('skips a checkpoint-format MiniMax H3 main (transformer override, not a main)', () => {+ const values = createDefaultVideoWidgetValues([h3Model('checkpoint')]);++ expect(values.model).toBeNull();+ });++ it('turns the accelerator on when its LoRAs are installed', () => {+ const values = createDefaultVideoWidgetValues([h3Model(), lora('MiniMax H3 Turbo LoRA', 'minimax-h3', null)]);++ expect(values).toMatchObject({ acceleratorEnabled: true, steps: 6 });+ });+});++describe('syncVideoWidgetValuesWithModels', () => {+ const model = wanModel('i2v_a14b', 'gguf_quantized');++ it('returns the same object when nothing changed', () => {+ const catalog = [model, WAN_VAE_16];+ const values = { ...createDefaultVideoWidgetValues(catalog), vae: WAN_VAE_16 };++ expect(syncVideoWidgetValuesWithModels(values, catalog)).toBe(values);+ });++ it('falls back to an installed supported main when the stored one is gone', () => {+ const replacement = wanModel('t2v_a14b');+ const values = createDefaultVideoWidgetValues([model]);+ const synced = syncVideoWidgetValuesWithModels(values, [replacement]);++ expect(synced.model?.key).toBe(replacement.key);+ expect(synced.modelKey).toBe(replacement.key);+ });++ it('drops components that no longer pass the slot filter for the resolved model', () => {+ const values = { ...createDefaultVideoWidgetValues([model]), vae: WAN_VAE_16 };+ // Catalog holds the H3 main only — the Wan VAE has no slot there.+ const synced = syncVideoWidgetValuesWithModels(values, [h3Model(), WAN_VAE_16]);++ expect(synced.model?.base).toBe('minimax-h3');+ expect(synced.vae).toBeNull();+ });++ it('snaps family constraints when it auto-picks a different-family model', () => {+ // Wan-shaped stored values (frames 81, fps 16, 720p) with no surviving+ // model, in a catalog whose only supported main is MiniMax H3: without the+ // selection transition the panel would be stuck at fps 16 with no FPS+ // control to fix it.+ const stored = { ...createDefaultVideoWidgetValues([wanModel('t2v_a14b')]), model: null };+ const synced = syncVideoWidgetValuesWithModels(stored, [h3Model()]);++ expect(synced.model?.base).toBe('minimax-h3');+ // Steps carry over (the selection transition preserves user sampling); the+ // family-bound constraints snap.+ expect(synced).toMatchObject({ fps: 24, numFrames: 90, steps: 40, targetResolution: '768 highres' });+ expect(getVideoWidgetValidationReasons(synced, [h3Model()])).toEqual([]);+ });++ it('drops uninstalled or incompatible LoRAs and clears an orphaned accelerator flag', () => {+ const catalog = [model, lora('Wan Lightning High Noise'), lora('Wan Lightning Low Noise')];+ const enabled = getAcceleratorToggleResult(createDefaultVideoWidgetValues([model]), model, catalog, true).settings;+ const values = { ...enabled, model };++ // The pair vanishes from the catalog: entries drop, flag clears with them.+ const synced = syncVideoWidgetValuesWithModels(values, [model]);++ expect(synced.loras).toEqual([]);+ expect(synced.acceleratorEnabled).toBe(false);+ expect(synced.acceleratorLoraKeys).toEqual([]);+ });+});++describe('getVideoWidgetValidationReasons', () => {+ it('requires a model first', () => {+ const values = { ...createDefaultVideoWidgetValues(), model: null };++ expect(getVideoWidgetValidationReasons(values)).toEqual(['Video needs a Wan 2.2 or MiniMax H3 main model.']);+ });++ it('passes through settings validation and availability checks', () => {+ const model = wanModel('t2v_a14b');+ const values = createDefaultVideoWidgetValues([model]);++ expect(getVideoWidgetValidationReasons(values, [model])).toEqual([]);+ expect(getVideoWidgetValidationReasons({ ...values, numFrames: 80 }, [model])).toEqual([+ expect.stringContaining('4·n + 1'),+ ]);+ expect(getVideoWidgetValidationReasons(values, [])).toEqual([expect.stringContaining('no longer installed')]);+ });+});++describe('resolveVideoSeed', () => {+ it('keeps a fixed seed and randomizes otherwise', () => {+ expect(resolveVideoSeed({ seed: 42, shouldRandomizeSeed: false })).toBe(42);++ const randomized = resolveVideoSeed({ seed: 42, shouldRandomizeSeed: true });++ expect(Number.isInteger(randomized)).toBe(true);+ expect(randomized).toBeGreaterThanOrEqual(0);+ });+});diff --git a/invokeai/frontend/webv2/src/features/video/core/widgetValues.ts b/invokeai/frontend/webv2/src/features/video/core/widgetValues.tsnew file mode 100644index 0000000000..82e70128c7--- /dev/null+++ b/invokeai/frontend/webv2/src/features/video/core/widgetValues.ts@@ -0,0 +1,155 @@+import type {+ GenerationModelCatalogItem as ModelConfig,+ MainModelConfig,+ ModelIdentifierConfig,+} from '@features/generation/contracts';++import { isLoraCompatibleWithModel, isLoraModelConfig, SEED_MAX } from '@features/generation/settings';++import type { VideoWidgetValues } from './types';++import {+ getDefaultVideoSettings,+ getVideoComponentSectionPolicy,+ getVideoModelAvailabilityReasons,+ getVideoModelSelectionResult,+ getVideoValidationReasons,+ isSupportedVideoModel,+ type VideoComponentPolicyContext,+ type VideoComponentValueKey,+} from './videoPolicies';++/**+ * The panel-facing layer over the pure settings: default values seeded from+ * the installed catalog, catalog reconciliation (upscale-style: render-time,+ * mount write-back, and compile all reuse this one function), the aggregate+ * validation the invoke route consumes, and seed resolution at submit.+ */++export const createDefaultVideoWidgetValues = (models: readonly ModelConfig[] = []): VideoWidgetValues => {+ const model = (models.find((candidate) => isSupportedVideoModel(candidate)) as MainModelConfig | undefined) ?? null;++ return { ...getDefaultVideoSettings(model ?? undefined, models), model };+};++/**+ * Re-resolves every model reference against the live catalog. MUST return the+ * same object when nothing changes — the mount-time reconciler and render+ * memoization rely on that identity guarantee to avoid write-back loops.+ */+export const syncVideoWidgetValuesWithModels = (+ values: VideoWidgetValues,+ models: readonly ModelConfig[]+): VideoWidgetValues => {+ const modelsByKey = new Map(models.map((model) => [model.key, model]));+ const storedMain = values.model ? modelsByKey.get(values.model.key) : undefined;+ const model: MainModelConfig | null =+ storedMain && isSupportedVideoModel(storedMain)+ ? storedMain+ : ((models.find((candidate) => isSupportedVideoModel(candidate)) as MainModelConfig | undefined) ?? null);++ // The main changed identity under us (nothing stored, or the stored model was+ // uninstalled and another family got auto-picked): run the canonical+ // selection transition first, or the new family would inherit the old one's+ // frames/fps/resolution — an H3 main stuck at Wan's fps 16 has no working+ // FPS control to fix it with.+ const base: VideoWidgetValues =+ model && model.key !== values.model?.key+ ? { ...getVideoModelSelectionResult({ currentSettings: values, model, models }).settings, model }+ : values;++ const componentPolicy = model ? getVideoComponentSectionPolicy(model, base) : null;+ const slotsByKey = new Map(componentPolicy?.slots.map((slot) => [slot.key, slot]) ?? []);+ const componentContext: VideoComponentPolicyContext | null = model+ ? { model, selectedComponents: base, settings: base }+ : null;++ const syncComponent = <T extends ModelIdentifierConfig | MainModelConfig>(+ key: VideoComponentValueKey,+ value: T | null+ ): T | null => {+ if (!value) {+ return null;+ }++ const installed = modelsByKey.get(value.key);+ const slot = slotsByKey.get(key);++ if (!installed || !slot || !componentContext) {+ return null;+ }++ return !slot.filter || slot.filter(installed, componentContext) ? (installed as T) : null;+ };++ const loras = model+ ? base.loras.flatMap((lora) => {+ const installed = modelsByKey.get(lora.model.key);++ return installed && isLoraModelConfig(installed) && isLoraCompatibleWithModel(installed, model)+ ? [{ ...lora, model: installed }]+ : [];+ })+ : [];+ // The accelerator flag cannot outlive its recorded LoRAs.+ const acceleratorAlive =+ base.acceleratorEnabled &&+ base.acceleratorLoraKeys.length > 0 &&+ base.acceleratorLoraKeys.every((key) => loras.some((lora) => lora.model.key === key));+ // Reuse the stored array whenever the content is unchanged — the identity+ // guarantee below depends on it.+ const acceleratorLoraKeys = acceleratorAlive || base.acceleratorLoraKeys.length === 0 ? base.acceleratorLoraKeys : [];++ const next: VideoWidgetValues = {+ ...base,+ acceleratorEnabled: acceleratorAlive,+ acceleratorLoraKeys,+ componentSourceModel: syncComponent('componentSourceModel', base.componentSourceModel),+ h3TextEncoderModel: syncComponent('h3TextEncoderModel', base.h3TextEncoderModel),+ h3TransformerModel: syncComponent('h3TransformerModel', base.h3TransformerModel),+ loras,+ model,+ modelKey: model?.key ?? base.modelKey,+ vae: syncComponent('vae', base.vae),+ wanLowNoiseModel: syncComponent('wanLowNoiseModel', base.wanLowNoiseModel),+ wanT5EncoderModel: syncComponent('wanT5EncoderModel', base.wanT5EncoderModel),+ };++ const isUnchanged =+ base === values &&+ next.model === values.model &&+ next.modelKey === values.modelKey &&+ next.acceleratorEnabled === values.acceleratorEnabled &&+ next.acceleratorLoraKeys === values.acceleratorLoraKeys &&+ next.vae === values.vae &&+ next.wanT5EncoderModel === values.wanT5EncoderModel &&+ next.wanLowNoiseModel === values.wanLowNoiseModel &&+ next.componentSourceModel === values.componentSourceModel &&+ next.h3TransformerModel === values.h3TransformerModel &&+ next.h3TextEncoderModel === values.h3TextEncoderModel &&+ next.loras.length === values.loras.length &&+ next.loras.every((lora, index) => lora.model === values.loras[index]?.model);++ return isUnchanged ? values : next;+};++/** The aggregate readiness check the invoke route and the compiler share. */+export const getVideoWidgetValidationReasons = (+ values: VideoWidgetValues,+ models?: readonly ModelConfig[]+): string[] => {+ if (!values.model) {+ return ['Video needs a Wan 2.2 or MiniMax H3 main model.'];+ }++ const reasons = getVideoValidationReasons(values.model, values);++ if (models) {+ reasons.push(...getVideoModelAvailabilityReasons(values.model, values, models));+ }++ return reasons;+};++export const resolveVideoSeed = (values: Pick<VideoWidgetValues, 'seed' | 'shouldRandomizeSeed'>): number =>+ values.shouldRandomizeSeed ? Math.floor(Math.random() * SEED_MAX) : values.seed;diff --git a/invokeai/frontend/webv2/src/features/video/index.ts b/invokeai/frontend/webv2/src/features/video/index.tsindex 95a41fe456..ae2f00dd3a 100644--- a/invokeai/frontend/webv2/src/features/video/index.ts+++ b/invokeai/frontend/webv2/src/features/video/index.ts@@ -79,3 +79,10 @@ export {type VideoTargetResolutionOption,} from './core/videoPolicies';export { compileVideoGraph, type CompiledVideoGraph } from './core/graph';+export {+ createDefaultVideoWidgetValues,+ getVideoWidgetValidationReasons,+ resolveVideoSeed,+ syncVideoWidgetValuesWithModels,+} from './core/widgetValues';+export { VideoUiProvider, useVideoUi, useVideoUiActions, type VideoUiAdapter } from './ui/VideoUiContext';diff --git a/invokeai/frontend/webv2/src/features/video/ui/VideoFormFields.tsx b/invokeai/frontend/webv2/src/features/video/ui/VideoFormFields.tsxnew file mode 100644index 0000000000..c87ac7c61f--- /dev/null+++ b/invokeai/frontend/webv2/src/features/video/ui/VideoFormFields.tsx@@ -0,0 +1,123 @@+import type { GenerateLora, MainModelConfig, PromptHistoryItem } from '@features/generation/contracts';+import type { ProjectPromptDraft, ProjectPromptDraftPatch } from '@features/generation/settings';+import type { VideoWidgetValues } from '@features/video/core/types';++import { Stack, Text } from '@chakra-ui/react';+import { NegativePromptField, PositivePromptField } from '@features/generation/components';+import { areProjectPromptDraftsEqual } from '@features/generation/settings';+import { memo, useCallback } from 'react';+import { useTranslation } from 'react-i18next';++import { areVideoLorasEquivalent, areVideoModelsEquivalent } from './videoComparators';++/**+ * The Video widget's prompt block. Shares the project-wide prompt draft with+ * Generate (upscale-style), so a prompt travels with the user between panels.+ * Memoised against content: the widget re-derives `values` on every patch and+ * the prompt editors carry autocomplete state a needless remount would disturb.+ */+export const VideoPromptFields = memo(+ function VideoPromptFields({+ loras,+ model,+ negativeHelpText,+ negativePromptHeightPx,+ negativeVisible,+ onPatchPromptDraft,+ onPatchValues,+ positivePromptHeightPx,+ projectId,+ promptDraft,+ showSyntaxHighlighting,+ }: {+ loras: GenerateLora[];+ model: MainModelConfig | null;+ negativeHelpText?: string;+ negativePromptHeightPx: number;+ /** From the video prompt policy: MiniMax H3 has no negative conditioning at all. */+ negativeVisible: boolean;+ onPatchPromptDraft: (patch: ProjectPromptDraftPatch) => void;+ onPatchValues: (patch: Partial<VideoWidgetValues>) => void;+ positivePromptHeightPx: number;+ projectId: string;+ promptDraft: ProjectPromptDraft;+ showSyntaxHighlighting: boolean;+ }) {+ const { t } = useTranslation();+ const handleUsePrompt = useCallback(+ (prompt: PromptHistoryItem) =>+ onPatchPromptDraft({+ negativePrompt: prompt.negativePrompt ?? '',+ negativePromptEnabled: prompt.negativePrompt ? true : promptDraft.negativePromptEnabled,+ positivePrompt: prompt.positivePrompt,+ }),+ [onPatchPromptDraft, promptDraft.negativePromptEnabled]+ );+ const handlePositiveChange = useCallback(+ (positivePrompt: string) => onPatchPromptDraft({ positivePrompt }),+ [onPatchPromptDraft]+ );+ const handleNegativeChange = useCallback(+ (negativePrompt: string) => onPatchPromptDraft({ negativePrompt }),+ [onPatchPromptDraft]+ );+ const handleNegativeEnabledChange = useCallback(+ (negativePromptEnabled: boolean) => onPatchPromptDraft({ negativePromptEnabled }),+ [onPatchPromptDraft]+ );+ const handlePositiveResizeEnd = useCallback(+ (positivePromptHeight: number) => onPatchValues({ positivePromptHeightPx: positivePromptHeight }),+ [onPatchValues]+ );+ const handleNegativeResizeEnd = useCallback(+ (negativePromptHeight: number) => onPatchValues({ negativePromptHeightPx: negativePromptHeight }),+ [onPatchValues]+ );++ return (+ <Stack gap="2" p="2">+ <Text color="fg.muted" fontSize="2xs" textWrap="pretty">+ {t('widgets.video.sharedPromptDescription')}+ </Text>+ <PositivePromptField+ heightPx={positivePromptHeightPx}+ loras={loras}+ projectId={projectId}+ selectedModel={model ?? undefined}+ showSyntaxHighlighting={showSyntaxHighlighting}+ value={promptDraft.positivePrompt}+ onChange={handlePositiveChange}+ onResizeEnd={handlePositiveResizeEnd}+ onUsePrompt={handleUsePrompt}+ />+ {negativeVisible ? (+ <NegativePromptField+ heightPx={negativePromptHeightPx}+ helpText={negativeHelpText}+ isEnabled={promptDraft.negativePromptEnabled}+ loras={loras}+ projectId={projectId}+ selectedModel={model ?? undefined}+ showSyntaxHighlighting={showSyntaxHighlighting}+ value={promptDraft.negativePrompt}+ onChange={handleNegativeChange}+ onEnabledChange={handleNegativeEnabledChange}+ onResizeEnd={handleNegativeResizeEnd}+ />+ ) : null}+ </Stack>+ );+ },+ (previous, next) =>+ previous.negativePromptHeightPx === next.negativePromptHeightPx &&+ previous.negativeVisible === next.negativeVisible &&+ previous.negativeHelpText === next.negativeHelpText &&+ previous.onPatchPromptDraft === next.onPatchPromptDraft &&+ previous.onPatchValues === next.onPatchValues &&+ previous.positivePromptHeightPx === next.positivePromptHeightPx &&+ previous.projectId === next.projectId &&+ areProjectPromptDraftsEqual(previous.promptDraft, next.promptDraft) &&+ previous.showSyntaxHighlighting === next.showSyntaxHighlighting &&+ areVideoModelsEquivalent(previous.model, next.model) &&+ areVideoLorasEquivalent(previous.loras, next.loras)+);diff --git a/invokeai/frontend/webv2/src/features/video/ui/VideoUiContext.tsx b/invokeai/frontend/webv2/src/features/video/ui/VideoUiContext.tsxnew file mode 100644index 0000000000..8b40e2558f--- /dev/null+++ b/invokeai/frontend/webv2/src/features/video/ui/VideoUiContext.tsx@@ -0,0 +1,65 @@+import type { ProjectPromptDraft, ProjectPromptDraftPatch } from '@features/generation/settings';+import type { VideoWidgetValues } from '@features/video/core/types';+import type { ReactNode } from 'react';++import { createContext, use, useMemo } from 'react';++/**+ * Video's UI port. The context is a dependency-direction port (the feature+ * may not import workbench), not a test seam; no second adapter is expected.+ */+export interface VideoUiAdapter {+ patchPromptDraft(values: ProjectPromptDraftPatch): void;+ patchValues(values: Partial<VideoWidgetValues>, origin?: 'user' | 'system'): void;+ projectId: string;+ promptDraft: ProjectPromptDraft;+ rawValues: Record<string, unknown>;+ reportError(message: string): void;+ showPromptSyntaxHighlighting: boolean;+}++/** The adapter's callbacks, which are stable for the lifetime of a project. */+export type VideoUiActions = Pick<VideoUiAdapter, 'patchPromptDraft' | 'patchValues' | 'reportError'>;++const VideoUiContext = createContext<VideoUiAdapter | null>(null);+/**+ * Actions are published separately from the adapter because the adapter's+ * identity changes on every value patch (it carries `rawValues`). Components+ * that only need to *do* something — not read state — subscribe here and so are+ * not re-rendered by a keystroke elsewhere in the form.+ */+const VideoUiActionsContext = createContext<VideoUiActions | null>(null);++export const VideoUiProvider = ({ adapter, children }: { adapter: VideoUiAdapter; children: ReactNode }) => {+ const { patchPromptDraft, patchValues, reportError } = adapter;+ const actions = useMemo<VideoUiActions>(+ () => ({ patchPromptDraft, patchValues, reportError }),+ [patchPromptDraft, patchValues, reportError]+ );++ return (+ <VideoUiActionsContext value={actions}>+ <VideoUiContext value={adapter}>{children}</VideoUiContext>+ </VideoUiActionsContext>+ );+};++export const useVideoUi = (): VideoUiAdapter => {+ const adapter = use(VideoUiContext);++ if (!adapter) {+ throw new Error('Video UI requires an App-composed VideoUiProvider.');+ }++ return adapter;+};++export const useVideoUiActions = (): VideoUiActions => {+ const actions = use(VideoUiActionsContext);++ if (!actions) {+ throw new Error('Video UI requires an App-composed VideoUiProvider.');+ }++ return actions;+};diff --git a/invokeai/frontend/webv2/src/features/video/ui/VideoWidgetView.tsx b/invokeai/frontend/webv2/src/features/video/ui/VideoWidgetView.tsxnew file mode 100644index 0000000000..0c3d9e9d23--- /dev/null+++ b/invokeai/frontend/webv2/src/features/video/ui/VideoWidgetView.tsx@@ -0,0 +1,418 @@+import type { ModelConfig, ModelTaxonomyType } from '@features/models';+import type { VideoWidgetValues } from '@features/video/core/types';++import { createListCollection, HStack, NumberInput, Stack, Switch, Text } from '@chakra-ui/react';+import { GenerationSettingsSection } from '@features/generation/components';+import { isMainModelConfig, SEED_MAX } from '@features/generation/settings';+import { ensureModelsLoaded, useModelsSelector } from '@features/models';+import { ModelSelect } from '@features/models/react';+import { getVideoDurationSeconds, invertVideoAspectRatioId } from '@features/video/core/dimensions';+import { normalizeVideoWidgetValues, VIDEO_ASPECT_RATIO_IDS } from '@features/video/core/settings';+import {+ getAcceleratorToggleResult,+ getVideoDimensions,+ getVideoModelPolicy,+ getVideoModelSelectionResult,+ isVideoModelSelectable,+} from '@features/video/core/videoPolicies';+import { createDefaultVideoWidgetValues, syncVideoWidgetValuesWithModels } from '@features/video/core/widgetValues';+import { useMountEffect } from '@platform/react/useMountEffect';+import { Field, IconButton, Select } from '@platform/ui';+import { SliderNumberField } from '@platform/ui/SliderNumberField';+import { toaster } from '@platform/ui/toaster';+import { ArrowLeftRightIcon, DicesIcon } from 'lucide-react';+import { useCallback, useMemo } from 'react';+import { useTranslation } from 'react-i18next';++import { areVideoValuesEqual } from './videoComparators';+import { VideoPromptFields } from './VideoFormFields';+import { useVideoUi, useVideoUiActions } from './VideoUiContext';++/**+ * Every prop identity in this file is stable by construction — module-scope+ * constants for literals, `useCallback`/`useMemo` for anything closing over+ * state, and `memo` on each section — matching the Upscale widget's contract:+ * the widget re-renders on every keystroke that patches project state.+ */++const MAIN_MODEL_TYPES: readonly ModelTaxonomyType[] = ['main'];+const SWITCH_CHECKED_PROPS = { bg: 'accent.solid' };++const ASPECT_RATIO_COLLECTION = createListCollection({+ items: VIDEO_ASPECT_RATIO_IDS.map((id) => ({ label: id, value: id })),+});++const toTargetResolution = (value: string | undefined): VideoWidgetValues['targetResolution'] | null =>+ value === '480p' || value === '720p' || value === '1080p' || value === '768 highres' || value === '768 lowres'+ ? value+ : null;++const DURATION_FORMATTER = new Intl.NumberFormat(undefined, {+ maximumFractionDigits: 2,+ minimumFractionDigits: 1,+});++const VideoModelReconciler = ({+ rawValues,+ values,+}: {+ rawValues: Record<string, unknown>;+ values: VideoWidgetValues;+}) => {+ const { patchValues } = useVideoUiActions();++ useMountEffect(() => {+ const normalized = normalizeVideoWidgetValues(rawValues);++ if (normalized && areVideoValuesEqual(normalized, values)) {+ return;+ }++ patchValues({ ...values }, 'system');+ });++ return null;+};++export const VideoWidgetView = () => {+ const { t } = useTranslation();+ const selection = useVideoUi();+ const models = useModelsSelector((snapshot) => snapshot.models);+ const modelsStatus = useModelsSelector((snapshot) => snapshot.status);+ const { patchPromptDraft: patchDraft, patchValues, projectId, promptDraft, rawValues } = selection;+ // Normalizing and reconciling against the model list is the widget's most+ // expensive derivation; it must not run on unrelated re-renders, and a fresh+ // `values` identity would re-render every section below.+ const values = useMemo(() => {+ const normalized =+ normalizeVideoWidgetValues(rawValues) ?? createDefaultVideoWidgetValues(modelsStatus === 'loaded' ? models : []);++ return modelsStatus === 'loaded' ? syncVideoWidgetValuesWithModels(normalized, models) : normalized;+ }, [models, modelsStatus, rawValues]);+ const modelsFingerprint = useMemo(+ () =>+ models+ .map(+ (model) =>+ `${model.key}:${model.hash}:${model.name}:${model.base}:${model.type}:${model.format}:${model.variant ?? ''}`+ )+ .join('|'),+ [models]+ );+ const policy = useMemo(() => getVideoModelPolicy(values.model ?? undefined, values), [values]);+ const dimensions = useMemo(() => getVideoDimensions(values.model ?? undefined, values), [values]);+ const durationSeconds = getVideoDurationSeconds(+ values.numFrames,+ policy.fps.editable ? values.fps : policy.fps.defaultValue+ );++ const patch = useCallback((next: Partial<VideoWidgetValues>) => patchValues(next), [patchValues]);++ useMountEffect(() => {+ void ensureModelsLoaded();+ });++ const selectMainModel = useCallback(+ (model: ModelConfig | null) => {+ if (!isMainModelConfig(model) || !isVideoModelSelectable(model)) {+ return;+ }++ const result = getVideoModelSelectionResult({ currentSettings: values, model, models });++ patch({ ...result.settings, model });++ if (result.clearedLabels.length > 0) {+ toaster.create({+ description: t('widgets.video.settingsAdjustedDescription', {+ labels: result.clearedLabels.join(', '),+ }),+ title: t('widgets.video.settingsAdjusted'),+ type: 'info',+ });+ }+ },+ [models, patch, t, values]+ );++ const toggleAccelerator = useCallback(+ (details: { checked: boolean }) => {+ if (!values.model) {+ return;+ }++ const result = getAcceleratorToggleResult(values, values.model, models, details.checked);++ if (result.missingLoras) {+ toaster.create({+ description: t('widgets.video.acceleratorMissingDescription', {+ label: policy.ui.accelerator?.label ?? '',+ }),+ title: t('widgets.video.acceleratorMissing'),+ type: 'warning',+ });+ return;+ }++ patch({ ...result.settings });+ },+ [models, patch, policy.ui.accelerator?.label, t, values]+ );++ // One setter per field, created once per `patch` identity: inline+ // `onChange={(x) => patch({ x })}` props would defeat every `memo` below.+ const set = useMemo(+ () => ({+ aspectRatio: ({ value }: { value: string[] }) => {+ const aspectRatioId = value[0];++ if (aspectRatioId && (VIDEO_ASPECT_RATIO_IDS as readonly string[]).includes(aspectRatioId)) {+ patch({ aspectRatioId: aspectRatioId as VideoWidgetValues['aspectRatioId'] });+ }+ },+ cfgScale: (cfgScale: number) => patch({ cfgScale }),+ cfgScaleLowNoise: (cfgScaleLowNoise: number) => patch({ cfgScaleLowNoise }),+ fps: (fps: number) => patch({ fps }),+ numFrames: (numFrames: number) => patch({ numFrames }),+ randomizeSeed: (details: { checked: boolean }) => patch({ shouldRandomizeSeed: details.checked }),+ seed: ({ valueAsNumber }: NumberInput.ValueChangeDetails) =>+ Number.isFinite(valueAsNumber) && patch({ seed: valueAsNumber }),+ shuffleSeed: () => patch({ seed: Math.floor(Math.random() * SEED_MAX) }),+ steps: (steps: number) => patch({ steps }),+ targetResolution: ({ value }: { value: string[] }) => {+ const targetResolution = toTargetResolution(value[0]);++ if (targetResolution) {+ patch({ targetResolution });+ }+ },+ }),+ [patch]+ );++ const swapAspectRatio = useCallback(+ () => patch({ aspectRatioId: invertVideoAspectRatioId(values.aspectRatioId) }),+ [patch, values.aspectRatioId]+ );++ const targetResolutionCollection = useMemo(+ () => createListCollection({ items: policy.targetResolutions.map((option) => ({ ...option, value: option.id })) }),+ [policy.targetResolutions]+ );+ const aspectRatioValue = useMemo(() => [values.aspectRatioId], [values.aspectRatioId]);+ const targetResolutionValue = useMemo(() => [values.targetResolution], [values.targetResolution]);++ const framesSlider = useMemo(+ () =>+ policy.frames.kind === 'grid'+ ? { max: policy.frames.max, min: policy.frames.min, step: policy.frames.step }+ : {+ max: policy.frames.choices[policy.frames.choices.length - 1] ?? 0,+ min: policy.frames.choices[0] ?? 0,+ step:+ policy.frames.choices.length > 1 ? (policy.frames.choices[1] ?? 0) - (policy.frames.choices[0] ?? 0) : 1,+ },+ [policy.frames]+ );++ // Conditioning media locks the aspect ratio in later stack PRs; today the+ // preset is always the source, so this only reports the derived canvas.+ const derivedSizeText = dimensions+ ? t('widgets.video.derivedSize', { height: dimensions.height, width: dimensions.width })+ : t('widgets.video.derivedSizeUnavailable');+ const durationText =+ durationSeconds === null+ ? undefined+ : t('widgets.video.framesDuration', { seconds: DURATION_FORMATTER.format(durationSeconds) });++ return (+ <Stack gap="1" minW="0" p="1">+ <VideoModelReconciler+ key={`${projectId}:${modelsStatus}:${modelsFingerprint}`}+ rawValues={rawValues}+ values={values}+ />++ <VideoPromptFields+ loras={values.loras}+ model={values.model}+ negativeHelpText={policy.prompt.negativeHelpText}+ negativePromptHeightPx={values.negativePromptHeightPx}+ negativeVisible={policy.prompt.negativeVisible}+ positivePromptHeightPx={values.positivePromptHeightPx}+ projectId={projectId}+ promptDraft={promptDraft}+ showSyntaxHighlighting={selection.showPromptSyntaxHighlighting}+ onPatchPromptDraft={patchDraft}+ onPatchValues={patch}+ />++ <GenerationSettingsSection label={t('widgets.video.dimensions')} sectionId="video-dimensions" defaultOpen>+ <Stack gap="3" p="2">+ <Field helpText={derivedSizeText} label={t('widgets.video.aspectRatio')}>+ <HStack gap="1">+ <Select+ collection={ASPECT_RATIO_COLLECTION}+ flex="1"+ size="xs"+ value={aspectRatioValue}+ onValueChange={set.aspectRatio}+ />+ <IconButton+ aria-label={t('widgets.video.swapAspectRatio')}+ size="xs"+ variant="ghost"+ onClick={swapAspectRatio}+ >+ <ArrowLeftRightIcon />+ </IconButton>+ </HStack>+ </Field>+ <Field label={t('widgets.video.targetResolution')}>+ <Select+ collection={targetResolutionCollection}+ size="xs"+ value={targetResolutionValue}+ onValueChange={set.targetResolution}+ />+ </Field>+ <Field helpText={durationText} label={t('widgets.video.frames')}>+ <SliderNumberField+ ariaLabel={t('widgets.video.frames')}+ max={framesSlider.max}+ min={framesSlider.min}+ step={framesSlider.step}+ value={values.numFrames}+ onChange={set.numFrames}+ />+ </Field>+ {policy.ui.fpsVisible ? (+ <Field label={t('widgets.video.fps')}>+ <SliderNumberField+ ariaLabel={t('widgets.video.fps')}+ max={60}+ min={policy.fps.min}+ numberInputMax={policy.fps.max}+ step={1}+ value={values.fps}+ onChange={set.fps}+ />+ </Field>+ ) : (+ <Text color="fg.muted" fontSize="2xs">+ {t('widgets.video.fixedFps', { fps: policy.fps.defaultValue })}+ </Text>+ )}+ </Stack>+ </GenerationSettingsSection>++ <GenerationSettingsSection label={t('widgets.video.model')} sectionId="video-model" defaultOpen>+ <Stack gap="3" p="2">+ <Field+ error={values.model ? undefined : t('widgets.video.modelRequired')}+ label={t('widgets.video.mainModel')}+ >+ <ModelSelect+ filter={isVideoModelSelectable}+ invalid={!values.model}+ modelTypes={MAIN_MODEL_TYPES}+ placeholder={t('widgets.video.selectModel')}+ size="xs"+ value={values.model?.key ?? null}+ onChange={selectMainModel}+ />+ </Field>+ {policy.ui.accelerator && values.model ? (+ <Field+ helpText={t('widgets.video.acceleratorHelp', {+ label: policy.ui.accelerator.label,+ steps: policy.ui.accelerator.steps,+ })}+ label={t('widgets.video.accelerator', { label: policy.ui.accelerator.label })}+ >+ <Switch.Root checked={values.acceleratorEnabled} size="sm" onCheckedChange={toggleAccelerator}>+ <Switch.HiddenInput />+ <Switch.Control _checked={SWITCH_CHECKED_PROPS}>+ <Switch.Thumb />+ </Switch.Control>+ </Switch.Root>+ </Field>+ ) : null}+ <Field hint="steps" label={t('widgets.video.steps')}>+ <SliderNumberField+ ariaLabel={t('widgets.video.steps')}+ max={100}+ min={1}+ numberInputMax={500}+ step={1}+ value={values.steps}+ onChange={set.steps}+ />+ </Field>+ {policy.ui.cfgVisible ? (+ <Field hint="cfgScale" label={t('widgets.video.cfg')}>+ <SliderNumberField+ ariaLabel={t('widgets.video.cfg')}+ max={15}+ min={1}+ numberInputMax={100}+ step={0.1}+ value={values.cfgScale}+ onChange={set.cfgScale}+ />+ </Field>+ ) : null}+ {policy.ui.cfgLowNoiseVisible ? (+ <Field helpText={t('widgets.video.cfgLowNoiseHelp')} label={t('widgets.video.cfgLowNoise')}>+ <SliderNumberField+ ariaLabel={t('widgets.video.cfgLowNoise')}+ max={15}+ min={0}+ numberInputMax={100}+ step={0.1}+ value={values.cfgScaleLowNoise ?? values.cfgScale}+ onChange={set.cfgScaleLowNoise}+ />+ </Field>+ ) : null}+ <Field hint="seed" label={t('widgets.video.seed')}>+ <HStack gap="2">+ <NumberInput.Root+ disabled={values.shouldRandomizeSeed}+ flex="1"+ max={SEED_MAX}+ min={0}+ size="xs"+ step={1}+ value={String(values.seed)}+ onValueChange={set.seed}+ >+ <NumberInput.Input aria-label={t('widgets.video.seed')} />+ </NumberInput.Root>+ <IconButton+ aria-label={t('widgets.video.shuffleSeed')}+ disabled={values.shouldRandomizeSeed}+ size="xs"+ variant="ghost"+ onClick={set.shuffleSeed}+ >+ <DicesIcon />+ </IconButton>+ <HStack gap="1">+ <Switch.Root checked={values.shouldRandomizeSeed} size="sm" onCheckedChange={set.randomizeSeed}>+ <Switch.HiddenInput />+ <Switch.Control _checked={SWITCH_CHECKED_PROPS}>+ <Switch.Thumb />+ </Switch.Control>+ </Switch.Root>+ <Text color="fg.muted" fontSize="2xs">+ {t('widgets.video.randomizeSeed')}+ </Text>+ </HStack>+ </HStack>+ </Field>+ </Stack>+ </GenerationSettingsSection>+ </Stack>+ );+};diff --git a/invokeai/frontend/webv2/src/features/video/ui/implementation.ts b/invokeai/frontend/webv2/src/features/video/ui/implementation.tsnew file mode 100644index 0000000000..b0628194f3--- /dev/null+++ b/invokeai/frontend/webv2/src/features/video/ui/implementation.ts@@ -0,0 +1,3 @@+import { VideoWidgetView } from './VideoWidgetView';++export const widgetImplementation = { view: VideoWidgetView };diff --git a/invokeai/frontend/webv2/src/features/video/ui/videoComparators.ts b/invokeai/frontend/webv2/src/features/video/ui/videoComparators.tsnew file mode 100644index 0000000000..870e408a40--- /dev/null+++ b/invokeai/frontend/webv2/src/features/video/ui/videoComparators.ts@@ -0,0 +1,61 @@+import type { VideoWidgetValues } from '@features/video/core/types';++/**+ * Content comparators for the widget's memo boundaries and the mount-time+ * reconciler. The widget re-derives `values` on every patch, so equality by+ * content — not identity — decides whether a write-back or re-render is due.+ */++const stableStringify = (value: unknown): string => JSON.stringify(value ?? null);++export const areVideoModelsEquivalent = (+ left: { key: string; hash?: string } | null,+ right: { key: string; hash?: string } | null+): boolean => (left === null && right === null) || (left?.key === right?.key && left?.hash === right?.hash);++export const areVideoLorasEquivalent = (left: VideoWidgetValues['loras'], right: VideoWidgetValues['loras']): boolean =>+ left.length === right.length &&+ left.every(+ (lora, index) =>+ lora.model.key === right[index]?.model.key &&+ lora.weight === right[index]?.weight &&+ lora.isEnabled === right[index]?.isEnabled+ );++export const areVideoValuesEqual = (left: VideoWidgetValues, right: VideoWidgetValues): boolean => {+ if (left === right) {+ return true;+ }++ return (+ left.modelKey === right.modelKey &&+ areVideoModelsEquivalent(left.model, right.model) &&+ left.positivePrompt === right.positivePrompt &&+ left.negativePrompt === right.negativePrompt &&+ left.negativePromptEnabled === right.negativePromptEnabled &&+ left.positivePromptHeightPx === right.positivePromptHeightPx &&+ left.negativePromptHeightPx === right.negativePromptHeightPx &&+ left.aspectRatioId === right.aspectRatioId &&+ left.targetResolution === right.targetResolution &&+ left.numFrames === right.numFrames &&+ left.fps === right.fps &&+ left.steps === right.steps &&+ left.cfgScale === right.cfgScale &&+ left.cfgScaleLowNoise === right.cfgScaleLowNoise &&+ left.acceleratorEnabled === right.acceleratorEnabled &&+ stableStringify(left.acceleratorLoraKeys) === stableStringify(right.acceleratorLoraKeys) &&+ left.seed === right.seed &&+ left.shouldRandomizeSeed === right.shouldRandomizeSeed &&+ left.batchCount === right.batchCount &&+ areVideoLorasEquivalent(left.loras, right.loras) &&+ stableStringify(left.firstFrameImage) === stableStringify(right.firstFrameImage) &&+ stableStringify(left.lastFrameImage) === stableStringify(right.lastFrameImage) &&+ stableStringify(left.sourceVideo) === stableStringify(right.sourceVideo) &&+ stableStringify(left.vae) === stableStringify(right.vae) &&+ stableStringify(left.wanT5EncoderModel) === stableStringify(right.wanT5EncoderModel) &&+ stableStringify(left.wanLowNoiseModel) === stableStringify(right.wanLowNoiseModel) &&+ stableStringify(left.componentSourceModel) === stableStringify(right.componentSourceModel) &&+ stableStringify(left.h3TransformerModel) === stableStringify(right.h3TransformerModel) &&+ stableStringify(left.h3TextEncoderModel) === stableStringify(right.h3TextEncoderModel)+ );+};diff --git a/invokeai/frontend/webv2/src/features/video/widget.ts b/invokeai/frontend/webv2/src/features/video/widget.tsnew file mode 100644index 0000000000..3182b7a7f8--- /dev/null+++ b/invokeai/frontend/webv2/src/features/video/widget.ts@@ -0,0 +1 @@+export { widgetImplementation } from './ui/implementation';diff --git a/invokeai/frontend/webv2/src/features/workflow/ui/contracts.ts b/invokeai/frontend/webv2/src/features/workflow/ui/contracts.tsindex e9d07ba252..17545d7886 100644--- a/invokeai/frontend/webv2/src/features/workflow/ui/contracts.ts+++ b/invokeai/frontend/webv2/src/features/workflow/ui/contracts.ts@@ -18,7 +18,7 @@ export type WorkflowWidgetPanelRegion = 'left' | 'right' | 'bottom' | 'center';* wiring in `app/WorkflowUiAdapter.tsx` and the `GraphPreviewDialog` mount in* `workbench/widget-frame/WidgetActionsMenu.tsx`.*/-export type WorkflowInvocationSourceId = 'generate' | 'workflow' | 'upscale' | 'canvas';+export type WorkflowInvocationSourceId = 'generate' | 'workflow' | 'upscale' | 'video' | 'canvas';export interface WorkflowRuntimeApi {instanceId: string;diff --git a/invokeai/frontend/webv2/src/workbench/autoRoutePolicy.test.ts b/invokeai/frontend/webv2/src/workbench/autoRoutePolicy.test.tsindex 0713b703a3..ea299861e0 100644--- a/invokeai/frontend/webv2/src/workbench/autoRoutePolicy.test.ts+++ b/invokeai/frontend/webv2/src/workbench/autoRoutePolicy.test.ts@@ -39,7 +39,7 @@ describe('getRouteAfterHighConfidenceEdit', () => {expect(getRouteAfterHighConfidenceEdit(route({ destination: 'gallery' }), 'canvas')).toEqual(route({ destination: 'canvas', sourceId: 'canvas' }));- expect(Object.keys(autoSwitchDestinations).sort()).toEqual(['canvas', 'generate', 'upscale', 'workflow']);+ expect(Object.keys(autoSwitchDestinations).sort()).toEqual(['canvas', 'generate', 'upscale', 'video', 'workflow']);});it('preserves route identity for same-source and source-locked edits', () => {diff --git a/invokeai/frontend/webv2/src/workbench/autoRoutePolicy.ts b/invokeai/frontend/webv2/src/workbench/autoRoutePolicy.tsindex c495d42bae..3976c89045 100644--- a/invokeai/frontend/webv2/src/workbench/autoRoutePolicy.ts+++ b/invokeai/frontend/webv2/src/workbench/autoRoutePolicy.ts@@ -2,6 +2,7 @@ import type { ProjectGraphAction } from '@features/workflow/utility';import type { InvocationRoute, InvocationSourceId, ResultDestination } from '@workbench/invocationContracts';import { GENERATE_UI_STATE_KEYS } from '@features/generation/settings';+import { VIDEO_UI_STATE_KEYS } from '@features/video';import type { CanvasProjectMutation } from './canvasProjectMutations';@@ -15,6 +16,7 @@ export const autoSwitchDestinations: Record<InvocationSourceId, ResultDestinatiocanvas: 'canvas',generate: 'gallery',upscale: 'gallery',+ video: 'gallery',workflow: 'gallery',};@@ -65,6 +67,12 @@ export const isHighConfidenceGenerateEdit = (changedKeys: readonly string[]): boexport const isHighConfidenceUpscaleEdit = (changedKeys: readonly string[]): boolean =>hasIntentBearingKey(changedKeys, UPSCALE_UI_NOISE_KEYS);+// Named beside VideoSettings for the same reason as generate's.+const VIDEO_UI_NOISE_KEYS: ReadonlySet<string> = new Set(Object.keys(VIDEO_UI_STATE_KEYS));++export const isHighConfidenceVideoEdit = (changedKeys: readonly string[]): boolean =>+ hasIntentBearingKey(changedKeys, VIDEO_UI_NOISE_KEYS);+const GRAPH_EDIT_CONFIDENCE = {addEdge: true,addFormElement: false,diff --git a/invokeai/frontend/webv2/src/workbench/graphWidgets.test.ts b/invokeai/frontend/webv2/src/workbench/graphWidgets.test.tsindex 667d5da7f5..9a629529ff 100644--- a/invokeai/frontend/webv2/src/workbench/graphWidgets.test.ts+++ b/invokeai/frontend/webv2/src/workbench/graphWidgets.test.ts@@ -35,7 +35,13 @@ describe('graph widget sources', () => {// be showing turns the menu into a dead end: the user can see that Workflow// exists but has no way to route to it without rearranging the dock first.it('offers every graph widget as a source', () => {- expect(graphWidgetSources.map((source) => source.sourceId)).toEqual(['generate', 'canvas', 'upscale', 'workflow']);+ expect(graphWidgetSources.map((source) => source.sourceId)).toEqual([+ 'generate',+ 'canvas',+ 'upscale',+ 'video',+ 'workflow',+ ]);});it('separates active widgets from placed secondary widgets', () => {diff --git a/invokeai/frontend/webv2/src/workbench/graphWidgets.ts b/invokeai/frontend/webv2/src/workbench/graphWidgets.tsindex 417110668c..1ddc04395d 100644--- a/invokeai/frontend/webv2/src/workbench/graphWidgets.ts+++ b/invokeai/frontend/webv2/src/workbench/graphWidgets.ts@@ -5,7 +5,7 @@ import type { WidgetTypeId } from '@workbench/widgetContracts';import { autoSwitchDestinations } from './autoRoutePolicy';import { getDestinationLabel, getSourceLabel, isInvocationSourceAvailable } from './invocation';-const graphWidgetTypeIds = ['generate', 'canvas', 'upscale', 'workflow'] as const;+const graphWidgetTypeIds = ['generate', 'canvas', 'upscale', 'video', 'workflow'] as const;export type GraphWidgetTypeId = (typeof graphWidgetTypeIds)[number];@@ -13,6 +13,7 @@ const sourceIdsByWidgetTypeId: Record<GraphWidgetTypeId, InvocationSourceId> = {canvas: 'canvas',generate: 'generate',upscale: 'upscale',+ video: 'video',workflow: 'workflow',};@@ -20,6 +21,7 @@ const widgetTypeIdsBySourceId: Record<InvocationSourceId, GraphWidgetTypeId> = {canvas: 'canvas',generate: 'generate',upscale: 'upscale',+ video: 'video',workflow: 'workflow',};diff --git a/invokeai/frontend/webv2/src/workbench/invocation.ts b/invokeai/frontend/webv2/src/workbench/invocation.tsindex a3804eed0d..8f20451fdc 100644--- a/invokeai/frontend/webv2/src/workbench/invocation.ts+++ b/invokeai/frontend/webv2/src/workbench/invocation.ts@@ -18,6 +18,7 @@ import {normalizeGenerateWidgetValues,} from '@features/generation/settings';import { getUpscaleValidationReasons, normalizeUpscaleWidgetValues } from '@features/upscale';+import { getVideoWidgetValidationReasons, normalizeVideoWidgetValues } from '@features/video';import { getProjectGraphReadiness } from '@features/workflow/graph';import { getInvocationTemplatesSnapshot } from '@features/workflow/react';import { areArraysEqual, createStableSelector } from '@platform/state/selectors';@@ -49,6 +50,7 @@ export const invocationSources: InvocationSourceMeta[] = [{ id: 'generate', label: 'Generate', available: true },{ id: 'workflow', label: 'Workflow', available: true },{ id: 'upscale', label: 'Upscale', available: true },+ { id: 'video', label: 'Video', available: true },{ id: 'canvas', label: 'Canvas', available: true },];@@ -83,12 +85,14 @@ const sourceWidgetIds: Partial<Record<InvocationSourceId, WidgetId>> = {canvas: 'canvas',generate: 'generate',upscale: 'upscale',+ video: 'video',workflow: 'workflow',};export interface InvocationRouteInput {generateValues: Record<string, unknown>;upscaleValues: Record<string, unknown>;+ videoValues: Record<string, unknown>;invocation: InvocationRoute;mountedWidgetIds: readonly WidgetId[];projectGraph: ProjectGraphState;@@ -132,6 +136,7 @@ export const getInvocationRouteInput = (project: Project): InvocationRouteInputcanvasLayers: project.canvas.document.layers,generateValues: getProjectWidgetValues(project, 'generate'),upscaleValues: getProjectWidgetValues(project, 'upscale'),+ videoValues: getProjectWidgetValues(project, 'video'),invocation: project.invocation,mountedWidgetIds: getMountedWidgetIds(project),projectGraph: project.projectGraph,@@ -144,6 +149,7 @@ export const areInvocationRouteInputsEqual = (left: InvocationRouteInput, right:left.projectGraph === right.projectGraph &&left.generateValues === right.generateValues &&left.upscaleValues === right.upscaleValues &&+ left.videoValues === right.videoValues &&left.canvasBbox.width === right.canvasBbox.width &&left.canvasBbox.height === right.canvasBbox.height &&left.canvasLayers === right.canvasLayers &&@@ -215,6 +221,14 @@ export const resolveInvocationRouteInput = ();}+ if (sourceId === 'video') {+ const values = normalizeVideoWidgetValues(input.videoValues);++ validationReasons.push(+ ...(values ? getVideoWidgetValidationReasons(values, models) : ['Video settings are incomplete.'])+ );+ }+if (sourceId === 'canvas') {// Canvas shares the generate model/prompt/steps, so reuse those reasons, then// require a non-degenerate generation frame (a zero-area bbox has nothing todiff --git a/invokeai/frontend/webv2/src/workbench/invocationContracts.ts b/invokeai/frontend/webv2/src/workbench/invocationContracts.tsindex c0c3667194..74c6fb093a 100644--- a/invokeai/frontend/webv2/src/workbench/invocationContracts.ts+++ b/invokeai/frontend/webv2/src/workbench/invocationContracts.ts@@ -1,4 +1,4 @@-export type InvocationSourceId = 'generate' | 'workflow' | 'upscale' | 'canvas';+export type InvocationSourceId = 'generate' | 'workflow' | 'upscale' | 'video' | 'canvas';export type InvocationMode = 'global' | 'dialog';diff --git a/invokeai/frontend/webv2/src/workbench/invocationSubmit.ts b/invokeai/frontend/webv2/src/workbench/invocationSubmit.tsindex 26bc537413..0909319fa3 100644--- a/invokeai/frontend/webv2/src/workbench/invocationSubmit.ts+++ b/invokeai/frontend/webv2/src/workbench/invocationSubmit.ts@@ -66,7 +66,7 @@ export interface SubmitResolvedInvocationDeps {* expander could mistake it for a one-option group.*/const getExpandableSettings = (project: Project, route: ResolvedInvocationRoute): GenerateSettings | null => {- if (route.sourceId === 'upscale' || route.sourceId === 'workflow') {+ if (route.sourceId === 'upscale' || route.sourceId === 'video' || route.sourceId === 'workflow') {return null;}diff --git a/invokeai/frontend/webv2/src/workbench/layoutPresets.test.ts b/invokeai/frontend/webv2/src/workbench/layoutPresets.test.tsindex 1aecc75cd7..8e1a0e8acd 100644--- a/invokeai/frontend/webv2/src/workbench/layoutPresets.test.ts+++ b/invokeai/frontend/webv2/src/workbench/layoutPresets.test.ts@@ -79,7 +79,7 @@ describe('built-in layout preset descriptors', () => {// "Compose with the center view swapped", so the swap has to remain// available.center: ['preview', 'gallery:center'],- left: ['generate', 'upscale'],+ left: ['generate', 'upscale', 'video'],panels: { isBottomOpen: false, isLeftOpen: true, isRightOpen: true },right: ['gallery', 'image-map', 'queue'],},@@ -87,7 +87,7 @@ describe('built-in layout preset descriptors', () => {active: { bottom: 'gallery:bottom', center: 'canvas', left: 'generate', right: 'layers' },bottom: ['server-status', 'queue-status', 'gallery:bottom', 'notifications', 'autosave-status'],center: ['canvas', 'preview'],- left: ['generate', 'upscale'],+ left: ['generate', 'upscale', 'video'],panels: { isBottomOpen: false, isLeftOpen: true, isRightOpen: true },right: ['layers', 'preview', 'gallery', 'image-map', 'queue'],},diff --git a/invokeai/frontend/webv2/src/workbench/layoutPresets.ts b/invokeai/frontend/webv2/src/workbench/layoutPresets.tsindex 92f8ddd2fa..88c3b70522 100644--- a/invokeai/frontend/webv2/src/workbench/layoutPresets.ts+++ b/invokeai/frontend/webv2/src/workbench/layoutPresets.ts@@ -32,6 +32,7 @@ const defaultInstanceTypes: Record<WidgetInstanceId, WidgetTypeId> = {generate: 'generate','image-map': 'image-map',upscale: 'upscale',+ video: 'video',layers: 'layers',notifications: 'notifications',preview: 'preview',@@ -173,7 +174,7 @@ export const builtInLayoutPresetDescriptors: BuiltInLayoutPresetDescriptor[] = [}),left: createRegion({activeInstanceId: 'generate',- instanceIds: ['generate', 'upscale'],+ instanceIds: ['generate', 'upscale', 'video'],sizePx: 450,}),right: createRegion({@@ -206,7 +207,7 @@ export const builtInLayoutPresetDescriptors: BuiltInLayoutPresetDescriptor[] = [}),left: createRegion({activeInstanceId: 'generate',- instanceIds: ['generate', 'upscale'],+ instanceIds: ['generate', 'upscale', 'video'],sizePx: 450,}),right: createRegion({diff --git a/invokeai/frontend/webv2/src/workbench/queueHistoryNormalization.ts b/invokeai/frontend/webv2/src/workbench/queueHistoryNormalization.tsindex 2d50e74ca8..6d1d5f2ca8 100644--- a/invokeai/frontend/webv2/src/workbench/queueHistoryNormalization.ts+++ b/invokeai/frontend/webv2/src/workbench/queueHistoryNormalization.ts@@ -11,6 +11,7 @@ import type { WidgetInstanceContract, WidgetInstanceId, WidgetStateMap } from '@import { getEffectivePrompts, normalizeGenerateSettings, sanitizeBatchCount } from '@features/generation/settings';import { getUpscaleOutputDimensions, normalizeUpscaleWidgetValues } from '@features/upscale';+import { normalizeVideoWidgetValues } from '@features/video';import type { WorkbenchQueueItem, WorkbenchQueueState } from './queueHistoryContracts';@@ -85,7 +86,9 @@ const normalizeSourceId = (value: unknown): QueueSourceId | null => {if (value === 'canvas-fill') {return 'canvas';}- return value === 'canvas' || value === 'generate' || value === 'upscale' || value === 'workflow' ? value : null;+ return value === 'canvas' || value === 'generate' || value === 'upscale' || value === 'video' || value === 'workflow'+ ? value+ : null;};const isBackendGraph = (value: unknown): value is QueueBackendGraph =>@@ -204,9 +207,11 @@ const getBackendSubmission = (const sourceSettings =sourceId === 'upscale'? normalizeUpscaleWidgetValues(getWidgetValues(widgetStates, 'upscale'))- : sourceId === 'canvas'- ? normalizeGenerateSettings(generateCapture?.values ?? generateValues)- : normalizeGenerateSettings(generateValues);+ : sourceId === 'video'+ ? normalizeVideoWidgetValues(getWidgetValues(widgetStates, 'video'))+ : sourceId === 'canvas'+ ? normalizeGenerateSettings(generateCapture?.values ?? generateValues)+ : normalizeGenerateSettings(generateValues);if (!sourceSettings) {return {@@ -224,7 +229,7 @@ const getBackendSubmission = (// The merged source computed above, not the raw settings: the row is written// at submit time from the merged prompt, so returning the authored text here// made a rehydrated item's prompt change under the user on reload.- presentationSource: sourceId === 'upscale' ? null : presentationSource,+ presentationSource: sourceId === 'upscale' || sourceId === 'video' ? null : presentationSource,submission: {batchCount: sourceSettings.batchCount,graph: backendGraph,@@ -303,7 +308,9 @@ const normalizeLegacyQueueItem = (? { resultNodeIds: ['canvas_output'] }: safeSourceId === 'upscale'? { resultNodeIds: ['upscale_output'] }- : {}),+ : safeSourceId === 'video'+ ? { resultNodeIds: ['video_output'] }+ : {}),sourceId: safeSourceId,submittedAt: typeof snapshot.submittedAt === 'string' ? snapshot.submittedAt : new Date(0).toISOString(),widgetInstances: stripGalleryRecentImagesFromWidgetInstances(diff --git a/invokeai/frontend/webv2/src/workbench/shell/topbar/InvokeButton.tsx b/invokeai/frontend/webv2/src/workbench/shell/topbar/InvokeButton.tsxindex 9e4bb4e14e..d128dac905 100644--- a/invokeai/frontend/webv2/src/workbench/shell/topbar/InvokeButton.tsx+++ b/invokeai/frontend/webv2/src/workbench/shell/topbar/InvokeButton.tsx@@ -136,7 +136,7 @@ const InvokeTooltipContent = ({ shortcutParts, state }: { shortcutParts: string[const destination = getDestinationLabel(invocation.destination);const promptCount = promptExpansion.count;const summary =- invocation.sourceId === 'generate' || invocation.sourceId === 'upscale'+ invocation.sourceId === 'generate' || invocation.sourceId === 'upscale' || invocation.sourceId === 'video'? promptExpansion.isLoading? t('topbar.invoke.expandingPrompts'): `${plural(promptCount, 'prompt')} × ${plural(batchCount, 'iteration')} → ${plural(promptCount * batchCount, 'generation')}`diff --git a/invokeai/frontend/webv2/src/workbench/shell/topbar/IterationsField.tsx b/invokeai/frontend/webv2/src/workbench/shell/topbar/IterationsField.tsxindex 656863fc0c..914866cea9 100644--- a/invokeai/frontend/webv2/src/workbench/shell/topbar/IterationsField.tsx+++ b/invokeai/frontend/webv2/src/workbench/shell/topbar/IterationsField.tsx@@ -19,7 +19,7 @@ export const IterationsField = () => {const { batchCount, sourceId } = useActiveProjectSelector((project) => {const sourceId = project.invocation.sourceId;- const typeId = sourceId === 'upscale' ? 'upscale' : 'generate';+ const typeId = sourceId === 'upscale' ? 'upscale' : sourceId === 'video' ? 'video' : 'generate';const instance = Object.values(project.widgetInstances).find((candidate) => candidate.typeId === typeId);return { batchCount: getBatchCount(instance?.state.values ?? {}), sourceId };@@ -33,8 +33,8 @@ export const IterationsField = () => {return;}- if (sourceId === 'upscale') {- widgets.patchValues('upscale', { batchCount: valueAsNumber });+ if (sourceId === 'upscale' || sourceId === 'video') {+ widgets.patchValues(sourceId, { batchCount: valueAsNumber });} else {generation.setBatchCount(valueAsNumber);}diff --git a/invokeai/frontend/webv2/src/workbench/shell/topbar/useInvocationState.ts b/invokeai/frontend/webv2/src/workbench/shell/topbar/useInvocationState.tsindex 8d48095903..fb24814f45 100644--- a/invokeai/frontend/webv2/src/workbench/shell/topbar/useInvocationState.ts+++ b/invokeai/frontend/webv2/src/workbench/shell/topbar/useInvocationState.ts@@ -83,7 +83,12 @@ export const useInvocationState = (): InvocationState => {const resolvedRoute = resolveInvocationRouteInput(routeInput, 'global', invocation, availabilityModels);const isConnected = backendConnectionStatus === 'connected';- const sourceValues = invocation.sourceId === 'upscale' ? routeInput.upscaleValues : routeInput.generateValues;+ const sourceValues =+ invocation.sourceId === 'upscale'+ ? routeInput.upscaleValues+ : invocation.sourceId === 'video'+ ? routeInput.videoValues+ : routeInput.generateValues;const promptExpansion = useDynamicPrompts(readEffectivePositivePrompt(routeInput.generateValues),diff --git a/invokeai/frontend/webv2/src/workbench/widget-frame/graphPreviewSource.ts b/invokeai/frontend/webv2/src/workbench/widget-frame/graphPreviewSource.tsindex ac322d63a0..2828cca9d5 100644--- a/invokeai/frontend/webv2/src/workbench/widget-frame/graphPreviewSource.ts+++ b/invokeai/frontend/webv2/src/workbench/widget-frame/graphPreviewSource.ts@@ -148,6 +148,7 @@ export const buildGraphPreviewSource = ({case 'generate':return { ...buildGenerateSource(project, models, t), destinationLabel };case 'upscale':+ case 'video':case 'canvas':return { ...buildWidgetGraphSource(project, surface), destinationLabel };}diff --git a/invokeai/frontend/webv2/src/workbench/widgetContracts.ts b/invokeai/frontend/webv2/src/workbench/widgetContracts.tsindex 7053ff69d0..f810e800e2 100644--- a/invokeai/frontend/webv2/src/workbench/widgetContracts.ts+++ b/invokeai/frontend/webv2/src/workbench/widgetContracts.ts@@ -23,6 +23,7 @@ export type FirstPartyWidgetTypeId =| 'queue-status'| 'server-status'| 'upscale'+ | 'video'| 'users'| 'version-status'| 'workflow';diff --git a/invokeai/frontend/webv2/src/workbench/widgetRegistry.test.ts b/invokeai/frontend/webv2/src/workbench/widgetRegistry.test.tsindex d9c7d380af..68b49d9775 100644--- a/invokeai/frontend/webv2/src/workbench/widgetRegistry.test.ts+++ b/invokeai/frontend/webv2/src/workbench/widgetRegistry.test.ts@@ -32,7 +32,7 @@ describe('widget registry', () => {it('registers first-party widget manifests without icon validation failures', () => {const widgets = registerFirstPartyWidgets();- expect(widgets).toHaveLength(16);+ expect(widgets).toHaveLength(17);expect(widgets.flatMap((widget) => widget.failure ?? [])).toEqual([]);expect(widgets.every((widget) => widget.status === 'enabled')).toBe(true);});diff --git a/invokeai/frontend/webv2/src/workbench/widgetRegistry.ts b/invokeai/frontend/webv2/src/workbench/widgetRegistry.tsindex 41b1a54ff9..18973281dd 100644--- a/invokeai/frontend/webv2/src/workbench/widgetRegistry.ts+++ b/invokeai/frontend/webv2/src/workbench/widgetRegistry.ts@@ -26,12 +26,14 @@ import { queueWidgetManifest } from './widgets/queue/manifest';import { serverStatusWidgetManifest } from './widgets/server-status/manifest';import { upscaleWidgetManifest } from './widgets/upscale/manifest';import { versionStatusWidgetManifest } from './widgets/version-status/manifest';+import { videoWidgetManifest } from './widgets/video/manifest';import { workflowWidgetManifest } from './widgets/workflow/manifest';export const firstPartyWidgetManifests: WidgetManifest[] = [generateWidgetManifest,workflowWidgetManifest,upscaleWidgetManifest,+ videoWidgetManifest,canvasWidgetManifest,diagnosticsWidgetManifest,galleryWidgetManifest,diff --git a/invokeai/frontend/webv2/src/workbench/widgets/video/manifest.ts b/invokeai/frontend/webv2/src/workbench/widgets/video/manifest.tsnew file mode 100644index 0000000000..1138f539a2--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/widgets/video/manifest.ts@@ -0,0 +1,15 @@+import type { WidgetManifest } from '@workbench/widgetContracts';++import { ClapperboardIcon } from 'lucide-react';++export const videoWidgetManifest: WidgetManifest = {+ allowMultiple: false,+ allowedRegions: ['left'],+ failurePolicy: { isolateRenderFailure: true, onRegistrationFailure: 'disable' },+ graphBearing: { defaultGraphId: 'video-graph', sourceId: 'video', surfaces: ['left'] },+ icon: ClapperboardIcon,+ id: 'video',+ label: (t) => t('widgets.labels.video'),+ load: () => import('@features/video/widget').then((module) => module.widgetImplementation),+ version: 1,+};diff --git a/invokeai/frontend/webv2/src/workbench/workbenchState.test.ts b/invokeai/frontend/webv2/src/workbench/workbenchState.test.tsindex be16fc3c23..c352bb9af3 100644--- a/invokeai/frontend/webv2/src/workbench/workbenchState.test.ts+++ b/invokeai/frontend/webv2/src/workbench/workbenchState.test.ts@@ -459,7 +459,7 @@ describe('workbench widget region defaults', () => {const state = createInitialWorkbenchState();const project = getActiveProject(state);- expect(project.widgetRegions.left.instanceIds).toEqual(['generate', 'upscale']);+ expect(project.widgetRegions.left.instanceIds).toEqual(['generate', 'upscale', 'video']);expect(project.widgetRegions.right.instanceIds).toEqual(['gallery', 'image-map', 'queue']);expect(project.widgetRegions.bottom.instanceIds).toEqual(['server-status',@@ -565,7 +565,12 @@ describe('workbench widget region defaults', () => {type: 'hydrateWorkbench',});- expect(getActiveProject(migrated).widgetRegions.left.instanceIds).toEqual(['generate', 'workflow', 'upscale']);+ expect(getActiveProject(migrated).widgetRegions.left.instanceIds).toEqual([+ 'generate',+ 'workflow',+ 'upscale',+ 'video',+ ]);expect(getActiveProject(migrated).widgetInstances.upscale?.typeId).toBe('upscale');expect(getActiveProject(customized).widgetRegions.left.instanceIds).toEqual(['generate', 'gallery']);});@@ -1070,7 +1075,7 @@ describe('workbench layout presets', () => {expect(project.layout.panels).toEqual({ isBottomOpen: false, isLeftOpen: true, isRightOpen: true });expect(project.widgetRegions.left).toMatchObject({activeInstanceId: 'generate',- instanceIds: ['generate', 'upscale'],+ instanceIds: ['generate', 'upscale', 'video'],isCollapsed: false,sizePx: 450,});diff --git a/invokeai/frontend/webv2/src/workbench/workbenchState.ts b/invokeai/frontend/webv2/src/workbench/workbenchState.tsindex 2a3c9b9180..a2c1e24172 100644--- a/invokeai/frontend/webv2/src/workbench/workbenchState.ts+++ b/invokeai/frontend/webv2/src/workbench/workbenchState.ts@@ -78,6 +78,7 @@ import {isHighConfidenceGenerateEdit,isHighConfidenceGraphEdit,isHighConfidenceUpscaleEdit,+ isHighConfidenceVideoEdit,type CanvasEditIntent,type WorkbenchActionOrigin,} from './autoRoutePolicy';@@ -115,6 +116,16 @@ import {syncUpscaleWidgetValuesWithModels,type UpscaleWidgetValues,} from '@features/upscale';+import {+ cloneVideoWidgetValues,+ compileVideoGraph,+ getVideoDimensions,+ getVideoWidgetValidationReasons,+ normalizeVideoWidgetValues,+ resolveVideoSeed,+ syncVideoWidgetValuesWithModels,+ type VideoWidgetValues,+} from '@features/video';import { compileProjectGraph } from '@features/workflow/graph';import { getInvocationTemplatesSnapshot } from '@features/workflow/react';import {@@ -239,7 +250,7 @@ type WorkbenchReducerAction =| {type: 'patchProjectPromptDraft';values: ProjectPromptDraftPatch;- sourceId: 'generate' | 'upscale';+ sourceId: 'generate' | 'upscale' | 'video';projectId?: string;origin?: WorkbenchActionOrigin;}@@ -1226,6 +1237,7 @@ const createWidgetStates = (): WidgetStateMap => ({'version-status': { id: 'version-status', label: 'Version', values: {}, version: 1 },workflow: { graphId: 'workflow-graph', id: 'workflow', label: 'Workflow', values: {}, version: 1 },upscale: { graphId: 'upscale-graph', id: 'upscale', label: 'Upscale', values: {}, version: 1 },+ video: { graphId: 'video-graph', id: 'video', label: 'Video', values: {}, version: 1 },});const createWidgetState = (widgetId: WidgetTypeId): WidgetStateContract =>@@ -1260,6 +1272,7 @@ const defaultWidgetInstanceTypes: Record<WidgetInstanceId, WidgetTypeId> = {generate: 'generate','image-map': 'image-map',upscale: 'upscale',+ video: 'video',layers: 'layers',notifications: 'notifications',preview: 'preview',@@ -1290,31 +1303,54 @@ const LEGACY_DEFAULT_LEFT_REGION_WIDGET_IDS: readonly WidgetInstanceId[][] = [['generate', 'workflow', 'gallery'],];+// Every left rail shipped as a default between the Upscale and Video widgets+// (including pre-upscale defaults after the splice above normalizes them).+const PRE_VIDEO_DEFAULT_LEFT_REGION_WIDGET_IDS: readonly WidgetInstanceId[][] = [+ ['generate', 'upscale'],+ ['generate', 'workflow', 'upscale'],+ ['workflow', 'generate', 'upscale'],+ ['generate', 'workflow', 'upscale', 'gallery'],+];+const ensureLeftRegion = (leftRegion: WidgetRegionState | undefined): WidgetRegionState => {const fallback = createWidgetRegions().left;if (!leftRegion) {return fallback;}- if (leftRegion.instanceIds.includes('upscale')) {- return leftRegion;- }+ let region = leftRegion;- const legacyMatch = LEGACY_DEFAULT_LEFT_REGION_WIDGET_IDS.some(- (ids) =>- ids.length === leftRegion.instanceIds.length && ids.every((id, index) => leftRegion.instanceIds[index] === id)- );+ if (!region.instanceIds.includes('upscale')) {+ const legacyMatch = LEGACY_DEFAULT_LEFT_REGION_WIDGET_IDS.some(+ (ids) => ids.length === region.instanceIds.length && ids.every((id, index) => region.instanceIds[index] === id)+ );++ if (legacyMatch) {+ const galleryIndex = region.instanceIds.indexOf('gallery');+ const instanceIds = [...region.instanceIds];- if (!legacyMatch) {- return leftRegion;+ instanceIds.splice(galleryIndex === -1 ? instanceIds.length : galleryIndex, 0, 'upscale');+ region = { ...region, instanceIds };+ }}- const galleryIndex = leftRegion.instanceIds.indexOf('gallery');- const instanceIds = [...leftRegion.instanceIds];+ // Same treatment for rails persisted before the Video widget shipped: only a+ // rail that exactly matches a shipped default (after the upscale splice above)+ // adopts it — a customized rail is left alone.+ if (region.instanceIds.includes('upscale') && !region.instanceIds.includes('video')) {+ const preVideoMatch = PRE_VIDEO_DEFAULT_LEFT_REGION_WIDGET_IDS.some(+ (ids) => ids.length === region.instanceIds.length && ids.every((id, index) => region.instanceIds[index] === id)+ );- instanceIds.splice(galleryIndex === -1 ? instanceIds.length : galleryIndex, 0, 'upscale');+ if (preVideoMatch) {+ const instanceIds = [...region.instanceIds];- return { ...leftRegion, instanceIds };+ instanceIds.splice(instanceIds.indexOf('upscale') + 1, 0, 'video');+ region = { ...region, instanceIds };+ }+ }++ return region;};// Every right rail this app has shipped as a default. A project persisted with@@ -1628,6 +1664,9 @@ export const normalizeWorkbenchProject = (project: Project): Project => {if (leftRegion.instanceIds.includes('upscale') && !widgetInstances.upscale) {widgetInstances.upscale = createWidgetInstance('upscale');}+ if (leftRegion.instanceIds.includes('video') && !widgetInstances.video) {+ widgetInstances.video = createWidgetInstance('video');+ }if (bottomRegion.instanceIds.includes('queue-status') && !widgetInstances['queue-status']) {widgetInstances['queue-status'] = createWidgetInstance('queue-status');@@ -2302,6 +2341,35 @@ const compileInvocationSnapshot = (return { graph: compiledGraph, widgetStates };}+ if (route.sourceId === 'video') {+ const values = normalizeVideoWidgetValues(getWidgetValues(project, 'video'));++ if (!values) {+ return null;+ }++ const syncedValues = models ? syncVideoWidgetValuesWithModels(values, models) : values;+ const currentValues: VideoWidgetValues = {+ ...syncedValues,+ ...getPromptDraftFromValues(getProjectWidgetValues(project, 'generate')),+ };++ if (!currentValues.model || getVideoWidgetValidationReasons(currentValues, models).length > 0) {+ return null;+ }++ const resolvedValues: VideoWidgetValues = { ...currentValues, seed: resolveVideoSeed(currentValues) };+ const compiledGraph = compileVideoGraph(resolvedValues, currentValues.model).graph;++ widgetStates.video = {+ ...widgetStates.video,+ graphId: compiledGraph.id,+ values: { ...cloneVideoWidgetValues(resolvedValues) },+ };++ return { graph: compiledGraph, widgetStates };+ }+if (route.sourceId !== 'generate') {const widgetGraph = project.widgetGraphs[route.sourceId as WidgetTypeId];@@ -2828,6 +2896,7 @@ const enqueueCompiledSnapshot = (route.sourceId === 'generate' ? normalizeGenerateSettings(widgetStates.generate.values) : null;const upscaleSettings =route.sourceId === 'upscale' ? normalizeUpscaleWidgetValues(widgetStates.upscale.values) : null;+ const videoSettings = route.sourceId === 'video' ? normalizeVideoWidgetValues(widgetStates.video.values) : null;const backendGraph = graph.backendGraph;const canvasGenerateSettings = route.sourceId === 'canvas' ? normalizeGenerateSettings(generate?.values) : null;const sourceGenerateSettings =@@ -2837,7 +2906,9 @@ const enqueueCompiledSnapshot = (? generateSettings: route.sourceId === 'upscale'? upscaleSettings- : null;+ : route.sourceId === 'video'+ ? videoSettings+ : null;// The prompts that actually generate: the authored text wrapped by the active// prompt template. Computed once here because this is the only place every// Generate-shaped route converges — `generate` and `canvas` both land here, as@@ -2856,6 +2927,7 @@ const enqueueCompiledSnapshot = (// authored prompt never had, and the caller expanded the merged text too.const expandedPositivePrompts =route.sourceId !== 'upscale' &&+ route.sourceId !== 'video' &&compiled.positivePrompts &&compiled.positivePrompts.length > 0 &&effectivePrompts &&@@ -2901,13 +2973,17 @@ const enqueueCompiledSnapshot = (: { error: `${route.sourceId} queue item is missing source submission metadata.`, kind: 'invalid' };const selectedGalleryBoardId = widgetStates.gallery?.values.selectedBoardId;const generatePresentationSettings = normalizeGenerateSettings(widgetStates.generate?.values);+ const videoPresentationDimensions =+ route.sourceId === 'video' && videoSettings?.model ? getVideoDimensions(videoSettings.model, videoSettings) : null;const presentationDimensions =route.sourceId === 'upscale' && upscaleSettings?.inputImage? getUpscaleOutputDimensions(upscaleSettings.inputImage, upscaleSettings.scale)- : {- height: generatePresentationSettings?.height ?? project.canvas.document.height,- width: generatePresentationSettings?.width ?? project.canvas.document.width,- };+ : videoPresentationDimensions+ ? videoPresentationDimensions+ : {+ height: generatePresentationSettings?.height ?? project.canvas.document.height,+ width: generatePresentationSettings?.width ?? project.canvas.document.width,+ };const queueItem: QueueItem = {cancellable: backendSupportsCancellation,id: queueItemId,@@ -2937,7 +3013,9 @@ const enqueueCompiledSnapshot = (? { resultNodeIds: ['canvas_output'] }: route.sourceId === 'upscale'? { resultNodeIds: ['upscale_output'] }- : {}),+ : route.sourceId === 'video'+ ? { resultNodeIds: ['video_output'] }+ : {}),submittedAt,widgetInstances: cloneQueueWidgetInstances(project.widgetInstances),widgetStates,@@ -2965,7 +3043,12 @@ const enqueueCompiledSnapshot = (negativePrompt: upscaleSettings.negativePromptEnabled ? upscaleSettings.negativePrompt : null,positivePrompt: upscaleSettings.positivePrompt,})- : project.promptHistory,+ : videoSettings+ ? addPromptHistoryItem(project.promptHistory, {+ negativePrompt: videoSettings.negativePromptEnabled ? videoSettings.negativePrompt : null,+ positivePrompt: videoSettings.positivePrompt,+ })+ : project.promptHistory,invocation: {...project.invocation,destination: route.destination,@@ -2974,7 +3057,7 @@ const enqueueCompiledSnapshot = (},queue: { items: [queueItem, ...project.queue.items] },widgetGraphs:- route.sourceId === 'generate' || route.sourceId === 'upscale'+ route.sourceId === 'generate' || route.sourceId === 'upscale' || route.sourceId === 'video'? { ...project.widgetGraphs, [route.sourceId]: cloneGraph(graph) }: project.widgetGraphs,};@@ -3682,7 +3765,7 @@ export const __workbenchReducerInternal = (return action.sourceId === 'generate'? applyAutoRouteForGenerateEdit(updated, context)- : applyAutoRouteForEdit(updated, 'upscale', context);+ : applyAutoRouteForEdit(updated, action.sourceId, context);});}case 'setGenerateBatchCount': {@@ -3731,6 +3814,9 @@ export const __workbenchReducerInternal = (if (action.widgetId === 'upscale' && isHighConfidenceUpscaleEdit(changedKeys)) {return applyAutoRouteForEdit(updated, 'upscale', context);}+ if (action.widgetId === 'video' && isHighConfidenceVideoEdit(changedKeys)) {+ return applyAutoRouteForEdit(updated, 'video', context);+ }return updated;});