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
Merge branch 'refactor/invocations-by-architecture' into feat/webv2-server-driven-model-policies
Alexander Eichhorn4ccb34b3b6f2
diff --cc invokeai/frontend/webv2/performance/architecture-baseline.jsonindex 9ec3f07ae4,142a586877..fd1abeb384--- a/invokeai/frontend/webv2/performance/architecture-baseline.json+++ b/invokeai/frontend/webv2/performance/architecture-baseline.json@@@ -2,15 -2,15 +2,15 @@@"build": {"launchpad": {"baseline": {- "brotliBytes": 859420,- "brotliBytes": 859335,++ "brotliBytes": 859466,"cssRawBytes": 2159,"fontRawBytes": 219480,- "gzipBytes": 858588,- "gzipBytes": 858507,++ "gzipBytes": 858619,"imageRawBytes": 156376,- "initialRawBytes": 2011057,- "initialRawBytes": 2010911,++ "initialRawBytes": 2011122,"largestAssetRawBytes": 747218,"otherAssetRawBytes": 0,- "ownedRawBytes": 74568,- "ownedRawBytes": 74443,++ "ownedRawBytes": 74570,"requestCount": 44,"scriptRequestCount": 28,"sourceOwners": [@@@ -329,17 -316,17 +316,17 @@@},"editor": {"baseline": {- "brotliBytes": 1183830,- "brotliBytes": 1182691,++ "brotliBytes": 1185385,"cssRawBytes": 2159,"fontRawBytes": 219480,- "gzipBytes": 1177930,- "gzipBytes": 1176792,++ "gzipBytes": 1179399,"imageRawBytes": 156376,- "initialRawBytes": 2992407,- "initialRawBytes": 2993632,++ "initialRawBytes": 2996432,"largestAssetRawBytes": 747218,"otherAssetRawBytes": 0,- "ownedRawBytes": 131242,- "ownedRawBytes": 133058,- "requestCount": 106,- "scriptRequestCount": 90,++ "ownedRawBytes": 133035,+ "requestCount": 109,+ "scriptRequestCount": 93,"sourceOwners": ["package:@ark-ui/react","package:@chakra-ui/react",@@@ -1044,7 -1017,7 +1021,7 @@@"source": "src/app/WorkbenchApp.tsx"}},- "capturedAt": "2026-09-11",- "capturedAt": "2026-09-13",++ "capturedAt": "2026-09-14","developmentInvalidation": {"platformUiBarrel": {"specifier": "@platform/ui",diff --cc invokeai/frontend/webv2/performance/browser-baseline.jsonindex cb4987014d,5c730178ec..80cf0d41ca--- a/invokeai/frontend/webv2/performance/browser-baseline.json+++ b/invokeai/frontend/webv2/performance/browser-baseline.json@@@ -1,6 -1,6 +1,6 @@@{- "browserExecutable": "/home/lstein/.cache/ms-playwright/chromium-1234/chrome-linux64/chrome",- "capturedAt": "2026-09-13",+ "browserExecutable": "C:\\Users\\PC1\\AppData\\Local\\ms-playwright\\chromium-1234\\chrome-win64\\chrome.exe",- "capturedAt": "2026-09-11",++ "capturedAt": "2026-09-14","routes": [{"activatedResourceBaseline": {@@@ -14,24 -14,13 +14,13 @@@"scriptRequestCount": 0,"totalRawBytes": 0},- "activatedResourceLimits": {- "cssRawBytes": 0,- "fontRawBytes": 0,- "imageRawBytes": 0,- "largestAssetRawBytes": 0,- "otherRawBytes": 0,- "requestCount": 0,- "scriptRawBytes": 0,- "scriptRequestCount": 0,- "totalRawBytes": 0- },- "domContentLoadedMedianMs": 107.59999999403954,- "domContentLoadedMedianMs": 104,++ "domContentLoadedMedianMs": 205.39999999850988,"id": "launchpad","layoutAckMedianMs": 0,"layoutReturnSwitchMedianMs": 0,"layoutSwitchMedianMs": 0,- "loadMedianMs": 107.79999999701977,- "longestTaskMaxMs": 80,- "loadMedianMs": 104.19999992847443,- "longestTaskMaxMs": 75,++ "loadMedianMs": 205.59999999403954,++ "longestTaskMaxMs": 157,"owner": "app","projectSwitchMedianMs": 0,"readyMark": "invokeai:ready:launchpad",@@@ -41,24 -30,13 +30,13 @@@"fontRawBytes": 23664,"imageRawBytes": 0,"largestAssetRawBytes": 747218,- "otherRawBytes": 152865,- "otherRawBytes": 152971,++ "otherRawBytes": 153246,"requestCount": 39,-- "scriptRawBytes": 1692314,++ "scriptRawBytes": 1692525,"scriptRequestCount": 35,- "totalRawBytes": 1871002- "totalRawBytes": 1871108++ "totalRawBytes": 1871594},- "resourceLimits": {- "cssRawBytes": 2181,- "fontRawBytes": 23901,- "imageRawBytes": 0,- "largestAssetRawBytes": 754691,- "otherRawBytes": 154394,- "requestCount": 39,- "scriptRawBytes": 1709238,- "scriptRequestCount": 35,- "totalRawBytes": 1889713- },- "routeReadyMedianMs": 246.70000000298023,- "routeReadyMedianMs": 237.29999995231628,++ "routeReadyMedianMs": 457.6000000014901,"scriptSourceOwnerSet": "launchpad-static","stateProfile": "empty"},@@@ -74,24 -52,13 +52,13 @@@"scriptRequestCount": 0,"totalRawBytes": 0},- "activatedResourceLimits": {- "cssRawBytes": 0,- "fontRawBytes": 0,- "imageRawBytes": 0,- "largestAssetRawBytes": 0,- "otherRawBytes": 0,- "requestCount": 0,- "scriptRawBytes": 0,- "scriptRequestCount": 0,- "totalRawBytes": 0- },- "domContentLoadedMedianMs": 108.20000000298023,- "domContentLoadedMedianMs": 98.60000002384186,++ "domContentLoadedMedianMs": 198.19999999552965,"id": "launchpad","layoutAckMedianMs": 0,"layoutReturnSwitchMedianMs": 0,"layoutSwitchMedianMs": 0,- "loadMedianMs": 108.29999999701977,- "longestTaskMaxMs": 77,- "loadMedianMs": 98.69999992847443,- "longestTaskMaxMs": 66,++ "loadMedianMs": 198.29999999701977,++ "longestTaskMaxMs": 180,"owner": "app","projectSwitchMedianMs": 0,"readyMark": "invokeai:ready:launchpad",@@@ -101,24 -68,13 +68,13 @@@"fontRawBytes": 23664,"imageRawBytes": 0,"largestAssetRawBytes": 747218,- "otherRawBytes": 152865,- "otherRawBytes": 152971,++ "otherRawBytes": 153246,"requestCount": 39,-- "scriptRawBytes": 1692314,++ "scriptRawBytes": 1692525,"scriptRequestCount": 35,- "totalRawBytes": 1871002- "totalRawBytes": 1871108++ "totalRawBytes": 1871594},- "resourceLimits": {- "cssRawBytes": 2181,- "fontRawBytes": 23901,- "imageRawBytes": 0,- "largestAssetRawBytes": 754691,- "otherRawBytes": 154394,- "requestCount": 39,- "scriptRawBytes": 1709238,- "scriptRequestCount": 35,- "totalRawBytes": 1889713- },- "routeReadyMedianMs": 255.59999999403954,- "routeReadyMedianMs": 244.69999992847443,++ "routeReadyMedianMs": 494.69999999552965,"scriptSourceOwnerSet": "launchpad-static","stateProfile": "representative"},@@@ -134,26 -90,15 +90,15 @@@"scriptRequestCount": 0,"totalRawBytes": 0},- "activatedResourceLimits": {- "cssRawBytes": 0,- "fontRawBytes": 0,- "imageRawBytes": 0,- "largestAssetRawBytes": 0,- "otherRawBytes": 0,- "requestCount": 0,- "scriptRawBytes": 0,- "scriptRequestCount": 0,- "totalRawBytes": 0- },- "domContentLoadedMedianMs": 103.90000000596046,- "domContentLoadedMedianMs": 98.5,++ "domContentLoadedMedianMs": 229.20000000298023,"id": "editor-minimal","layoutAckMedianMs": 0,"layoutReturnSwitchMedianMs": 0,"layoutSwitchMedianMs": 0,- "loadMedianMs": 104,- "longestTaskMaxMs": 135,- "loadMedianMs": 98.70000004768372,- "longestTaskMaxMs": 111,++ "loadMedianMs": 229.70000000298023,++ "longestTaskMaxMs": 354,"owner": "workbench",- "projectSwitchMedianMs": 36.70000000298023,- "projectSwitchMedianMs": 32.699999928474426,++ "projectSwitchMedianMs": 78.60000000149012,"readyMark": "invokeai:ready:widget:center:preview","remediationTicket": "deepen-widget-registry-loading","resourceBaseline": {@@@ -161,24 -106,13 +106,13 @@@"fontRawBytes": 23664,"imageRawBytes": 156376,"largestAssetRawBytes": 747218,- "otherRawBytes": 152865,- "otherRawBytes": 152971,- "requestCount": 122,- "scriptRawBytes": 3549693,- "scriptRequestCount": 117,- "totalRawBytes": 3884863++ "otherRawBytes": 153246,+ "requestCount": 125,- "scriptRawBytes": 3545775,++ "scriptRawBytes": 3555218,+ "scriptRequestCount": 120,- "totalRawBytes": 3880839++ "totalRawBytes": 3890663},- "resourceLimits": {- "cssRawBytes": 2181,- "fontRawBytes": 23901,- "imageRawBytes": 157940,- "largestAssetRawBytes": 754691,- "otherRawBytes": 154394,- "requestCount": 125,- "scriptRawBytes": 3581233,- "scriptRequestCount": 120,- "totalRawBytes": 3919648- },- "routeReadyMedianMs": 376.20000000298023,- "routeReadyMedianMs": 372.8000000715256,++ "routeReadyMedianMs": 800.2999999970198,"scriptSourceOwnerSet": "editor-minimal-static","stateProfile": "empty"},@@@ -194,26 -128,15 +128,15 @@@"scriptRequestCount": 0,"totalRawBytes": 0},- "activatedResourceLimits": {- "cssRawBytes": 0,- "fontRawBytes": 0,- "imageRawBytes": 0,- "largestAssetRawBytes": 0,- "otherRawBytes": 0,- "requestCount": 0,- "scriptRawBytes": 0,- "scriptRequestCount": 0,- "totalRawBytes": 0- },- "domContentLoadedMedianMs": 107.5,- "domContentLoadedMedianMs": 97.80000007152557,++ "domContentLoadedMedianMs": 198.40000000596046,"id": "editor-minimal","layoutAckMedianMs": 0,"layoutReturnSwitchMedianMs": 0,"layoutSwitchMedianMs": 0,- "loadMedianMs": 107.59999999403954,- "longestTaskMaxMs": 140,- "loadMedianMs": 97.80000007152557,- "longestTaskMaxMs": 112,++ "loadMedianMs": 198.60000000149012,++ "longestTaskMaxMs": 368,"owner": "workbench",- "projectSwitchMedianMs": 42.8999999910593,- "projectSwitchMedianMs": 38.5,++ "projectSwitchMedianMs": 96.89999999850988,"readyMark": "invokeai:ready:widget:center:preview","remediationTicket": "deepen-widget-registry-loading","resourceBaseline": {@@@ -221,24 -144,13 +144,13 @@@"fontRawBytes": 23664,"imageRawBytes": 156376,"largestAssetRawBytes": 747218,- "otherRawBytes": 152865,- "requestCount": 125,- "scriptRawBytes": 3545775,- "scriptRequestCount": 120,- "totalRawBytes": 3880839- },- "resourceLimits": {- "cssRawBytes": 2181,- "fontRawBytes": 23901,- "imageRawBytes": 157940,- "largestAssetRawBytes": 754691,- "otherRawBytes": 154394,- "otherRawBytes": 152971,- "requestCount": 122,- "scriptRawBytes": 3549693,- "scriptRequestCount": 117,- "totalRawBytes": 3884863++ "otherRawBytes": 153246,+ "requestCount": 125,- "scriptRawBytes": 3581233,++ "scriptRawBytes": 3555218,+ "scriptRequestCount": 120,- "totalRawBytes": 3919648++ "totalRawBytes": 3890663},- "routeReadyMedianMs": 387.79999999701977,- "routeReadyMedianMs": 379.7999999523163,++ "routeReadyMedianMs": 694.6000000014901,"scriptSourceOwnerSet": "editor-minimal-static","stateProfile": "representative"},@@@ -247,31 -159,20 +159,20 @@@"cssRawBytes": 0,"fontRawBytes": 0,"imageRawBytes": 0,- "largestAssetRawBytes": 307179,+ "largestAssetRawBytes": 307527,"otherRawBytes": 0,"requestCount": 10,- "scriptRawBytes": 501646,+ "scriptRawBytes": 502144,"scriptRequestCount": 10,- "totalRawBytes": 501646+ "totalRawBytes": 502144},- "activatedResourceLimits": {- "cssRawBytes": 0,- "fontRawBytes": 0,- "imageRawBytes": 0,- "largestAssetRawBytes": 310603,- "otherRawBytes": 0,- "requestCount": 10,- "scriptRawBytes": 507166,- "scriptRequestCount": 10,- "totalRawBytes": 507166- },- "domContentLoadedMedianMs": 104.20000000298023,- "domContentLoadedMedianMs": 96.39999997615814,++ "domContentLoadedMedianMs": 255.79999999701977,"id": "editor-canvas",- "layoutAckMedianMs": 2.2999999970197678,- "layoutReturnSwitchMedianMs": 61.3999999910593,- "layoutSwitchMedianMs": 74.70000000298023,- "loadMedianMs": 104.30000001192093,- "longestTaskMaxMs": 137,- "layoutAckMedianMs": 2.700000047683716,- "layoutReturnSwitchMedianMs": 52.60000002384186,- "layoutSwitchMedianMs": 86.10000002384186,- "loadMedianMs": 96.5,- "longestTaskMaxMs": 133,++ "layoutAckMedianMs": 3.7999999970197678,++ "layoutReturnSwitchMedianMs": 70.5,++ "layoutSwitchMedianMs": 156.60000000149012,++ "loadMedianMs": 256.1000000014901,++ "longestTaskMaxMs": 421,"owner": "canvas","projectSwitchMedianMs": 0,"readyMark": "invokeai:ready:widget:center:canvas",@@@ -281,24 -182,13 +182,13 @@@"fontRawBytes": 23664,"imageRawBytes": 156376,"largestAssetRawBytes": 747218,- "otherRawBytes": 152865,- "requestCount": 135,- "scriptRawBytes": 4047919,- "scriptRequestCount": 130,- "totalRawBytes": 4382983- },- "resourceLimits": {- "cssRawBytes": 2181,- "fontRawBytes": 23901,- "imageRawBytes": 157940,- "largestAssetRawBytes": 754691,- "otherRawBytes": 154394,- "otherRawBytes": 152971,- "requestCount": 132,- "scriptRawBytes": 4051339,- "scriptRequestCount": 127,- "totalRawBytes": 4386509++ "otherRawBytes": 153246,+ "requestCount": 135,- "scriptRawBytes": 4088399,++ "scriptRawBytes": 4057362,+ "scriptRequestCount": 130,- "totalRawBytes": 4426813++ "totalRawBytes": 4392807},- "routeReadyMedianMs": 1080,- "routeReadyMedianMs": 1051.5,++ "routeReadyMedianMs": 2003.1000000014901,"scriptSourceOwnerSet": "editor-canvas-static","stateProfile": "empty"},@@@ -307,31 -197,20 +197,20 @@@"cssRawBytes": 0,"fontRawBytes": 0,"imageRawBytes": 0,- "largestAssetRawBytes": 307179,+ "largestAssetRawBytes": 307527,"otherRawBytes": 0,"requestCount": 10,- "scriptRawBytes": 501646,+ "scriptRawBytes": 502144,"scriptRequestCount": 10,- "totalRawBytes": 501646+ "totalRawBytes": 502144},- "activatedResourceLimits": {- "cssRawBytes": 0,- "fontRawBytes": 0,- "imageRawBytes": 0,- "largestAssetRawBytes": 310603,- "otherRawBytes": 0,- "requestCount": 10,- "scriptRawBytes": 507166,- "scriptRequestCount": 10,- "totalRawBytes": 507166- },- "domContentLoadedMedianMs": 103,- "domContentLoadedMedianMs": 101.60000002384186,++ "domContentLoadedMedianMs": 135,"id": "editor-canvas",- "layoutAckMedianMs": 3.199999988079071,- "layoutReturnSwitchMedianMs": 46.19999998807907,- "layoutSwitchMedianMs": 77.20000000298023,- "loadMedianMs": 103.1000000089407,- "longestTaskMaxMs": 187,- "layoutAckMedianMs": 2.899999976158142,- "layoutReturnSwitchMedianMs": 47.299999952316284,- "layoutSwitchMedianMs": 81.19999992847443,- "loadMedianMs": 101.70000004768372,- "longestTaskMaxMs": 159,++ "layoutAckMedianMs": 3.7999999970197678,++ "layoutReturnSwitchMedianMs": 55.899999998509884,++ "layoutSwitchMedianMs": 104.89999999850988,++ "loadMedianMs": 135.10000000149012,++ "longestTaskMaxMs": 254,"owner": "canvas","projectSwitchMedianMs": 0,"readyMark": "invokeai:ready:widget:center:canvas",@@@ -341,24 -220,13 +220,13 @@@"fontRawBytes": 23664,"imageRawBytes": 156376,"largestAssetRawBytes": 747218,- "otherRawBytes": 152865,- "requestCount": 135,- "scriptRawBytes": 4047919,- "scriptRequestCount": 130,- "totalRawBytes": 4382983- },- "resourceLimits": {- "cssRawBytes": 2181,- "fontRawBytes": 23901,- "imageRawBytes": 157940,- "largestAssetRawBytes": 754691,- "otherRawBytes": 154394,- "otherRawBytes": 152971,- "requestCount": 132,- "scriptRawBytes": 4051339,- "scriptRequestCount": 127,- "totalRawBytes": 4386509++ "otherRawBytes": 153246,+ "requestCount": 135,- "scriptRawBytes": 4088399,++ "scriptRawBytes": 4057362,+ "scriptRequestCount": 130,- "totalRawBytes": 4426813++ "totalRawBytes": 4392807},- "routeReadyMedianMs": 1087.6000000089407,- "routeReadyMedianMs": 1060.3000000715256,++ "routeReadyMedianMs": 1283,"scriptSourceOwnerSet": "editor-canvas-static","stateProfile": "representative"},@@@ -374,24 -242,13 +242,13 @@@"scriptRequestCount": 6,"totalRawBytes": 383698},- "activatedResourceLimits": {- "cssRawBytes": 15568,- "fontRawBytes": 0,- "imageRawBytes": 0,- "largestAssetRawBytes": 175873,- "otherRawBytes": 0,- "requestCount": 7,- "scriptRawBytes": 371968,- "scriptRequestCount": 6,- "totalRawBytes": 387535- },- "domContentLoadedMedianMs": 103.40000000596046,- "domContentLoadedMedianMs": 103.29999995231628,++ "domContentLoadedMedianMs": 134.80000000447035,"id": "editor-workflow",- "layoutAckMedianMs": 2.2000000029802322,- "layoutReturnSwitchMedianMs": 32.900000005960464,- "layoutSwitchMedianMs": 72.6000000089407,- "loadMedianMs": 103.5,- "longestTaskMaxMs": 137,- "layoutAckMedianMs": 1.9000000953674316,- "layoutReturnSwitchMedianMs": 30.399999976158142,- "layoutSwitchMedianMs": 78.59999990463257,- "loadMedianMs": 103.39999997615814,- "longestTaskMaxMs": 112,++ "layoutAckMedianMs": 2.8000000044703484,++ "layoutReturnSwitchMedianMs": 35.79999999701977,++ "layoutSwitchMedianMs": 93,++ "loadMedianMs": 134.90000000596046,++ "longestTaskMaxMs": 195,"owner": "workflow","projectSwitchMedianMs": 0,"readyMark": "invokeai:ready:widget:center:workflow",@@@ -401,24 -258,13 +258,13 @@@"fontRawBytes": 23664,"imageRawBytes": 156376,"largestAssetRawBytes": 747218,- "otherRawBytes": 152865,- "otherRawBytes": 152971,- "requestCount": 129,- "scriptRawBytes": 3917978,- "scriptRequestCount": 123,- "totalRawBytes": 4268561++ "otherRawBytes": 153246,+ "requestCount": 132,- "scriptRawBytes": 3914060,++ "scriptRawBytes": 3923503,+ "scriptRequestCount": 126,- "totalRawBytes": 4264537++ "totalRawBytes": 4274361},- "resourceLimits": {- "cssRawBytes": 17748,- "fontRawBytes": 23901,- "imageRawBytes": 157940,- "largestAssetRawBytes": 754691,- "otherRawBytes": 154394,- "requestCount": 132,- "scriptRawBytes": 3953201,- "scriptRequestCount": 126,- "totalRawBytes": 4307183- },- "routeReadyMedianMs": 1075.6000000089407,- "routeReadyMedianMs": 1048.3999999761581,++ "routeReadyMedianMs": 1276.5,"scriptSourceOwnerSet": "editor-workflow-static","stateProfile": "empty"},@@@ -434,24 -280,13 +280,13 @@@"scriptRequestCount": 6,"totalRawBytes": 383698},- "activatedResourceLimits": {- "cssRawBytes": 15568,- "fontRawBytes": 0,- "imageRawBytes": 0,- "largestAssetRawBytes": 175873,- "otherRawBytes": 0,- "requestCount": 7,- "scriptRawBytes": 371968,- "scriptRequestCount": 6,- "totalRawBytes": 387535- },- "domContentLoadedMedianMs": 108,- "domContentLoadedMedianMs": 100.60000002384186,++ "domContentLoadedMedianMs": 131.79999999701977,"id": "editor-workflow",- "layoutAckMedianMs": 3,- "layoutReturnSwitchMedianMs": 37.900000005960464,- "layoutSwitchMedianMs": 116.6000000089407,- "loadMedianMs": 108.20000000298023,- "longestTaskMaxMs": 358,- "layoutAckMedianMs": 3.6999999284744263,- "layoutReturnSwitchMedianMs": 36.89999997615814,- "layoutSwitchMedianMs": 108.5,- "loadMedianMs": 100.69999992847443,- "longestTaskMaxMs": 294,++ "layoutAckMedianMs": 3.9000000059604645,++ "layoutReturnSwitchMedianMs": 47.79999999701977,++ "layoutSwitchMedianMs": 153.60000000149012,++ "loadMedianMs": 131.89999999850988,++ "longestTaskMaxMs": 767,"owner": "workflow","projectSwitchMedianMs": 0,"readyMark": "invokeai:ready:widget:center:workflow",@@@ -461,24 -296,13 +296,13 @@@"fontRawBytes": 23664,"imageRawBytes": 156376,"largestAssetRawBytes": 747218,- "otherRawBytes": 152865,- "otherRawBytes": 152971,- "requestCount": 129,- "scriptRawBytes": 3917978,- "scriptRequestCount": 123,- "totalRawBytes": 4268561++ "otherRawBytes": 153246,+ "requestCount": 132,- "scriptRawBytes": 3914060,++ "scriptRawBytes": 3923503,+ "scriptRequestCount": 126,- "totalRawBytes": 4264537++ "totalRawBytes": 4274361},- "resourceLimits": {- "cssRawBytes": 17748,- "fontRawBytes": 23901,- "imageRawBytes": 157940,- "largestAssetRawBytes": 754691,- "otherRawBytes": 154394,- "requestCount": 132,- "scriptRawBytes": 3953201,- "scriptRequestCount": 126,- "totalRawBytes": 4307183- },- "routeReadyMedianMs": 1133.9000000059605,- "routeReadyMedianMs": 1107.3000000715256,++ "routeReadyMedianMs": 1303.6000000014901,"scriptSourceOwnerSet": "editor-workflow-static","stateProfile": "representative"},@@@ -494,24 -318,13 +318,13 @@@"scriptRequestCount": 0,"totalRawBytes": 0},- "activatedResourceLimits": {- "cssRawBytes": 0,- "fontRawBytes": 0,- "imageRawBytes": 0,- "largestAssetRawBytes": 0,- "otherRawBytes": 0,- "requestCount": 0,- "scriptRawBytes": 0,- "scriptRequestCount": 0,- "totalRawBytes": 0- },- "domContentLoadedMedianMs": 102,- "domContentLoadedMedianMs": 103.30000007152557,++ "domContentLoadedMedianMs": 215.20000000298023,"id": "editor-gallery","layoutAckMedianMs": 0,"layoutReturnSwitchMedianMs": 0,- "layoutSwitchMedianMs": 24.400000005960464,- "loadMedianMs": 102.19999998807907,- "longestTaskMaxMs": 132,- "layoutSwitchMedianMs": 23.899999976158142,- "loadMedianMs": 103.40000009536743,- "longestTaskMaxMs": 112,++ "layoutSwitchMedianMs": 54.900000005960464,++ "loadMedianMs": 215.40000000596046,++ "longestTaskMaxMs": 283,"owner": "gallery","projectSwitchMedianMs": 0,"readyMark": "invokeai:ready:widget:center:gallery",@@@ -521,24 -334,13 +334,13 @@@"fontRawBytes": 23664,"imageRawBytes": 156376,"largestAssetRawBytes": 747218,- "otherRawBytes": 152865,- "otherRawBytes": 152971,- "requestCount": 122,- "scriptRawBytes": 3549693,- "scriptRequestCount": 117,- "totalRawBytes": 3884863++ "otherRawBytes": 153246,+ "requestCount": 125,- "scriptRawBytes": 3545775,++ "scriptRawBytes": 3555218,+ "scriptRequestCount": 120,- "totalRawBytes": 3880839++ "totalRawBytes": 3890663},- "resourceLimits": {- "cssRawBytes": 2181,- "fontRawBytes": 23901,- "imageRawBytes": 157940,- "largestAssetRawBytes": 754691,- "otherRawBytes": 154394,- "requestCount": 125,- "scriptRawBytes": 3581233,- "scriptRequestCount": 120,- "totalRawBytes": 3919648- },- "routeReadyMedianMs": 1297.5,- "routeReadyMedianMs": 1259.5,++ "routeReadyMedianMs": 1793,"scriptSourceOwnerSet": "editor-minimal-static","stateProfile": "empty"},@@@ -554,24 -356,13 +356,13 @@@"scriptRequestCount": 0,"totalRawBytes": 0},- "activatedResourceLimits": {- "cssRawBytes": 0,- "fontRawBytes": 0,- "imageRawBytes": 0,- "largestAssetRawBytes": 0,- "otherRawBytes": 0,- "requestCount": 0,- "scriptRawBytes": 0,- "scriptRequestCount": 0,- "totalRawBytes": 0- },- "domContentLoadedMedianMs": 104.90000000596046,- "domContentLoadedMedianMs": 101.69999992847443,++ "domContentLoadedMedianMs": 205.70000000298023,"id": "editor-gallery","layoutAckMedianMs": 0,"layoutReturnSwitchMedianMs": 0,- "layoutSwitchMedianMs": 33.29999999701977,- "loadMedianMs": 105.09999999403954,- "longestTaskMaxMs": 131,- "layoutSwitchMedianMs": 33,- "loadMedianMs": 101.79999995231628,- "longestTaskMaxMs": 102,++ "layoutSwitchMedianMs": 76.89999999850988,++ "loadMedianMs": 205.90000000596046,++ "longestTaskMaxMs": 276,"owner": "gallery","projectSwitchMedianMs": 0,"readyMark": "invokeai:ready:widget:center:gallery",@@@ -581,24 -372,13 +372,13 @@@"fontRawBytes": 23664,"imageRawBytes": 156376,"largestAssetRawBytes": 747218,- "otherRawBytes": 152865,- "requestCount": 125,- "scriptRawBytes": 3545775,- "scriptRequestCount": 120,- "totalRawBytes": 3880839- },- "resourceLimits": {- "cssRawBytes": 2181,- "fontRawBytes": 23901,- "imageRawBytes": 157940,- "largestAssetRawBytes": 754691,- "otherRawBytes": 154394,- "otherRawBytes": 152971,- "requestCount": 122,- "scriptRawBytes": 3549693,- "scriptRequestCount": 117,- "totalRawBytes": 3884863++ "otherRawBytes": 153246,+ "requestCount": 125,- "scriptRawBytes": 3581233,++ "scriptRawBytes": 3555218,+ "scriptRequestCount": 120,- "totalRawBytes": 3919648++ "totalRawBytes": 3890663},- "routeReadyMedianMs": 1305.2000000029802,- "routeReadyMedianMs": 1278.0999999046326,++ "routeReadyMedianMs": 2004.8000000044703,"scriptSourceOwnerSet": "editor-minimal-static","stateProfile": "representative"}diff --cc invokeai/frontend/webv2/src/workbench/image-actions/executeRecallParameters.test.tsindex 0000000000,adb727b4c6..ad3235b626mode 000000,100644..100644--- a/invokeai/frontend/webv2/src/workbench/image-actions/executeRecallParameters.test.ts+++ b/invokeai/frontend/webv2/src/workbench/image-actions/executeRecallParameters.test.ts@@@ -1,0 -1,268 +1,272 @@@+ import type { ComponentModelConfig } from '@features/generation/contracts';+ import type { WorkbenchCommands } from '@workbench/workbenchStore';++ import { accountLifecycle, captureAccountScope, type AccountScope } from '@platform/state/accountLifecycle';+ import { beforeEach, describe, expect, it, vi } from 'vitest';++ const galleryApi = vi.hoisted(() => ({+ galleryImages: {+ metadata: vi.fn(),+ resolveMany: vi.fn(),+ },+ }));++ vi.mock('@features/gallery', () => galleryApi);+++import { seedArchitectureCapabilities } from '@features/generation/core/architectureCapabilities.testing';+++ import { executeRecallParameters } from './executeRecallParameters';++ const sdxl = { base: 'sdxl', hash: 'h', key: 'sdxl-main', name: 'SDXL', type: 'main' } as ComponentModelConfig;+ const galleryImage = (imageName: string) => ({ height: 512, imageName, width: 512 });+ const image = (imageName: string) => ({ height: 512, image_name: imageName, width: 512 });+ const existingReference = {+ config: { image: { original: { image: image('existing.png') } }, model: null, type: 'ip_adapter' },+ id: 'existing',+ isEnabled: true,+ };++ const createCommands = () => {+ const add = vi.fn();+ const reportError = vi.fn();+ const setSettings = vi.fn();+ const commands = {+ generation: { setSettings } as unknown as WorkbenchCommands['generation'],+ notifications: { add, reportError } as unknown as WorkbenchCommands['notifications'],+ };++ return { add, commands, reportError, setSettings };+ };++ const committedReferenceNames = (setSettings: ReturnType<typeof vi.fn>) => {+ const [values] = setSettings.mock.calls[0] ?? [];+ const { referenceImages } = values as {+ referenceImages: { config: { image: { original: { image: { image_name: string } } } } }[];+ };+ return referenceImages.map((reference) => reference.config.image.original.image.image_name);+ };++ const run = (+ commands: ReturnType<typeof createCommands>['commands'],+ parameters: Record<string, unknown>,+ {+ generateValues = { modelKey: sdxl.key },+ getGenerateValues,+ models = [sdxl],+ owner,+ }: {+ generateValues?: Record<string, unknown>;+ getGenerateValues?: () => Record<string, unknown> | null;+ models?: ComponentModelConfig[];+ owner?: AccountScope;+ } = {}+ ) =>+ executeRecallParameters({+ commands,+ getGenerateValues: getGenerateValues ?? (() => generateValues),+ models,+ owner: owner ?? captureAccountScope(),+ parameters,+ projectId: 'project-1',+ });+++seedArchitectureCapabilities();+++ describe('executeRecallParameters', () => {+ beforeEach(() => {+ accountLifecycle.activate('test-account');+ galleryApi.galleryImages.resolveMany.mockReset();+ });++ it('commits the built values to the target project and reports what was applied', async () => {+ const { add, commands, setSettings } = createCommands();++ await expect(run(commands, { positive_prompt: 'a cat', refiner_model: 'refiner', steps: 20 })).resolves.toBe(true);++ expect(setSettings).toHaveBeenCalledWith(+ expect.objectContaining({ positivePrompt: 'a cat', steps: 20 }),+ 'project-1'+ );+ expect(add).toHaveBeenCalledWith(+ expect.objectContaining({+ kind: 'success',+ message: '2 fields applied to Generate.',+ title: 'Recalled parameters',+ })+ );+ expect(add).toHaveBeenCalledWith(+ expect.objectContaining({+ kind: 'info',+ message: 'refiner_model: not supported by the Generate panel',+ title: 'Some recalled parameters were not applied',+ })+ );+ });++ it('explains why nothing was applied instead of committing unchanged values', async () => {+ const { add, commands, setSettings } = createCommands();++ await expect(run(commands, { denoise_strength: 0.4 })).resolves.toBe(false);++ expect(setSettings).not.toHaveBeenCalled();+ expect(add).toHaveBeenCalledWith(+ expect.objectContaining({+ kind: 'info',+ message: 'denoise_strength: not supported by the Generate panel',+ title: 'No recalled parameters applied',+ })+ );+ });++ it('asks for a supported model when the project has none selected', async () => {+ const { add, commands, setSettings } = createCommands();++ await expect(run(commands, { steps: 20 }, { models: [] })).resolves.toBe(false);++ expect(setSettings).not.toHaveBeenCalled();+ expect(add).toHaveBeenCalledWith(+ expect.objectContaining({ kind: 'info', title: 'Cannot apply recalled parameters' })+ );+ });++ it('drops recalled reference images whose files are no longer in the gallery and names them', async () => {+ const { add, commands, setSettings } = createCommands();+ galleryApi.galleryImages.resolveMany.mockResolvedValue([galleryImage('present.png')]);++ await expect(+ run(commands, { reference_images: [{ image: image('present.png') }, { image: image('deleted.png') }] })+ ).resolves.toBe(true);++ expect(galleryApi.galleryImages.resolveMany).toHaveBeenCalledWith(+ ['present.png', 'deleted.png'],+ expect.any(AbortSignal)+ );+ expect(committedReferenceNames(setSettings)).toEqual(['present.png']);+ expect(add).toHaveBeenCalledWith(+ expect.objectContaining({ kind: 'info', message: 'reference_images: not found (deleted.png)' })+ );+ });++ it('keeps the existing list when every recalled reference image is missing', async () => {+ const { add, commands, setSettings } = createCommands();+ galleryApi.galleryImages.resolveMany.mockResolvedValue([]);++ await expect(+ run(+ commands,+ { reference_images: [{ image: image('deleted.png') }] },+ {+ generateValues: { modelKey: sdxl.key, referenceImages: [existingReference] },+ }+ )+ ).resolves.toBe(false);++ expect(setSettings).not.toHaveBeenCalled();+ expect(add).toHaveBeenCalledWith(+ expect.objectContaining({+ kind: 'info',+ message: 'reference_images: not found (deleted.png)',+ title: 'No recalled parameters applied',+ })+ );+ });++ it('keeps the existing list when a replacement fails entirely but other fields still apply', async () => {+ const { add, commands, setSettings } = createCommands();+ galleryApi.galleryImages.resolveMany.mockResolvedValue([]);++ await expect(+ run(+ commands,+ { positive_prompt: 'applied anyway', reference_images: [{ image: image('deleted.png') }] },+ { generateValues: { modelKey: sdxl.key, referenceImages: [existingReference] } }+ )+ ).resolves.toBe(true);++ expect(setSettings).toHaveBeenCalledWith(+ expect.objectContaining({ positivePrompt: 'applied anyway' }),+ 'project-1'+ );+ expect(committedReferenceNames(setSettings)).toEqual(['existing.png']);+ expect(add).toHaveBeenCalledWith(expect.objectContaining({ message: '1 field applied to Generate.' }));+ expect(add).toHaveBeenCalledWith(+ expect.objectContaining({ kind: 'info', message: 'reference_images: not found (deleted.png)' })+ );+ });++ it('verifies only the appended images, never the ones the project already had', async () => {+ const { commands, setSettings } = createCommands();+ galleryApi.galleryImages.resolveMany.mockResolvedValue([galleryImage('new.png')]);++ await expect(+ run(+ commands,+ { append: true, reference_images: [{ image: image('new.png') }] },+ {+ generateValues: { modelKey: sdxl.key, referenceImages: [existingReference] },+ }+ )+ ).resolves.toBe(true);++ expect(galleryApi.galleryImages.resolveMany).toHaveBeenCalledWith(['new.png'], expect.any(AbortSignal));+ expect(committedReferenceNames(setSettings)).toEqual(['existing.png', 'new.png']);+ });++ it('does not commit when the account changes during the gallery lookup', async () => {+ const { add, commands, setSettings } = createCommands();+ galleryApi.galleryImages.resolveMany.mockImplementation(() => {+ accountLifecycle.activate('someone-else');+ return Promise.resolve([galleryImage('present.png')]);+ });++ await expect(run(commands, { reference_images: [{ image: image('present.png') }] })).resolves.toBe(false);++ expect(setSettings).not.toHaveBeenCalled();+ expect(add).not.toHaveBeenCalled();+ });++ it('does not commit when the project closes during the gallery lookup', async () => {+ const { add, commands, setSettings } = createCommands();+ let projectOpen = true;+ galleryApi.galleryImages.resolveMany.mockImplementation(() => {+ projectOpen = false;+ return Promise.resolve([galleryImage('present.png')]);+ });++ await expect(+ run(+ commands,+ { reference_images: [{ image: image('present.png') }] },+ {+ getGenerateValues: () => (projectOpen ? { modelKey: sdxl.key } : null),+ }+ )+ ).resolves.toBe(false);++ expect(setSettings).not.toHaveBeenCalled();+ expect(add).not.toHaveBeenCalled();+ });++ it('reports a failed gallery lookup as an error', async () => {+ const { commands, reportError, setSettings } = createCommands();+ galleryApi.galleryImages.resolveMany.mockRejectedValue(new Error('gallery offline'));++ await expect(run(commands, { reference_images: [{ image: image('present.png') }] })).resolves.toBe(false);++ expect(setSettings).not.toHaveBeenCalled();+ expect(reportError).toHaveBeenCalledWith(+ expect.objectContaining({ area: 'recall-parameters', message: 'gallery offline', projectId: 'project-1' })+ );+ });++ it('does nothing once the account that received the event is gone', async () => {+ const { add, commands, setSettings } = createCommands();+ const owner = captureAccountScope();+ accountLifecycle.activate('someone-else');++ await expect(run(commands, { steps: 20 }, { owner })).resolves.toBe(false);++ expect(setSettings).not.toHaveBeenCalled();+ expect(add).not.toHaveBeenCalled();+ });+ });diff --cc invokeai/frontend/webv2/src/workbench/image-actions/recallParameters.test.tsindex 0000000000,d9ebac5301..b0ab779055mode 000000,100644..100644--- a/invokeai/frontend/webv2/src/workbench/image-actions/recallParameters.test.ts+++ b/invokeai/frontend/webv2/src/workbench/image-actions/recallParameters.test.ts@@@ -1,0 -1,360 +1,363 @@@+ import type { ComponentModelConfig, GenerateModelConfig, VaeModelConfig } from '@features/generation/contracts';+++import { seedArchitectureCapabilities } from '@features/generation/core/architectureCapabilities.testing';+ import {+ getDefaultGenerateSettings,+ getMaxReferenceImages,+ isSupportedGenerateModel,+ isVaeModelConfig,+ } from '@features/generation/settings';+ import { describe, expect, it } from 'vitest';++ import { getCurrentGenerateValues } from './executeImageRecall';+ import {+ buildRecallParametersSettings,+ getRecallParametersSkipMessage,+ isRecallParametersUpdatedEvent,+ } from './recallParameters';++ const makeModel = (key: string, base: string, type: string, extra: Record<string, unknown> = {}) =>+ ({ base, hash: `${key}-hash`, key, name: `${key} name`, type, ...extra }) as ComponentModelConfig;++ const sdxl = makeModel('sdxl-main', 'sdxl', 'main');+ const sd1 = makeModel('sd1-main', 'sd-1', 'main');+ const flux = makeModel('flux-main', 'flux', 'main');+ const sd3 = makeModel('sd3-main', 'sd-3', 'main');+ const sdxlLora = makeModel('sdxl-lora', 'sdxl', 'lora');+ const fluxLora = makeModel('flux-lora', 'flux', 'lora');+ const sdxlIpAdapter = makeModel('sdxl-ipa', 'sdxl', 'ip_adapter');+ const fluxRedux = makeModel('flux-redux', 'flux', 'flux_redux');+ const sdxlVae = makeModel('sdxl-vae', 'sdxl', 'vae');+ const models = [sdxl, sd1, flux, sd3, sdxlLora, fluxLora, sdxlIpAdapter, fluxRedux, sdxlVae];+ const supportedModels = models.filter(isSupportedGenerateModel) as GenerateModelConfig[];+ const vaeModels = models.filter(isVaeModelConfig) as VaeModelConfig[];++ const image = (imageName: string) => ({ height: 512, image_name: imageName, width: 512 });++ const currentFor = (model: ComponentModelConfig, overrides: Record<string, unknown> = {}) => {+ const values = getCurrentGenerateValues({ generateValues: { modelKey: model.key }, supportedModels });+ if (!values) {+ throw new Error('fixture model is not a supported Generate model');+ }+ return { ...values, ...overrides };+ };++ const build = (currentValues: ReturnType<typeof currentFor>, parameters: Record<string, unknown>) =>+ buildRecallParametersSettings({ currentValues, models, parameters, supportedModels, vaeModels });+++seedArchitectureCapabilities();+++ describe('buildRecallParametersSettings', () => {+ it('applies prompts, seed, size and sampler parameters to the current values', () => {+ const result = build(currentFor(sdxl), {+ cfg_scale: 7.5,+ height: 768,+ negative_prompt: 'blurry',+ positive_prompt: 'a cat',+ scheduler: 'euler',+ seamless_x: true,+ seed: 42,+ steps: 30,+ width: 1024,+ });++ expect(result.skipped).toEqual([]);+ expect(result.fields).toEqual(+ expect.arrayContaining(['prompts', 'seed', 'steps', 'cfg', 'scheduler', 'seamless', 'size'])+ );+ expect(result.values).toEqual(+ expect.objectContaining({+ aspectRatioId: '4:3',+ cfgScale: 7.5,+ height: 768,+ negativePrompt: 'blurry',+ positivePrompt: 'a cat',+ scheduler: 'euler',+ seamlessXAxis: true,+ seed: 42,+ shouldRandomizeSeed: false,+ steps: 30,+ width: 1024,+ })+ );+ });++ it('applies CLIP skip only where the model family exposes it', () => {+ expect(build(currentFor(sd1), { clip_skip: 2 }).values.clipSkip).toBe(2);++ const strictReset = build(currentFor(sdxl, { clipSkip: 3 }), { clip_skip: null });+ expect(strictReset.values.clipSkip).toBe(0);+ expect(strictReset.skipped).toEqual([]);+ expect(build(currentFor(sdxl), { clip_skip: 2 }).skipped).toEqual([+ { detail: sdxl.name, key: 'clip_skip', reason: 'incompatible' },+ ]);+ });++ it('switches model with its defaults, then lets explicit parameters override them', () => {+ const result = build(currentFor(sdxl, { steps: 50 }), { model: flux.key, steps: 12 });++ expect(result.fields).toEqual(expect.arrayContaining(['model', 'steps']));+ expect(result.values.model.key).toBe(flux.key);+ expect(result.values.modelKey).toBe(flux.key);+ expect(result.values.steps).toBe(12);+ expect(result.values.cfgScale).toBe(getDefaultGenerateSettings(flux as GenerateModelConfig).cfgScale);+ });++ it('retargets reference images and clears an incompatible VAE when the model family changes', () => {+ const current = currentFor(sdxl, {+ referenceImages: [+ {+ config: { image: { original: { image: image('kept.png') } }, model: sdxlIpAdapter, type: 'ip_adapter' },+ id: 'kept',+ isEnabled: true,+ },+ ],+ vae: sdxlVae,+ });+ const result = build(current, { model: flux.key });++ expect(result.fields).toEqual(['model']);+ expect(result.values.vae).toBeNull();+ expect(result.values.referenceImages).toHaveLength(1);+ expect(result.values.referenceImages[0]?.config).toEqual(+ expect.objectContaining({+ clipVisionModel: 'ViT-L',+ image: { original: { image: image('kept.png') } },+ model: null,+ type: 'ip_adapter',+ })+ );+ });++ it('resets the VAE to the model default on a null (strict-mode) vae_model', () => {+ const result = build(currentFor(sdxl, { vae: sdxlVae }), { vae_model: null });++ expect(result.fields).toEqual(['vae']);+ expect(result.values.vae).toBeNull();+ });++ it('reports an unknown model and a VAE from another family without changing the selection', () => {+ const current = currentFor(sdxl);+ const result = build(current, { model: 'not-installed', vae_model: sdxlVae.name });++ expect(result.values.model.key).toBe(sdxl.key);+ expect(result.values.vae?.key).toBe(sdxlVae.key);+ expect(result.skipped).toEqual([{ detail: 'not-installed', key: 'model', reason: 'unresolved' }]);++ const fluxResult = build(currentFor(flux), { vae_model: sdxlVae.key });+ expect(fluxResult.values.vae).toBeNull();+ expect(fluxResult.skipped).toEqual([{ detail: sdxlVae.name, key: 'vae_model', reason: 'incompatible' }]);+ });++ it('resets null (strict-mode) parameters to the model defaults and clears empty lists', () => {+ const existingReference = {+ config: { image: { original: { image: image('old.png') } }, type: 'ip_adapter' as const },+ id: 'existing',+ isEnabled: true,+ };+ const current = currentFor(sdxl, {+ loras: [{ isEnabled: true, model: sdxlLora, weight: 1 }],+ positivePrompt: 'keep me?',+ referenceImages: [{ ...existingReference, config: { ...existingReference.config, model: sdxlIpAdapter } }],+ seed: 7,+ shouldRandomizeSeed: false,+ steps: 50,+ width: 1536,+ });+ const result = build(current, {+ control_layers: [],+ ip_adapters: [],+ loras: [],+ model: null,+ positive_prompt: null,+ reference_images: [],+ refiner_model: null,+ seed: null,+ steps: null,+ width: null,+ });+ const defaults = getDefaultGenerateSettings(sdxl as GenerateModelConfig);++ expect(result.skipped).toEqual([]);+ expect(result.values).toEqual(+ expect.objectContaining({+ loras: [],+ positivePrompt: '',+ referenceImages: [],+ shouldRandomizeSeed: true,+ steps: defaults.steps,+ width: defaults.width,+ })+ );+ expect(result.values.model.key).toBe(sdxl.key);+ });++ it('builds the LoRA list from installed models, dropping unknown, incompatible and duplicate entries', () => {+ const result = build(currentFor(sdxl), {+ loras: [+ { is_enabled: false, model_key: sdxlLora.key, weight: 0.5 },+ { model_key: fluxLora.key },+ { model_key: 'missing-lora' },+ { model_key: sdxlLora.key, weight: 20 },+ ],+ });++ expect(result.fields).toEqual(['loras']);+ expect(result.values.loras).toEqual([{ isEnabled: false, model: sdxlLora, weight: 0.5 }]);+ expect(build(currentFor(sdxl), { loras: [{ model_key: sdxlLora.key }] }).values.loras).toEqual([+ { isEnabled: true, model: sdxlLora, weight: 0.75 },+ ]);+ expect(result.skipped).toEqual([+ { detail: fluxLora.name, key: 'loras', reason: 'incompatible' },+ { detail: 'missing-lora', key: 'loras', reason: 'unresolved' },+ ]);+ });++ it('builds IP adapter, FLUX Redux and model-free reference images for the effective model', () => {+ const result = build(currentFor(sdxl), {+ ip_adapters: [+ {+ begin_step_percent: 0.1,+ image: image('style.png'),+ method: 'style',+ model_key: sdxlIpAdapter.key,+ weight: 0.7,+ },+ { model_key: 'missing-adapter' },+ { model_key: sdxlIpAdapter.key },+ ],+ reference_images: [{ image: image('subject.png') }, { image: { image_name: '' } }],+ });++ expect(result.fields).toEqual(['referenceImages']);+ expect(result.values.referenceImages).toHaveLength(2);+ expect(result.values.referenceImages[0]?.config).toEqual({+ beginEndStepPct: [0.1, 1],+ clipVisionModel: 'ViT-H',+ image: { original: { image: image('style.png') } },+ method: 'style',+ model: sdxlIpAdapter,+ type: 'ip_adapter',+ weight: 0.7,+ });+ expect(result.values.referenceImages[1]?.config).toEqual(+ expect.objectContaining({ image: { original: { image: image('subject.png') } }, type: 'ip_adapter' })+ );+ expect(result.skipped).toEqual([+ { detail: 'missing-adapter', key: 'ip_adapters', reason: 'unresolved' },+ { detail: `${sdxlIpAdapter.key}: image missing`, key: 'ip_adapters', reason: 'unresolved' },+ { key: 'reference_images', reason: 'invalid' },+ ]);++ const redux = build(currentFor(flux), {+ ip_adapters: [{ image: image('redux.png'), image_influence: 'low', model_key: fluxRedux.key }],+ });+ expect(redux.values.referenceImages[0]?.config).toEqual({+ image: { original: { image: image('redux.png') } },+ imageInfluence: 'low',+ model: fluxRedux,+ type: 'flux_redux',+ });+ });++ it('appends reference images behind the existing list and enforces the model limit', () => {+ const current = currentFor(sdxl, {+ referenceImages: [+ {+ config: { image: { original: { image: image('existing.png') } }, type: 'ip_adapter', model: sdxlIpAdapter },+ id: 'existing',+ isEnabled: true,+ },+ ],+ });+ const appended = build(current, { append: true, reference_images: [{ image: image('new.png') }] });++ expect(+ appended.values.referenceImages.map((reference) => reference.config.image?.original.image.image_name)+ ).toEqual(['existing.png', 'new.png']);++ const limit = getMaxReferenceImages(sdxl as GenerateModelConfig);+ const overLimit = build(current, {+ append: true,+ reference_images: Array.from({ length: limit }, (_, index) => ({ image: image(`extra-${index}.png`) })),+ });++ expect(overLimit.values.referenceImages).toHaveLength(limit);+ expect(overLimit.skipped).toEqual([{ detail: String(limit), key: 'reference_images', reason: 'limit' }]);++ const untouched = build(current, { append: true, reference_images: [] });+ expect(untouched.fields).toEqual([]);+ expect(untouched.values.referenceImages).toEqual(current.referenceImages);+ });++ it('drops reference images for a model without reference image support and says so', () => {+ const result = build(currentFor(sd3), { reference_images: [{ image: image('subject.png') }] });++ expect(result.values.referenceImages).toEqual([]);+ expect(result.skipped).toEqual([{ detail: sd3.name, key: 'reference_images', reason: 'incompatible' }]);+ });++ it('reports parameters the Generate panel has no home for, ignoring empty lists', () => {+ const result = build(currentFor(sdxl), {+ control_layers: [{ model_key: 'controlnet' }],+ denoise_strength: 0.5,+ positive_prompt: 'still applied',+ refiner_model: 'refiner',+ });++ expect(result.fields).toEqual(['prompts']);+ expect(result.skipped.map((skip) => skip.key).sort()).toEqual([+ 'control_layers',+ 'denoise_strength',+ 'refiner_model',+ ]);+ expect(result.skipped.every((skip) => skip.reason === 'unsupported')).toBe(true);++ expect(build(currentFor(sdxl), { control_layers: [] }).skipped).toEqual([]);+ });++ it('maps guidance onto cfgScale only for guidance-driven model families', () => {+ expect(build(currentFor(flux), { guidance: 3.5 }).values.cfgScale).toBe(3.5);+ expect(build(currentFor(sdxl), { guidance: 3.5 }).skipped).toEqual([+ { detail: sdxl.name, key: 'guidance', reason: 'incompatible' },+ ]);++ const both = build(currentFor(flux), { cfg_scale: 4, guidance: 3.5 });+ expect(both.values.cfgScale).toBe(4);+ expect(both.skipped).toEqual([{ detail: 'cfg_scale was also provided', key: 'guidance', reason: 'unsupported' }]);++ const invalidCfg = build(currentFor(flux), { cfg_scale: 0.5, guidance: 3.5 });+ expect(invalidCfg.values.cfgScale).toBe(3.5);+ expect(invalidCfg.skipped).toEqual([{ key: 'cfg_scale', reason: 'invalid' }]);+ });++ it('flags out-of-range scalars instead of applying them', () => {+ const result = build(currentFor(sdxl), { seed: -1, steps: 0, width: 10 });++ expect(result.fields).toEqual([]);+ expect(result.skipped.map((skip) => skip.key).sort()).toEqual(['seed', 'steps', 'width']);+ });+ });++ describe('getRecallParametersSkipMessage', () => {+ it('names every skipped parameter with its reason and detail', () => {+ expect(+ getRecallParametersSkipMessage([+ { detail: 'pixel-art', key: 'loras', reason: 'incompatible' },+ { key: 'refiner_model', reason: 'unsupported' },+ { detail: '5', key: 'reference_images', reason: 'limit' },+ ])+ ).toBe(+ 'loras: incompatible with the current model (pixel-art); refiner_model: not supported by the Generate panel; reference_images: over the reference image limit (5)'+ );+ });+ });++ describe('isRecallParametersUpdatedEvent', () => {+ it('accepts the backend envelope and rejects payloads without a parameters object', () => {+ expect(isRecallParametersUpdatedEvent({ parameters: { steps: 1 }, queue_id: 'default', user_id: 'u' })).toBe(true);+ expect(isRecallParametersUpdatedEvent({ parameters: [], queue_id: 'default', user_id: 'u' })).toBe(false);+ expect(isRecallParametersUpdatedEvent({ queue_id: 'default', user_id: 'u' })).toBe(false);+ expect(isRecallParametersUpdatedEvent(null)).toBe(false);+ });+ });diff --cc invokeai/frontend/webv2/src/workbench/image-actions/recallParametersRuntime.test.tsindex 0000000000,c364f93495..bab84606e9mode 000000,100644..100644--- a/invokeai/frontend/webv2/src/workbench/image-actions/recallParametersRuntime.test.ts+++ b/invokeai/frontend/webv2/src/workbench/image-actions/recallParametersRuntime.test.ts@@@ -1,0 -1,272 +1,276 @@@+ import type { ComponentModelConfig } from '@features/generation/contracts';+ import type { ModelsSnapshot } from '@features/models';+ import type { SocketHub } from '@platform/transport/socketHub';++ import { accountLifecycle } from '@platform/state/accountLifecycle';+ import { getProjectWidgetValues } from '@workbench/widgetState';+ import { createWorkbenchStore } from '@workbench/workbenchStore';+ import { beforeEach, describe, expect, it, vi } from 'vitest';++ const galleryApi = vi.hoisted(() => ({+ galleryImages: {+ metadata: vi.fn(),+ resolveMany: vi.fn(),+ },+ }));+ const modelsApi = vi.hoisted(() => ({+ ensureModelsLoaded: vi.fn(),+ getModelsSnapshot: vi.fn(),+ }));++ vi.mock('@features/gallery', () => galleryApi);+ vi.mock('@features/models', () => modelsApi);+++import { seedArchitectureCapabilities } from '@features/generation/core/architectureCapabilities.testing';+++ import { createRecallParametersRuntime } from './recallParametersRuntime';++ type SocketHandler = (payload: never) => void;++ const createFakeSocketHub = () => {+ const handlers = new Map<string, Set<SocketHandler>>();+ const hub: Pick<SocketHub, 'on'> = {+ on: (event, handler) => {+ const eventHandlers = handlers.get(event) ?? new Set<SocketHandler>();+ eventHandlers.add(handler);+ handlers.set(event, eventHandlers);+ return () => eventHandlers.delete(handler);+ },+ };++ return {+ emit: (event: string, payload: unknown) => {+ for (const handler of handlers.get(event) ?? []) {+ handler(payload as never);+ }+ },+ handlerCount: () => [...handlers.values()].reduce((count, eventHandlers) => count + eventHandlers.size, 0),+ hub,+ };+ };++ const sdxl = { base: 'sdxl', hash: 'h', key: 'sdxl-main', name: 'SDXL', type: 'main' } as ComponentModelConfig;+ const image = (imageName: string) => ({ height: 512, image_name: imageName, width: 512 });+ const event = (parameters: Record<string, unknown>, userId = 'owner') => ({+ parameters,+ queue_id: 'default',+ user_id: userId,+ });++ const flush = () =>+ new Promise<void>((resolve) => {+ setTimeout(resolve, 0);+ });++ const snapshot = (overrides: Partial<ModelsSnapshot> = {}): ModelsSnapshot =>+ ({ error: null, models: [sdxl], status: 'loaded', ...overrides }) as ModelsSnapshot;++ const referenceNames = (values: Record<string, unknown>) =>+ (values.referenceImages as { config: { image: { original: { image: { image_name: string } } } } }[]).map(+ (reference) => reference.config.image.original.image.image_name+ );++ const promptOf = (store: ReturnType<typeof createWorkbenchStore>, projectId: string) => {+ const project = store.queries.getProject(projectId);+ return project ? getProjectWidgetValues(project, 'generate').positivePrompt : 'project missing';+ };++ const createRuntime = (+ store: ReturnType<typeof createWorkbenchStore>,+ hub: Pick<SocketHub, 'on'>,+ options: Partial<Parameters<typeof createRecallParametersRuntime>[0]> = {}+ ) => createRecallParametersRuntime({ commands: store.commands, hub, queries: store.queries, ...options });+++seedArchitectureCapabilities();+++ describe('createRecallParametersRuntime', () => {+ beforeEach(() => {+ accountLifecycle.activate('owner');+ galleryApi.galleryImages.resolveMany.mockReset();+ galleryApi.galleryImages.resolveMany.mockImplementation((imageNames: string[]) =>+ Promise.resolve(imageNames.map((imageName) => ({ height: 512, imageName, width: 512 })))+ );+ modelsApi.ensureModelsLoaded.mockReset();+ modelsApi.ensureModelsLoaded.mockResolvedValue(undefined);+ modelsApi.getModelsSnapshot.mockReset();+ modelsApi.getModelsSnapshot.mockReturnValue(snapshot());+ });++ it('applies the event to the project that was active when it arrived', async () => {+ const store = createWorkbenchStore();+ const socket = createFakeSocketHub();+ const firstProjectId = store.queries.getSnapshot().activeProject.id;+ let releaseModels: () => void = () => {};+ modelsApi.ensureModelsLoaded.mockImplementation(+ () =>+ new Promise<void>((resolve) => {+ releaseModels = resolve;+ })+ );+ const runtime = createRuntime(store, socket.hub);++ socket.emit('recall_parameters_updated', event({ positive_prompt: 'for the first project' }));+ const secondProject = store.commands.projects.create();+ expect(store.queries.getSnapshot().activeProject.id).toBe(secondProject.id);++ await flush();+ releaseModels();+ await flush();++ expect(promptOf(store, firstProjectId)).toBe('for the first project');+ expect(promptOf(store, secondProject.id)).toBeUndefined();+ expect(store.queries.getSnapshot().notifications.at(-1)).toEqual(+ expect.objectContaining({ kind: 'success', title: 'Recalled parameters' })+ );++ runtime.dispose();+ });++ it('applies replayed events first, each to the project recorded for it', async () => {+ const store = createWorkbenchStore();+ const socket = createFakeSocketHub();+ const firstProjectId = store.queries.getSnapshot().activeProject.id;+ const secondProject = store.commands.projects.create();+ const runtime = createRuntime(store, socket.hub, {+ replay: [{ payload: event({ positive_prompt: 'buffered' }), projectId: firstProjectId }],+ });++ socket.emit('recall_parameters_updated', event({ positive_prompt: 'live' }));+ await flush();++ expect(promptOf(store, firstProjectId)).toBe('buffered');+ expect(promptOf(store, secondProject.id)).toBe('live');++ runtime.dispose();+ });++ it('applies events in arrival order so an append sees the replace before it', async () => {+ const store = createWorkbenchStore();+ const socket = createFakeSocketHub();+ const projectId = store.queries.getSnapshot().activeProject.id;+ const runtime = createRuntime(store, socket.hub);++ socket.emit('recall_parameters_updated', event({ reference_images: [{ image: image('replace.png') }] }));+ socket.emit(+ 'recall_parameters_updated',+ event({ append: true, reference_images: [{ image: image('append.png') }] })+ );+ await flush();++ const project = store.queries.getProject(projectId);+ expect(project && referenceNames(getProjectWidgetValues(project, 'generate'))).toEqual([+ 'replace.png',+ 'append.png',+ ]);++ runtime.dispose();+ });++ it('ignores other users’ events in multi-user mode', async () => {+ const store = createWorkbenchStore();+ const socket = createFakeSocketHub();+ const projectId = store.queries.getSnapshot().activeProject.id;+ const runtime = createRuntime(store, socket.hub, { getSessionUserId: () => 'owner' });++ socket.emit('recall_parameters_updated', event({ positive_prompt: 'someone else' }, 'other-user'));+ socket.emit('recall_parameters_updated', event({ positive_prompt: 'mine' }, 'owner'));+ await flush();++ expect(promptOf(store, projectId)).toBe('mine');+ expect(store.queries.getSnapshot().notifications).toHaveLength(1);++ runtime.dispose();+ });++ it('ignores malformed payloads', async () => {+ const store = createWorkbenchStore();+ const socket = createFakeSocketHub();+ const projectId = store.queries.getSnapshot().activeProject.id;+ const runtime = createRuntime(store, socket.hub);++ socket.emit('recall_parameters_updated', { queue_id: 'default', user_id: 'owner' });+ await flush();++ expect(promptOf(store, projectId)).toBeUndefined();+ expect(store.queries.getSnapshot().notifications).toEqual([]);++ runtime.dispose();+ });++ it('drops work for an account scope that expired before it ran', async () => {+ const store = createWorkbenchStore();+ const socket = createFakeSocketHub();+ const projectId = store.queries.getSnapshot().activeProject.id;+ const runtime = createRuntime(store, socket.hub);++ socket.emit('recall_parameters_updated', event({ positive_prompt: 'stale' }));+ accountLifecycle.activate('other-account');+ await flush();++ expect(promptOf(store, projectId)).toBeUndefined();+ expect(store.queries.getSnapshot().notifications).toEqual([]);++ runtime.dispose();+ });++ it('detaches on dispose and ignores later events', async () => {+ const store = createWorkbenchStore();+ const socket = createFakeSocketHub();+ const projectId = store.queries.getSnapshot().activeProject.id;+ const runtime = createRuntime(store, socket.hub);++ expect(socket.handlerCount()).toBe(1);+ runtime.dispose();+ runtime.dispose();+ expect(socket.handlerCount()).toBe(0);++ socket.emit('recall_parameters_updated', event({ positive_prompt: 'after dispose' }));+ await flush();++ expect(promptOf(store, projectId)).toBeUndefined();+ });++ it('reports a model catalog failure and still applies the next event', async () => {+ const store = createWorkbenchStore();+ const socket = createFakeSocketHub();+ const projectId = store.queries.getSnapshot().activeProject.id;+ modelsApi.getModelsSnapshot.mockReturnValueOnce(+ snapshot({ error: 'catalog offline', models: [], status: 'error' })+ );+ const runtime = createRuntime(store, socket.hub);++ socket.emit('recall_parameters_updated', event({ positive_prompt: 'unreachable' }));+ await flush();++ expect(promptOf(store, projectId)).toBeUndefined();+ expect(store.queries.getSnapshot().notifications.at(-1)).toEqual(+ expect.objectContaining({ kind: 'error', message: 'catalog offline' })+ );++ socket.emit('recall_parameters_updated', event({ positive_prompt: 'after recovery' }));+ await flush();++ expect(promptOf(store, projectId)).toBe('after recovery');++ runtime.dispose();+ });++ it('keeps the chain alive when applying one event throws', async () => {+ const store = createWorkbenchStore();+ const socket = createFakeSocketHub();+ const projectId = store.queries.getSnapshot().activeProject.id;+ modelsApi.ensureModelsLoaded.mockRejectedValueOnce(new Error('unexpected'));+ const runtime = createRuntime(store, socket.hub);++ socket.emit('recall_parameters_updated', event({ positive_prompt: 'first' }));+ socket.emit('recall_parameters_updated', event({ positive_prompt: 'second' }));+ await flush();++ expect(store.queries.getSnapshot().notifications).toContainEqual(+ expect.objectContaining({ kind: 'error', message: 'unexpected' })+ );+ expect(promptOf(store, projectId)).toBe('second');++ runtime.dispose();+ });+ });