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.

chore(webv2): graph preview gate fixes

joshistoast53f6b3aed4b1
diff --git a/invokeai/frontend/webv2/performance/architecture-baseline.json b/invokeai/frontend/webv2/performance/architecture-baseline.json
index 128ffcac8f..5a5aba4a92 100644
--- a/invokeai/frontend/webv2/performance/architecture-baseline.json
+++ b/invokeai/frontend/webv2/performance/architecture-baseline.json
@@ -2,15 +2,15 @@
"build": {
"launchpad": {
"baseline": {
- "brotliBytes": 832515,
+ "brotliBytes": 832702,
"cssRawBytes": 2159,
"fontRawBytes": 219480,
- "gzipBytes": 832512,
+ "gzipBytes": 832559,
"imageRawBytes": 156376,
- "initialRawBytes": 1935597,
+ "initialRawBytes": 1936020,
"largestAssetRawBytes": 746305,
"otherAssetRawBytes": 0,
- "ownedRawBytes": 67495,
+ "ownedRawBytes": 67431,
"requestCount": 41,
"scriptRequestCount": 25,
"sourceOwners": [
@@ -282,15 +282,15 @@
]
},
"limits": {
- "brotliBytes": 840841,
+ "brotliBytes": 841030,
"cssRawBytes": 2181,
"fontRawBytes": 221675,
- "gzipBytes": 840838,
+ "gzipBytes": 840885,
"imageRawBytes": 157940,
- "initialRawBytes": 1954953,
+ "initialRawBytes": 1955381,
"largestAssetRawBytes": 753769,
"otherAssetRawBytes": 0,
- "ownedRawBytes": 67495,
+ "ownedRawBytes": 67431,
"requestCount": 41,
"scriptRequestCount": 25
},
@@ -300,17 +300,17 @@
},
"editor": {
"baseline": {
- "brotliBytes": 1033960,
+ "brotliBytes": 1031938,
"cssRawBytes": 2159,
"fontRawBytes": 219480,
- "gzipBytes": 1031462,
+ "gzipBytes": 1029350,
"imageRawBytes": 156376,
- "initialRawBytes": 2535652,
+ "initialRawBytes": 2531198,
"largestAssetRawBytes": 746305,
"otherAssetRawBytes": 0,
- "ownedRawBytes": 112488,
- "requestCount": 94,
- "scriptRequestCount": 78,
+ "ownedRawBytes": 112432,
+ "requestCount": 92,
+ "scriptRequestCount": 76,
"sourceOwners": [
"package:@ark-ui/react",
"package:@chakra-ui/react",
@@ -587,12 +587,10 @@
"source:src/features/workflow/core/document.ts",
"source:src/features/workflow/core/fields.ts",
"source:src/features/workflow/core/graphIndex.ts",
- "source:src/features/workflow/core/layerWorkflow.ts",
"source:src/features/workflow/core/types.ts",
"source:src/features/workflow/core/validation.ts",
"source:src/features/workflow/core/workflowJson.ts",
"source:src/features/workflow/data/templates.ts",
- "source:src/features/workflow/graph.ts",
"source:src/features/workflow/react.ts",
"source:src/features/workflow/ui/WorkflowUiContext.tsx",
"source:src/features/workflow/ui/workflowUiStore.ts",
@@ -842,17 +840,17 @@
]
},
"limits": {
- "brotliBytes": 1044300,
+ "brotliBytes": 1042258,
"cssRawBytes": 2181,
"fontRawBytes": 221675,
- "gzipBytes": 1041777,
+ "gzipBytes": 1039644,
"imageRawBytes": 157940,
- "initialRawBytes": 2561009,
+ "initialRawBytes": 2556510,
"largestAssetRawBytes": 753769,
"otherAssetRawBytes": 0,
- "ownedRawBytes": 112488,
- "requestCount": 94,
- "scriptRequestCount": 78
+ "ownedRawBytes": 112432,
+ "requestCount": 92,
+ "scriptRequestCount": 76
},
"owner": "workbench",
"remediationTicket": "deepen-widget-registry-loading",
diff --git a/invokeai/frontend/webv2/src/architecture/featureInterfaces.ts b/invokeai/frontend/webv2/src/architecture/featureInterfaces.ts
index 76591f2dda..3797c0ce24 100644
--- a/invokeai/frontend/webv2/src/architecture/featureInterfaces.ts
+++ b/invokeai/frontend/webv2/src/architecture/featureInterfaces.ts
@@ -6,7 +6,18 @@
*/
export const FEATURE_PUBLIC_INTERFACES: Readonly<Record<string, readonly string[]>> = {
gallery: ['contracts', 'launchpad', 'paletteSearch', 'queries', 'react', 'utility', 'widget'],
- generation: ['components', 'contracts', 'graph', 'prompts', 'queries', 'react', 'runtime', 'settings', 'widget'],
+ generation: [
+ 'components',
+ 'contracts',
+ 'graph',
+ 'preview',
+ 'prompts',
+ 'queries',
+ 'react',
+ 'runtime',
+ 'settings',
+ 'widget',
+ ],
identity: [],
models: ['launchpad', 'react'],
nodes: [],
diff --git a/invokeai/frontend/webv2/src/features/generation/graph.ts b/invokeai/frontend/webv2/src/features/generation/graph.ts
index 5109e5752d..3cc9edc737 100644
--- a/invokeai/frontend/webv2/src/features/generation/graph.ts
+++ b/invokeai/frontend/webv2/src/features/generation/graph.ts
@@ -4,10 +4,6 @@
* Curated, caller-driven export list — add a symbol only when a consumer needs it.
*/
export { addLoraCollectionLoader, compileGenerateGraph, resolveGenerateSeed } from './core/graph';
-export { compileGeneratePreviewGraph, stabilizeBackendGraphIds } from './core/previewGraph';
-export type { GeneratePreviewInput, GeneratePreviewResult } from './core/previewGraph';
-export { getGenerateNodeProvenance } from './core/graphProvenance';
-export type { GenerateProvenanceEntry } from './core/graphProvenance';
export { addEdge, addNode, getActiveCompatibleLoras, toGraphContract, toModelIdentifier } from './core/graphBuilder';
export { compileCanvasGraph } from './core/canvas/compileCanvasGraph';
export { detectCanvasMode } from './core/canvas/canvasMode';
diff --git a/invokeai/frontend/webv2/src/features/generation/preview.ts b/invokeai/frontend/webv2/src/features/generation/preview.ts
new file mode 100644
index 0000000000..1c493277c2
--- /dev/null
+++ b/invokeai/frontend/webv2/src/features/generation/preview.ts
@@ -0,0 +1,10 @@
+/**
+ * Generation's preview-only public surface, kept separate from `graph.ts` so
+ * consumers behind a lazy chunk boundary (the graph preview dialog) never
+ * pull the preview compiler into `graph.ts`'s eager importers — mirrors
+ * `@features/workflow/preview`.
+ */
+export { compileGeneratePreviewGraph, stabilizeBackendGraphIds } from './core/previewGraph';
+export type { GeneratePreviewInput, GeneratePreviewResult } from './core/previewGraph';
+export { getGenerateNodeProvenance } from './core/graphProvenance';
+export type { GenerateProvenanceEntry } from './core/graphProvenance';
diff --git a/invokeai/frontend/webv2/src/workbench/widget-frame/graphPreviewSource.ts b/invokeai/frontend/webv2/src/workbench/widget-frame/graphPreviewSource.ts
index 609fdb028d..ac322d63a0 100644
--- a/invokeai/frontend/webv2/src/workbench/widget-frame/graphPreviewSource.ts
+++ b/invokeai/frontend/webv2/src/workbench/widget-frame/graphPreviewSource.ts
@@ -11,7 +11,7 @@ import type { Project } from '@workbench/projectContracts';
import type { GraphBearingSurfaceContract } from '@workbench/widgetContracts';
import type { TFunction } from 'i18next';
-import { compileGeneratePreviewGraph, getGenerateNodeProvenance } from '@features/generation/graph';
+import { compileGeneratePreviewGraph, getGenerateNodeProvenance } from '@features/generation/preview';
import { compileProjectGraph } from '@features/workflow/graph';
import { getDestinationLabel } from '@workbench/invocation';
import { getProjectWidgetValues } from '@workbench/widgetState';