Skip to content

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.

feat(workbench): the Video widget ships only with the Video preset

Josh Corbettc18ec1d1eec5
diff --git a/invokeai/frontend/webv2/src/workbench/layoutPresets.test.ts b/invokeai/frontend/webv2/src/workbench/layoutPresets.test.ts
index 80fd7352d4..d0af3f0ca8 100644
--- a/invokeai/frontend/webv2/src/workbench/layoutPresets.test.ts
+++ b/invokeai/frontend/webv2/src/workbench/layoutPresets.test.ts
@@ -107,7 +107,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', 'video'],
+ left: ['generate', 'upscale'],
panels: { isBottomOpen: false, isLeftOpen: true, isRightOpen: true },
right: ['gallery', 'image-map', 'queue'],
},
@@ -120,7 +120,7 @@ describe('built-in layout preset descriptors', () => {
},
bottom: ['server-status', 'queue-status', 'gallery:bottom', 'notifications', 'autosave-status'],
center: ['canvas', 'preview'],
- left: ['generate', 'upscale', 'video'],
+ left: ['generate', 'upscale'],
panels: { isBottomOpen: false, isLeftOpen: true, isRightOpen: true },
// The Edit rail is the Layers panel alone; its editors are panes inside it.
right: ['layers'],
diff --git a/invokeai/frontend/webv2/src/workbench/layoutPresets.ts b/invokeai/frontend/webv2/src/workbench/layoutPresets.ts
index dd032fcf1d..e7fcf628e1 100644
--- a/invokeai/frontend/webv2/src/workbench/layoutPresets.ts
+++ b/invokeai/frontend/webv2/src/workbench/layoutPresets.ts
@@ -173,7 +173,7 @@ export const builtInLayoutPresetDescriptors: BuiltInLayoutPresetDescriptor[] = [
}),
left: createRegion({
activeInstanceId: 'generate',
- instanceIds: ['generate', 'upscale', 'video'],
+ instanceIds: ['generate', 'upscale'],
sizePx: 450,
}),
right: createRegion({
@@ -206,7 +206,7 @@ export const builtInLayoutPresetDescriptors: BuiltInLayoutPresetDescriptor[] = [
}),
left: createRegion({
activeInstanceId: 'generate',
- instanceIds: ['generate', 'upscale', 'video'],
+ instanceIds: ['generate', 'upscale'],
sizePx: 450,
}),
right: createRegion({
diff --git a/invokeai/frontend/webv2/src/workbench/queue-integration/localQueueItemSource.test.ts b/invokeai/frontend/webv2/src/workbench/queue-integration/localQueueItemSource.test.ts
index 076f3b2614..8478d4faec 100644
--- a/invokeai/frontend/webv2/src/workbench/queue-integration/localQueueItemSource.test.ts
+++ b/invokeai/frontend/webv2/src/workbench/queue-integration/localQueueItemSource.test.ts
@@ -33,6 +33,8 @@ const wanModel: ModelConfig = {
const submitVideo = () => {
let state = createInitialWorkbenchState();
+ // Video is no longer placed by the non-video defaults; add it first.
+ state = workbenchReducer(state, { region: 'left', type: 'toggleRegionWidget', widgetId: 'video' });
state = workbenchReducer(state, {
type: 'patchWidgetValues',
values: { model: wanModel, positivePrompt: 'a fox running' },
diff --git a/invokeai/frontend/webv2/src/workbench/workbenchState.test.ts b/invokeai/frontend/webv2/src/workbench/workbenchState.test.ts
index 11717fbc19..c4283b1e89 100644
--- a/invokeai/frontend/webv2/src/workbench/workbenchState.test.ts
+++ b/invokeai/frontend/webv2/src/workbench/workbenchState.test.ts
@@ -476,7 +476,7 @@ describe('workbench widget region defaults', () => {
const state = createInitialWorkbenchState();
const project = getActiveProject(state);
- expect(project.widgetRegions.left.instanceIds).toEqual(['generate', 'upscale', 'video']);
+ expect(project.widgetRegions.left.instanceIds).toEqual(['generate', 'upscale']);
expect(project.widgetRegions.right.instanceIds).toEqual(['gallery', 'image-map', 'queue']);
expect(project.widgetRegions.bottom.instanceIds).toEqual([
'server-status',
@@ -612,12 +612,9 @@ describe('workbench widget region defaults', () => {
type: 'hydrateWorkbench',
});
- expect(getActiveProject(migrated).widgetRegions.left.instanceIds).toEqual([
- 'generate',
- 'workflow',
- 'upscale',
- 'video',
- ]);
+ // No Video adoption any more: the curated defaults exclude it, so the
+ // legacy splice adds Upscale alone.
+ expect(getActiveProject(migrated).widgetRegions.left.instanceIds).toEqual(['generate', 'workflow', 'upscale']);
expect(getActiveProject(migrated).widgetInstances.upscale?.typeId).toBe('upscale');
expect(getActiveProject(customized).widgetRegions.left.instanceIds).toEqual(['generate', 'gallery']);
});
@@ -1316,7 +1313,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', 'video'],
+ instanceIds: ['generate', 'upscale'],
isCollapsed: false,
sizePx: 450,
});
@@ -3233,6 +3230,8 @@ describe('workbenchReducer Phase 5 generation flow', () => {
};
let state = createInitialWorkbenchState();
+ // Video is no longer placed by the non-video defaults; add it first.
+ state = workbenchReducer(state, { region: 'left', type: 'toggleRegionWidget', widgetId: 'video' });
state = workbenchReducer(state, {
sourceId: 'generate',
type: 'patchProjectPromptDraft',
diff --git a/invokeai/frontend/webv2/src/workbench/workbenchState.ts b/invokeai/frontend/webv2/src/workbench/workbenchState.ts
index ede30a01b1..118e6bc973 100644
--- a/invokeai/frontend/webv2/src/workbench/workbenchState.ts
+++ b/invokeai/frontend/webv2/src/workbench/workbenchState.ts
@@ -1370,15 +1370,6 @@ 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;
@@ -1401,21 +1392,9 @@ const ensureLeftRegion = (leftRegion: WidgetRegionState | undefined): WidgetRegi
}
}
- // 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)
- );
-
- if (preVideoMatch) {
- const instanceIds = [...region.instanceIds];
-
- instanceIds.splice(instanceIds.indexOf('upscale') + 1, 0, 'video');
- region = { ...region, instanceIds };
- }
- }
+ // The Video widget is deliberately absent from the non-video defaults now,
+ // so nothing backfills it any more; it lives in the Video preset and stays
+ // addable everywhere.
return region;
};
diff --git a/invokeai/frontend/webv2/src/workbench/workbenchStateAutoRoute.test.ts b/invokeai/frontend/webv2/src/workbench/workbenchStateAutoRoute.test.ts
index 16cec9fba4..7cdd2f29d2 100644
--- a/invokeai/frontend/webv2/src/workbench/workbenchStateAutoRoute.test.ts
+++ b/invokeai/frontend/webv2/src/workbench/workbenchStateAutoRoute.test.ts
@@ -150,6 +150,9 @@ describe('auto invocation route switching on widget reveal', () => {
it('leaves the route alone when a background tab is closed', () => {
let state = createInitialWorkbenchState();
+ // Place Video (defaults no longer carry it), then push it to the background.
+ state = workbenchReducer(state, { region: 'left', type: 'toggleRegionWidget', widgetId: 'video' });
+ state = workbenchReducer(state, { region: 'left', type: 'selectRegionWidget', widgetId: 'generate' });
state = workbenchReducer(state, { sourceId: 'workflow', type: 'setInvocationSource' });
// `video` is not the front tab, so closing it reveals nothing.
state = workbenchReducer(state, { region: 'left', type: 'toggleRegionWidget', widgetId: 'video' });
@@ -161,7 +164,8 @@ describe('auto invocation route switching on widget reveal', () => {
it('follows the tab promoted when the front tab is closed', () => {
let state = createInitialWorkbenchState();
- state = workbenchReducer(state, { region: 'left', type: 'selectRegionWidget', widgetId: 'video' });
+ // Placing Video reveals it, which is also the route-follow being tested.
+ state = workbenchReducer(state, { region: 'left', type: 'toggleRegionWidget', widgetId: 'video' });
expect(getInvocation(state)).toMatchObject({ sourceId: 'video' });
@@ -269,6 +273,8 @@ describe('auto invocation route switching on widget reveal', () => {
it('follows a widget floated out, raised, or docked back', () => {
let state = createInitialWorkbenchState();
+ state = workbenchReducer(state, { region: 'left', type: 'toggleRegionWidget', widgetId: 'video' });
+ state = workbenchReducer(state, { region: 'left', type: 'selectRegionWidget', widgetId: 'generate' });
state = workbenchReducer(state, { instanceId: 'video', type: 'floatWidget' });
expect(getInvocation(state)).toMatchObject({ destination: 'gallery', sourceId: 'video' });