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.

refactor(webv2): say once which settings are arrangement, not intent

joshistoaste32af78cb7bc
diff --git a/invokeai/frontend/webv2/performance/architecture-baseline.json b/invokeai/frontend/webv2/performance/architecture-baseline.json
index 1e333ccfb9..8f8b827a81 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": 798478,
+ "brotliBytes": 798414,
"cssRawBytes": 2159,
"fontRawBytes": 219480,
- "gzipBytes": 798624,
+ "gzipBytes": 798574,
"imageRawBytes": 156376,
- "initialRawBytes": 1832637,
+ "initialRawBytes": 1832589,
"largestAssetRawBytes": 737748,
"otherAssetRawBytes": 0,
- "ownedRawBytes": 57830,
+ "ownedRawBytes": 57782,
"requestCount": 31,
"scriptRequestCount": 15,
"sourceOwners": [
@@ -239,15 +239,15 @@
]
},
"limits": {
- "brotliBytes": 806463,
+ "brotliBytes": 806399,
"cssRawBytes": 2181,
"fontRawBytes": 221675,
- "gzipBytes": 806611,
+ "gzipBytes": 806560,
"imageRawBytes": 157940,
- "initialRawBytes": 1850964,
+ "initialRawBytes": 1850915,
"largestAssetRawBytes": 745126,
"otherAssetRawBytes": 0,
- "ownedRawBytes": 57830,
+ "ownedRawBytes": 57782,
"requestCount": 31,
"scriptRequestCount": 15
},
@@ -257,17 +257,17 @@
},
"editor": {
"baseline": {
- "brotliBytes": 975403,
+ "brotliBytes": 975461,
"cssRawBytes": 2159,
"fontRawBytes": 219480,
- "gzipBytes": 974277,
+ "gzipBytes": 974331,
"imageRawBytes": 156376,
- "initialRawBytes": 2369740,
+ "initialRawBytes": 2370128,
"largestAssetRawBytes": 737748,
"otherAssetRawBytes": 0,
- "ownedRawBytes": 108562,
- "requestCount": 75,
- "scriptRequestCount": 59,
+ "ownedRawBytes": 108460,
+ "requestCount": 74,
+ "scriptRequestCount": 58,
"sourceOwners": [
"package:@ark-ui/react",
"package:@chakra-ui/react",
@@ -418,6 +418,7 @@
"source:src/features/generation/core/canvas/compileCanvasGraph.ts",
"source:src/features/generation/core/canvas/controlValidation.ts",
"source:src/features/generation/core/canvas/types.ts",
+ "source:src/features/generation/core/catalogSearch.ts",
"source:src/features/generation/core/componentCompatibility.ts",
"source:src/features/generation/core/dynamicPrompts.ts",
"source:src/features/generation/core/graph.ts",
@@ -733,17 +734,17 @@
]
},
"limits": {
- "brotliBytes": 985158,
+ "brotliBytes": 985216,
"cssRawBytes": 2181,
"fontRawBytes": 221675,
- "gzipBytes": 984020,
+ "gzipBytes": 984075,
"imageRawBytes": 157940,
- "initialRawBytes": 2393438,
+ "initialRawBytes": 2393830,
"largestAssetRawBytes": 745126,
"otherAssetRawBytes": 0,
- "ownedRawBytes": 108562,
- "requestCount": 75,
- "scriptRequestCount": 59
+ "ownedRawBytes": 108460,
+ "requestCount": 74,
+ "scriptRequestCount": 58
},
"owner": "workbench",
"remediationTicket": "deepen-widget-registry-loading",
diff --git a/invokeai/frontend/webv2/performance/browser-baseline.json b/invokeai/frontend/webv2/performance/browser-baseline.json
index 058e8a35f4..2afd1660fc 100644
--- a/invokeai/frontend/webv2/performance/browser-baseline.json
+++ b/invokeai/frontend/webv2/performance/browser-baseline.json
@@ -25,10 +25,10 @@
"scriptRequestCount": 0,
"totalRawBytes": 0
},
- "domContentLoadedMedianMs": 109.30000000447035,
+ "domContentLoadedMedianMs": 105.09999999962747,
"id": "launchpad",
"layoutSwitchMedianMs": 0,
- "loadMedianMs": 109.30000000447035,
+ "loadMedianMs": 105.09999999962747,
"longestTaskMaxMs": 67,
"owner": "app",
"projectSwitchMedianMs": 0,
@@ -39,24 +39,24 @@
"fontRawBytes": 23664,
"imageRawBytes": 0,
"largestAssetRawBytes": 737748,
- "otherRawBytes": 95265,
+ "otherRawBytes": 95443,
"requestCount": 19,
- "scriptRawBytes": 1454622,
+ "scriptRawBytes": 1454574,
"scriptRequestCount": 15,
- "totalRawBytes": 1575710
+ "totalRawBytes": 1575840
},
"resourceLimits": {
"cssRawBytes": 2181,
"fontRawBytes": 23901,
"imageRawBytes": 0,
"largestAssetRawBytes": 745126,
- "otherRawBytes": 96218,
+ "otherRawBytes": 96398,
"requestCount": 19,
- "scriptRawBytes": 1469169,
+ "scriptRawBytes": 1469120,
"scriptRequestCount": 15,
- "totalRawBytes": 1591468
+ "totalRawBytes": 1591599
},
- "routeReadyMedianMs": 224.60000000149012,
+ "routeReadyMedianMs": 213.3999999994412,
"scriptSourceOwnerSet": "launchpad-static",
"stateProfile": "empty"
},
@@ -83,10 +83,10 @@
"scriptRequestCount": 0,
"totalRawBytes": 0
},
- "domContentLoadedMedianMs": 107.5,
+ "domContentLoadedMedianMs": 105.1000000005588,
"id": "launchpad",
"layoutSwitchMedianMs": 0,
- "loadMedianMs": 107.5,
+ "loadMedianMs": 105.1000000005588,
"longestTaskMaxMs": 66,
"owner": "app",
"projectSwitchMedianMs": 0,
@@ -97,24 +97,24 @@
"fontRawBytes": 23664,
"imageRawBytes": 0,
"largestAssetRawBytes": 737748,
- "otherRawBytes": 95265,
+ "otherRawBytes": 95443,
"requestCount": 19,
- "scriptRawBytes": 1454622,
+ "scriptRawBytes": 1454574,
"scriptRequestCount": 15,
- "totalRawBytes": 1575710
+ "totalRawBytes": 1575840
},
"resourceLimits": {
"cssRawBytes": 2181,
"fontRawBytes": 23901,
"imageRawBytes": 0,
"largestAssetRawBytes": 745126,
- "otherRawBytes": 96218,
+ "otherRawBytes": 96398,
"requestCount": 19,
- "scriptRawBytes": 1469169,
+ "scriptRawBytes": 1469120,
"scriptRequestCount": 15,
- "totalRawBytes": 1591468
+ "totalRawBytes": 1591599
},
- "routeReadyMedianMs": 277.90000000596046,
+ "routeReadyMedianMs": 265.40000000037253,
"scriptSourceOwnerSet": "launchpad-static",
"stateProfile": "representative"
},
@@ -141,13 +141,13 @@
"scriptRequestCount": 0,
"totalRawBytes": 0
},
- "domContentLoadedMedianMs": 107.89999999850988,
+ "domContentLoadedMedianMs": 105.29999999981374,
"id": "editor-minimal",
"layoutSwitchMedianMs": 0,
- "loadMedianMs": 107.89999999850988,
- "longestTaskMaxMs": 108,
+ "loadMedianMs": 105.29999999981374,
+ "longestTaskMaxMs": 106,
"owner": "workbench",
- "projectSwitchMedianMs": 65.07688899999994,
+ "projectSwitchMedianMs": 49.612936000000445,
"readyMark": "invokeai:ready:widget:center:preview",
"remediationTicket": "deepen-widget-registry-loading",
"resourceBaseline": {
@@ -155,24 +155,24 @@
"fontRawBytes": 23664,
"imageRawBytes": 156376,
"largestAssetRawBytes": 737748,
- "otherRawBytes": 95265,
- "requestCount": 95,
- "scriptRawBytes": 3005732,
- "scriptRequestCount": 89,
- "totalRawBytes": 3298609
+ "otherRawBytes": 95443,
+ "requestCount": 94,
+ "scriptRawBytes": 3006528,
+ "scriptRequestCount": 88,
+ "totalRawBytes": 3299583
},
"resourceLimits": {
"cssRawBytes": 17748,
"fontRawBytes": 23901,
"imageRawBytes": 157940,
"largestAssetRawBytes": 745126,
- "otherRawBytes": 96218,
- "requestCount": 95,
- "scriptRawBytes": 3035790,
- "scriptRequestCount": 89,
- "totalRawBytes": 3331596
+ "otherRawBytes": 96398,
+ "requestCount": 94,
+ "scriptRawBytes": 3036594,
+ "scriptRequestCount": 88,
+ "totalRawBytes": 3332579
},
- "routeReadyMedianMs": 605.5,
+ "routeReadyMedianMs": 598.2999999998137,
"scriptSourceOwnerSet": "editor-minimal-static",
"stateProfile": "empty"
},
@@ -199,13 +199,13 @@
"scriptRequestCount": 0,
"totalRawBytes": 0
},
- "domContentLoadedMedianMs": 108.10000000149012,
+ "domContentLoadedMedianMs": 106,
"id": "editor-minimal",
"layoutSwitchMedianMs": 0,
- "loadMedianMs": 108.10000000149012,
- "longestTaskMaxMs": 120,
+ "loadMedianMs": 106,
+ "longestTaskMaxMs": 114,
"owner": "workbench",
- "projectSwitchMedianMs": 87.70442700000058,
+ "projectSwitchMedianMs": 78.12321800000063,
"readyMark": "invokeai:ready:widget:center:preview",
"remediationTicket": "deepen-widget-registry-loading",
"resourceBaseline": {
@@ -213,24 +213,24 @@
"fontRawBytes": 23664,
"imageRawBytes": 156376,
"largestAssetRawBytes": 737748,
- "otherRawBytes": 95265,
- "requestCount": 95,
- "scriptRawBytes": 3005732,
- "scriptRequestCount": 89,
- "totalRawBytes": 3298609
+ "otherRawBytes": 95443,
+ "requestCount": 94,
+ "scriptRawBytes": 3006528,
+ "scriptRequestCount": 88,
+ "totalRawBytes": 3299583
},
"resourceLimits": {
"cssRawBytes": 17748,
"fontRawBytes": 23901,
"imageRawBytes": 157940,
"largestAssetRawBytes": 745126,
- "otherRawBytes": 96218,
- "requestCount": 95,
- "scriptRawBytes": 3035790,
- "scriptRequestCount": 89,
- "totalRawBytes": 3331596
+ "otherRawBytes": 96398,
+ "requestCount": 94,
+ "scriptRawBytes": 3036594,
+ "scriptRequestCount": 88,
+ "totalRawBytes": 3332579
},
- "routeReadyMedianMs": 652,
+ "routeReadyMedianMs": 636.5,
"scriptSourceOwnerSet": "editor-minimal-static",
"stateProfile": "representative"
},
@@ -257,11 +257,11 @@
"scriptRequestCount": 7,
"totalRawBytes": 293334
},
- "domContentLoadedMedianMs": 108.60000000149012,
+ "domContentLoadedMedianMs": 105.20000000018626,
"id": "editor-canvas",
- "layoutSwitchMedianMs": 74.10000000149012,
- "loadMedianMs": 108.60000000149012,
- "longestTaskMaxMs": 109,
+ "layoutSwitchMedianMs": 71.59999999962747,
+ "loadMedianMs": 105.20000000018626,
+ "longestTaskMaxMs": 103,
"owner": "canvas",
"projectSwitchMedianMs": 0,
"readyMark": "invokeai:ready:widget:center:canvas",
@@ -271,24 +271,24 @@
"fontRawBytes": 23664,
"imageRawBytes": 156376,
"largestAssetRawBytes": 737748,
- "otherRawBytes": 95265,
- "requestCount": 99,
- "scriptRawBytes": 3281926,
- "scriptRequestCount": 93,
- "totalRawBytes": 3574803
+ "otherRawBytes": 95443,
+ "requestCount": 98,
+ "scriptRawBytes": 3282722,
+ "scriptRequestCount": 92,
+ "totalRawBytes": 3575777
},
"resourceLimits": {
"cssRawBytes": 17748,
"fontRawBytes": 23901,
"imageRawBytes": 157940,
"largestAssetRawBytes": 745126,
- "otherRawBytes": 96218,
- "requestCount": 99,
- "scriptRawBytes": 3314746,
- "scriptRequestCount": 93,
- "totalRawBytes": 3610552
+ "otherRawBytes": 96398,
+ "requestCount": 98,
+ "scriptRawBytes": 3315550,
+ "scriptRequestCount": 92,
+ "totalRawBytes": 3611535
},
- "routeReadyMedianMs": 755,
+ "routeReadyMedianMs": 716.6999999992549,
"scriptSourceOwnerSet": "editor-canvas-static",
"stateProfile": "empty"
},
@@ -315,11 +315,11 @@
"scriptRequestCount": 7,
"totalRawBytes": 293334
},
- "domContentLoadedMedianMs": 108.19999999552965,
+ "domContentLoadedMedianMs": 104.29999999981374,
"id": "editor-canvas",
- "layoutSwitchMedianMs": 310.1000000014901,
- "loadMedianMs": 108.19999999552965,
- "longestTaskMaxMs": 363,
+ "layoutSwitchMedianMs": 294.1000000005588,
+ "loadMedianMs": 104.29999999981374,
+ "longestTaskMaxMs": 334,
"owner": "canvas",
"projectSwitchMedianMs": 0,
"readyMark": "invokeai:ready:widget:center:canvas",
@@ -329,24 +329,24 @@
"fontRawBytes": 23664,
"imageRawBytes": 156376,
"largestAssetRawBytes": 737748,
- "otherRawBytes": 95265,
- "requestCount": 99,
- "scriptRawBytes": 3281926,
- "scriptRequestCount": 93,
- "totalRawBytes": 3574803
+ "otherRawBytes": 95443,
+ "requestCount": 98,
+ "scriptRawBytes": 3282722,
+ "scriptRequestCount": 92,
+ "totalRawBytes": 3575777
},
"resourceLimits": {
"cssRawBytes": 17748,
"fontRawBytes": 23901,
"imageRawBytes": 157940,
"largestAssetRawBytes": 745126,
- "otherRawBytes": 96218,
- "requestCount": 99,
- "scriptRawBytes": 3314746,
- "scriptRequestCount": 93,
- "totalRawBytes": 3610552
+ "otherRawBytes": 96398,
+ "requestCount": 98,
+ "scriptRawBytes": 3315550,
+ "scriptRequestCount": 92,
+ "totalRawBytes": 3611535
},
- "routeReadyMedianMs": 1127.0999999940395,
+ "routeReadyMedianMs": 1091,
"scriptSourceOwnerSet": "editor-canvas-static",
"stateProfile": "representative"
},
@@ -373,11 +373,11 @@
"scriptRequestCount": 3,
"totalRawBytes": 14378
},
- "domContentLoadedMedianMs": 106.79999999701977,
+ "domContentLoadedMedianMs": 104,
"id": "editor-workflow",
- "layoutSwitchMedianMs": 71.20000000298023,
- "loadMedianMs": 106.79999999701977,
- "longestTaskMaxMs": 108,
+ "layoutSwitchMedianMs": 64.59999999962747,
+ "loadMedianMs": 104,
+ "longestTaskMaxMs": 103,
"owner": "workflow",
"projectSwitchMedianMs": 0,
"readyMark": "invokeai:ready:widget:center:workflow",
@@ -387,24 +387,24 @@
"fontRawBytes": 23664,
"imageRawBytes": 156376,
"largestAssetRawBytes": 737748,
- "otherRawBytes": 95265,
- "requestCount": 95,
- "scriptRawBytes": 3005732,
- "scriptRequestCount": 89,
- "totalRawBytes": 3298609
+ "otherRawBytes": 95443,
+ "requestCount": 94,
+ "scriptRawBytes": 3006528,
+ "scriptRequestCount": 88,
+ "totalRawBytes": 3299583
},
"resourceLimits": {
"cssRawBytes": 17748,
"fontRawBytes": 23901,
"imageRawBytes": 157940,
"largestAssetRawBytes": 745126,
- "otherRawBytes": 96218,
- "requestCount": 95,
- "scriptRawBytes": 3035790,
- "scriptRequestCount": 89,
- "totalRawBytes": 3331596
+ "otherRawBytes": 96398,
+ "requestCount": 94,
+ "scriptRawBytes": 3036594,
+ "scriptRequestCount": 88,
+ "totalRawBytes": 3332579
},
- "routeReadyMedianMs": 742.2000000029802,
+ "routeReadyMedianMs": 742.7000000001863,
"scriptSourceOwnerSet": "editor-minimal-static",
"stateProfile": "empty"
},
@@ -431,11 +431,11 @@
"scriptRequestCount": 3,
"totalRawBytes": 14378
},
- "domContentLoadedMedianMs": 108.5,
+ "domContentLoadedMedianMs": 105,
"id": "editor-workflow",
- "layoutSwitchMedianMs": 122.80000000447035,
- "loadMedianMs": 108.5,
- "longestTaskMaxMs": 403,
+ "layoutSwitchMedianMs": 117.70000000018626,
+ "loadMedianMs": 105,
+ "longestTaskMaxMs": 389,
"owner": "workflow",
"projectSwitchMedianMs": 0,
"readyMark": "invokeai:ready:widget:center:workflow",
@@ -445,24 +445,24 @@
"fontRawBytes": 23664,
"imageRawBytes": 156376,
"largestAssetRawBytes": 737748,
- "otherRawBytes": 95265,
- "requestCount": 95,
- "scriptRawBytes": 3005732,
- "scriptRequestCount": 89,
- "totalRawBytes": 3298609
+ "otherRawBytes": 95443,
+ "requestCount": 94,
+ "scriptRawBytes": 3006528,
+ "scriptRequestCount": 88,
+ "totalRawBytes": 3299583
},
"resourceLimits": {
"cssRawBytes": 17748,
"fontRawBytes": 23901,
"imageRawBytes": 157940,
"largestAssetRawBytes": 745126,
- "otherRawBytes": 96218,
- "requestCount": 95,
- "scriptRawBytes": 3035790,
- "scriptRequestCount": 89,
- "totalRawBytes": 3331596
+ "otherRawBytes": 96398,
+ "requestCount": 94,
+ "scriptRawBytes": 3036594,
+ "scriptRequestCount": 88,
+ "totalRawBytes": 3332579
},
- "routeReadyMedianMs": 945.1000000014901,
+ "routeReadyMedianMs": 918.4000000003725,
"scriptSourceOwnerSet": "editor-minimal-static",
"stateProfile": "representative"
},
@@ -489,11 +489,11 @@
"scriptRequestCount": 3,
"totalRawBytes": 14378
},
- "domContentLoadedMedianMs": 107.29999999701977,
+ "domContentLoadedMedianMs": 106.1000000005588,
"id": "editor-gallery",
- "layoutSwitchMedianMs": 27.100000001490116,
- "loadMedianMs": 107.29999999701977,
- "longestTaskMaxMs": 106,
+ "layoutSwitchMedianMs": 25.09999999962747,
+ "loadMedianMs": 106.1000000005588,
+ "longestTaskMaxMs": 103,
"owner": "gallery",
"projectSwitchMedianMs": 0,
"readyMark": "invokeai:ready:widget:center:gallery",
@@ -503,24 +503,24 @@
"fontRawBytes": 23664,
"imageRawBytes": 156376,
"largestAssetRawBytes": 737748,
- "otherRawBytes": 95265,
- "requestCount": 95,
- "scriptRawBytes": 3005732,
- "scriptRequestCount": 89,
- "totalRawBytes": 3298609
+ "otherRawBytes": 95443,
+ "requestCount": 94,
+ "scriptRawBytes": 3006528,
+ "scriptRequestCount": 88,
+ "totalRawBytes": 3299583
},
"resourceLimits": {
"cssRawBytes": 17748,
"fontRawBytes": 23901,
"imageRawBytes": 157940,
"largestAssetRawBytes": 745126,
- "otherRawBytes": 96218,
- "requestCount": 95,
- "scriptRawBytes": 3035790,
- "scriptRequestCount": 89,
- "totalRawBytes": 3331596
+ "otherRawBytes": 96398,
+ "requestCount": 94,
+ "scriptRawBytes": 3036594,
+ "scriptRequestCount": 88,
+ "totalRawBytes": 3332579
},
- "routeReadyMedianMs": 704.5,
+ "routeReadyMedianMs": 682.9000000003725,
"scriptSourceOwnerSet": "editor-minimal-static",
"stateProfile": "empty"
},
@@ -547,11 +547,11 @@
"scriptRequestCount": 3,
"totalRawBytes": 14378
},
- "domContentLoadedMedianMs": 109.69999999552965,
+ "domContentLoadedMedianMs": 105.5,
"id": "editor-gallery",
- "layoutSwitchMedianMs": 36.29999999701977,
- "loadMedianMs": 109.69999999552965,
- "longestTaskMaxMs": 118,
+ "layoutSwitchMedianMs": 35.5,
+ "loadMedianMs": 105.5,
+ "longestTaskMaxMs": 112,
"owner": "gallery",
"projectSwitchMedianMs": 0,
"readyMark": "invokeai:ready:widget:center:gallery",
@@ -561,24 +561,24 @@
"fontRawBytes": 23664,
"imageRawBytes": 156376,
"largestAssetRawBytes": 737748,
- "otherRawBytes": 95265,
- "requestCount": 95,
- "scriptRawBytes": 3005732,
- "scriptRequestCount": 89,
- "totalRawBytes": 3298609
+ "otherRawBytes": 95443,
+ "requestCount": 94,
+ "scriptRawBytes": 3006528,
+ "scriptRequestCount": 88,
+ "totalRawBytes": 3299583
},
"resourceLimits": {
"cssRawBytes": 17748,
"fontRawBytes": 23901,
"imageRawBytes": 157940,
"largestAssetRawBytes": 745126,
- "otherRawBytes": 96218,
- "requestCount": 95,
- "scriptRawBytes": 3035790,
- "scriptRequestCount": 89,
- "totalRawBytes": 3331596
+ "otherRawBytes": 96398,
+ "requestCount": 94,
+ "scriptRawBytes": 3036594,
+ "scriptRequestCount": 88,
+ "totalRawBytes": 3332579
},
- "routeReadyMedianMs": 857.6999999955297,
+ "routeReadyMedianMs": 826.2000000001863,
"scriptSourceOwnerSet": "editor-minimal-static",
"stateProfile": "representative"
}
@@ -990,6 +990,7 @@
"source:src/features/generation/core/canvas/compileCanvasGraph.ts",
"source:src/features/generation/core/canvas/controlValidation.ts",
"source:src/features/generation/core/canvas/types.ts",
+ "source:src/features/generation/core/catalogSearch.ts",
"source:src/features/generation/core/componentCompatibility.ts",
"source:src/features/generation/core/dynamicPrompts.ts",
"source:src/features/generation/core/graph.ts",
@@ -1793,6 +1794,7 @@
"source:src/features/generation/core/canvas/compileCanvasGraph.ts",
"source:src/features/generation/core/canvas/controlValidation.ts",
"source:src/features/generation/core/canvas/types.ts",
+ "source:src/features/generation/core/catalogSearch.ts",
"source:src/features/generation/core/componentCompatibility.ts",
"source:src/features/generation/core/dynamicPrompts.ts",
"source:src/features/generation/core/graph.ts",
diff --git a/invokeai/frontend/webv2/src/features/generation/core/settings.ts b/invokeai/frontend/webv2/src/features/generation/core/settings.ts
index 0bd142e391..550afc42eb 100644
--- a/invokeai/frontend/webv2/src/features/generation/core/settings.ts
+++ b/invokeai/frontend/webv2/src/features/generation/core/settings.ts
@@ -522,6 +522,30 @@ export const isLoraCompatibleWithModel = (
* fields fall back to their defaults so old projects keep their prompts and
* dimensions instead of being reset wholesale.
*/
+/**
+ * The fields of `GenerateSettings` that describe how the panel is arranged
+ * rather than what will be generated.
+ *
+ * They live in the same object because they are saved with the project, and
+ * separating the two is a change to the persisted shape rather than a
+ * rearrangement — worth doing, but not here. What can be stated once is which
+ * is which, and this is it: `satisfies` ties the set to the interface, so a key
+ * that stops existing, or is spelled wrong, fails to compile.
+ *
+ * Everything else is generation intent. Changing one of these is not: dragging
+ * a prompt box taller or looking at the merged template must not be mistaken
+ * for the kind of edit that reroutes the workbench. Applying a template *is*
+ * intent, which is why `promptTemplate` is absent and `promptTemplateViewMode`
+ * is present.
+ */
+export const GENERATE_UI_STATE_KEYS = {
+ aspectRatioIsLocked: true,
+ batchCount: true,
+ negativePromptHeightPx: true,
+ positivePromptHeightPx: true,
+ promptTemplateViewMode: true,
+} satisfies Partial<Record<keyof GenerateSettings, true>>;
+
export const normalizeGenerateSettings = (values: unknown): GenerateSettings | null => {
if (!isRecord(values)) {
return null;
diff --git a/invokeai/frontend/webv2/src/features/generation/core/types.ts b/invokeai/frontend/webv2/src/features/generation/core/types.ts
index 10b121b614..a35dc88d9a 100644
--- a/invokeai/frontend/webv2/src/features/generation/core/types.ts
+++ b/invokeai/frontend/webv2/src/features/generation/core/types.ts
@@ -150,6 +150,12 @@ export type AspectRatioId =
| '9:21'
| '1:8';
+/**
+ * Which of the fields below are panel arrangement rather than generation
+ * intent is stated once, as `GENERATE_UI_STATE_KEYS` in `./settings` — beside
+ * the normalization that already enumerates them, and where it costs no module
+ * of its own. This interface stays type-only.
+ */
export interface GenerateSettings {
batchCount: number;
modelKey: string;
diff --git a/invokeai/frontend/webv2/src/features/generation/settings.ts b/invokeai/frontend/webv2/src/features/generation/settings.ts
index 9ac0c6050f..b9cc71603b 100644
--- a/invokeai/frontend/webv2/src/features/generation/settings.ts
+++ b/invokeai/frontend/webv2/src/features/generation/settings.ts
@@ -10,6 +10,7 @@ export {
DEFAULT_NEGATIVE_PROMPT_HEIGHT_PX,
DEFAULT_POSITIVE_PROMPT_HEIGHT_PX,
deriveAspectRatioId,
+ GENERATE_UI_STATE_KEYS,
getDefaultLoraWeight,
getModelDefaultVae,
hasModelDefaultVae,
diff --git a/invokeai/frontend/webv2/src/workbench/autoRoutePolicy.test.ts b/invokeai/frontend/webv2/src/workbench/autoRoutePolicy.test.ts
index 1fb32fe863..0713b703a3 100644
--- a/invokeai/frontend/webv2/src/workbench/autoRoutePolicy.test.ts
+++ b/invokeai/frontend/webv2/src/workbench/autoRoutePolicy.test.ts
@@ -80,6 +80,14 @@ describe('widget edit classification', () => {
expect(isHighConfidenceGenerateEdit(['futureSetting'])).toBe(true);
expect(isHighConfidenceUpscaleEdit(['futureSetting'])).toBe(true);
});
+
+ // The two live in one object and read alike, but only one of them changes
+ // what generates. Looking at the merged prompt is not an edit; applying the
+ // template that produced it is.
+ it('separates looking at a template from applying one', () => {
+ expect(isHighConfidenceGenerateEdit(['promptTemplateViewMode'])).toBe(false);
+ expect(isHighConfidenceGenerateEdit(['promptTemplate'])).toBe(true);
+ });
});
describe('Canvas edit classification', () => {
diff --git a/invokeai/frontend/webv2/src/workbench/autoRoutePolicy.ts b/invokeai/frontend/webv2/src/workbench/autoRoutePolicy.ts
index 42fd90b7c2..c495d42bae 100644
--- a/invokeai/frontend/webv2/src/workbench/autoRoutePolicy.ts
+++ b/invokeai/frontend/webv2/src/workbench/autoRoutePolicy.ts
@@ -1,6 +1,8 @@
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 type { CanvasProjectMutation } from './canvasProjectMutations';
import { isInvocationSourceAvailable } from './invocation';
@@ -38,16 +40,16 @@ export const getRouteAfterHighConfidenceEdit = (
export const getChangedValueKeys = (previous: Record<string, unknown>, patch: Record<string, unknown>): string[] =>
Object.keys(patch).filter((key) => !Object.is(previous[key], patch[key]));
-const GENERATE_UI_NOISE_KEYS: ReadonlySet<string> = new Set([
- 'aspectRatioIsLocked',
- 'batchCount',
- 'negativePromptHeightPx',
- 'positivePromptHeightPx',
- // Toggling the read-only template view changes nothing about what generates.
- // Applying a template does, so `promptTemplate` is deliberately not noise.
- 'promptTemplateViewMode',
-]);
+// Named beside the interface they belong to rather than restated here, so a
+// field that is renamed or removed cannot leave a dead string behind. Which
+// fields are arrangement and which are intent is a fact about `GenerateSettings`
+// and reads as one there; this only asks the question.
+const GENERATE_UI_NOISE_KEYS: ReadonlySet<string> = new Set(Object.keys(GENERATE_UI_STATE_KEYS));
+// Its own list, and not a subset of the above: Upscale's values are a different
+// shape that happens to share a prompt box and a batch count. It has no aspect
+// lock and no templates, so naming those here would describe a widget that does
+// not exist.
const UPSCALE_UI_NOISE_KEYS: ReadonlySet<string> = new Set([
'batchCount',
'negativePromptHeightPx',