Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.
TypeScript ai-artartificial-intelligencegenerative-artimage-generationimg2imginpaintinglatent-diffusionlinuxmacosoutpaintingstable-diffusiontxt2imgwindows
feat(properties): Select Object form and gesture cards (U4)
Josh Corbett3933e6eb86f5
diff --git a/invokeai/frontend/webv2/performance/browser-baseline.json b/invokeai/frontend/webv2/performance/browser-baseline.jsonindex 978db999a8..46703d05af 100644--- a/invokeai/frontend/webv2/performance/browser-baseline.json+++ b/invokeai/frontend/webv2/performance/browser-baseline.json@@ -25,12 +25,12 @@"scriptRequestCount": 0,"totalRawBytes": 0},- "domContentLoadedMedianMs": 118.29999999701977,+ "domContentLoadedMedianMs": 117.6000000089407,"id": "launchpad","layoutAckMedianMs": 0,"layoutReturnSwitchMedianMs": 0,"layoutSwitchMedianMs": 0,- "loadMedianMs": 118.5,+ "loadMedianMs": 117.70000000298023,"longestTaskMaxMs": 70,"owner": "app","projectSwitchMedianMs": 0,@@ -41,24 +41,24 @@"fontRawBytes": 23664,"imageRawBytes": 0,"largestAssetRawBytes": 746400,- "otherRawBytes": 161908,+ "otherRawBytes": 162513,"requestCount": 38,"scriptRawBytes": 1636642,"scriptRequestCount": 34,- "totalRawBytes": 1824373+ "totalRawBytes": 1824978},"resourceLimits": {"cssRawBytes": 2181,"fontRawBytes": 23901,"imageRawBytes": 0,"largestAssetRawBytes": 753864,- "otherRawBytes": 163528,+ "otherRawBytes": 164139,"requestCount": 38,"scriptRawBytes": 1653009,"scriptRequestCount": 34,- "totalRawBytes": 1842617+ "totalRawBytes": 1843228},- "routeReadyMedianMs": 262.6000000089407,+ "routeReadyMedianMs": 265.09999999403954,"scriptSourceOwnerSet": "launchpad-static","stateProfile": "empty"},@@ -85,13 +85,13 @@"scriptRequestCount": 0,"totalRawBytes": 0},- "domContentLoadedMedianMs": 115.19999998807907,+ "domContentLoadedMedianMs": 117.3999999910593,"id": "launchpad","layoutAckMedianMs": 0,"layoutReturnSwitchMedianMs": 0,"layoutSwitchMedianMs": 0,- "loadMedianMs": 115.29999999701977,- "longestTaskMaxMs": 70,+ "loadMedianMs": 117.5,+ "longestTaskMaxMs": 74,"owner": "app","projectSwitchMedianMs": 0,"readyMark": "invokeai:ready:launchpad",@@ -101,24 +101,24 @@"fontRawBytes": 23664,"imageRawBytes": 0,"largestAssetRawBytes": 746400,- "otherRawBytes": 161908,+ "otherRawBytes": 162513,"requestCount": 38,"scriptRawBytes": 1636642,"scriptRequestCount": 34,- "totalRawBytes": 1824373+ "totalRawBytes": 1824978},"resourceLimits": {"cssRawBytes": 2181,"fontRawBytes": 23901,"imageRawBytes": 0,"largestAssetRawBytes": 753864,- "otherRawBytes": 163528,+ "otherRawBytes": 164139,"requestCount": 38,"scriptRawBytes": 1653009,"scriptRequestCount": 34,- "totalRawBytes": 1842617+ "totalRawBytes": 1843228},- "routeReadyMedianMs": 278.69999998807907,+ "routeReadyMedianMs": 278.40000000596046,"scriptSourceOwnerSet": "launchpad-static","stateProfile": "representative"},@@ -145,15 +145,15 @@"scriptRequestCount": 0,"totalRawBytes": 0},- "domContentLoadedMedianMs": 115,+ "domContentLoadedMedianMs": 119.3999999910593,"id": "editor-minimal","layoutAckMedianMs": 0,"layoutReturnSwitchMedianMs": 0,"layoutSwitchMedianMs": 0,- "loadMedianMs": 115.09999999403954,- "longestTaskMaxMs": 96,+ "loadMedianMs": 119.5,+ "longestTaskMaxMs": 129,"owner": "workbench",- "projectSwitchMedianMs": 35.599999994039536,+ "projectSwitchMedianMs": 37.599999994039536,"readyMark": "invokeai:ready:widget:center:preview","remediationTicket": "deepen-widget-registry-loading","resourceBaseline": {@@ -161,24 +161,24 @@"fontRawBytes": 23664,"imageRawBytes": 156376,"largestAssetRawBytes": 746400,- "otherRawBytes": 161908,+ "otherRawBytes": 162513,"requestCount": 115,"scriptRawBytes": 3287526,"scriptRequestCount": 110,- "totalRawBytes": 3631633+ "totalRawBytes": 3632238},"resourceLimits": {"cssRawBytes": 2181,"fontRawBytes": 23901,"imageRawBytes": 157940,"largestAssetRawBytes": 753864,- "otherRawBytes": 163528,+ "otherRawBytes": 164139,"requestCount": 115,"scriptRawBytes": 3320402,"scriptRequestCount": 110,- "totalRawBytes": 3667950+ "totalRawBytes": 3668561},- "routeReadyMedianMs": 657.7999999970198,+ "routeReadyMedianMs": 678.1000000089407,"scriptSourceOwnerSet": "editor-minimal-static","stateProfile": "empty"},@@ -205,15 +205,15 @@"scriptRequestCount": 0,"totalRawBytes": 0},- "domContentLoadedMedianMs": 113.79999999701977,+ "domContentLoadedMedianMs": 120.29999999701977,"id": "editor-minimal","layoutAckMedianMs": 0,"layoutReturnSwitchMedianMs": 0,"layoutSwitchMedianMs": 0,- "loadMedianMs": 113.90000000596046,- "longestTaskMaxMs": 172,+ "loadMedianMs": 120.40000000596046,+ "longestTaskMaxMs": 197,"owner": "workbench",- "projectSwitchMedianMs": 70.59999999403954,+ "projectSwitchMedianMs": 71.5,"readyMark": "invokeai:ready:widget:center:preview","remediationTicket": "deepen-widget-registry-loading","resourceBaseline": {@@ -221,24 +221,24 @@"fontRawBytes": 23664,"imageRawBytes": 156376,"largestAssetRawBytes": 746400,- "otherRawBytes": 161908,+ "otherRawBytes": 162513,"requestCount": 115,"scriptRawBytes": 3287526,"scriptRequestCount": 110,- "totalRawBytes": 3631633+ "totalRawBytes": 3632238},"resourceLimits": {"cssRawBytes": 2181,"fontRawBytes": 23901,"imageRawBytes": 157940,"largestAssetRawBytes": 753864,- "otherRawBytes": 163528,+ "otherRawBytes": 164139,"requestCount": 115,"scriptRawBytes": 3320402,"scriptRequestCount": 110,- "totalRawBytes": 3667950+ "totalRawBytes": 3668561},- "routeReadyMedianMs": 437.19999998807907,+ "routeReadyMedianMs": 453.20000000298023,"scriptSourceOwnerSet": "editor-minimal-static","stateProfile": "representative"},@@ -247,31 +247,31 @@"cssRawBytes": 0,"fontRawBytes": 0,"imageRawBytes": 0,- "largestAssetRawBytes": 312386,+ "largestAssetRawBytes": 316058,"otherRawBytes": 0,"requestCount": 7,- "scriptRawBytes": 472020,+ "scriptRawBytes": 475692,"scriptRequestCount": 7,- "totalRawBytes": 472020+ "totalRawBytes": 475692},"activatedResourceLimits": {"cssRawBytes": 0,"fontRawBytes": 0,"imageRawBytes": 0,- "largestAssetRawBytes": 315510,+ "largestAssetRawBytes": 319219,"otherRawBytes": 0,"requestCount": 7,- "scriptRawBytes": 476741,+ "scriptRawBytes": 480449,"scriptRequestCount": 7,- "totalRawBytes": 476741+ "totalRawBytes": 480449},- "domContentLoadedMedianMs": 117.29999999701977,+ "domContentLoadedMedianMs": 118.5,"id": "editor-canvas",- "layoutAckMedianMs": 2.2999999970197678,- "layoutReturnSwitchMedianMs": 54.79999999701977,- "layoutSwitchMedianMs": 93.5,- "loadMedianMs": 117.3999999910593,- "longestTaskMaxMs": 124,+ "layoutAckMedianMs": 2.300000011920929,+ "layoutReturnSwitchMedianMs": 55.29999999701977,+ "layoutSwitchMedianMs": 95.29999999701977,+ "loadMedianMs": 118.59999999403954,+ "longestTaskMaxMs": 135,"owner": "canvas","projectSwitchMedianMs": 0,"readyMark": "invokeai:ready:widget:center:canvas",@@ -281,24 +281,24 @@"fontRawBytes": 23664,"imageRawBytes": 156376,"largestAssetRawBytes": 746400,- "otherRawBytes": 161908,+ "otherRawBytes": 162513,"requestCount": 122,- "scriptRawBytes": 3759546,+ "scriptRawBytes": 3763218,"scriptRequestCount": 117,- "totalRawBytes": 4103653+ "totalRawBytes": 4107930},"resourceLimits": {"cssRawBytes": 2181,"fontRawBytes": 23901,"imageRawBytes": 157940,"largestAssetRawBytes": 753864,- "otherRawBytes": 163528,+ "otherRawBytes": 164139,"requestCount": 122,- "scriptRawBytes": 3797142,+ "scriptRawBytes": 3800851,"scriptRequestCount": 117,- "totalRawBytes": 4144690+ "totalRawBytes": 4149010},- "routeReadyMedianMs": 1060.2000000029802,+ "routeReadyMedianMs": 1061.5,"scriptSourceOwnerSet": "editor-canvas-static","stateProfile": "empty"},@@ -307,31 +307,31 @@"cssRawBytes": 0,"fontRawBytes": 0,"imageRawBytes": 0,- "largestAssetRawBytes": 312386,+ "largestAssetRawBytes": 316058,"otherRawBytes": 0,"requestCount": 7,- "scriptRawBytes": 472020,+ "scriptRawBytes": 475692,"scriptRequestCount": 7,- "totalRawBytes": 472020+ "totalRawBytes": 475692},"activatedResourceLimits": {"cssRawBytes": 0,"fontRawBytes": 0,"imageRawBytes": 0,- "largestAssetRawBytes": 315510,+ "largestAssetRawBytes": 319219,"otherRawBytes": 0,"requestCount": 7,- "scriptRawBytes": 476741,+ "scriptRawBytes": 480449,"scriptRequestCount": 7,- "totalRawBytes": 476741+ "totalRawBytes": 480449},- "domContentLoadedMedianMs": 116.3999999910593,+ "domContentLoadedMedianMs": 114.5,"id": "editor-canvas",- "layoutAckMedianMs": 2.5,- "layoutReturnSwitchMedianMs": 44.599999994039536,- "layoutSwitchMedianMs": 90.8999999910593,- "loadMedianMs": 116.5,- "longestTaskMaxMs": 184,+ "layoutAckMedianMs": 2.699999988079071,+ "layoutReturnSwitchMedianMs": 44.900000005960464,+ "layoutSwitchMedianMs": 94.69999998807907,+ "loadMedianMs": 114.6000000089407,+ "longestTaskMaxMs": 200,"owner": "canvas","projectSwitchMedianMs": 0,"readyMark": "invokeai:ready:widget:center:canvas",@@ -341,24 +341,24 @@"fontRawBytes": 23664,"imageRawBytes": 156376,"largestAssetRawBytes": 746400,- "otherRawBytes": 161908,+ "otherRawBytes": 162513,"requestCount": 122,- "scriptRawBytes": 3759546,+ "scriptRawBytes": 3763218,"scriptRequestCount": 117,- "totalRawBytes": 4103653+ "totalRawBytes": 4107930},"resourceLimits": {"cssRawBytes": 2181,"fontRawBytes": 23901,"imageRawBytes": 157940,"largestAssetRawBytes": 753864,- "otherRawBytes": 163528,+ "otherRawBytes": 164139,"requestCount": 122,- "scriptRawBytes": 3797142,+ "scriptRawBytes": 3800851,"scriptRequestCount": 117,- "totalRawBytes": 4144690+ "totalRawBytes": 4149010},- "routeReadyMedianMs": 1159.5,+ "routeReadyMedianMs": 1149.699999988079,"scriptSourceOwnerSet": "editor-canvas-static","stateProfile": "representative"},@@ -385,13 +385,13 @@"scriptRequestCount": 6,"totalRawBytes": 383431},- "domContentLoadedMedianMs": 115.59999999403954,+ "domContentLoadedMedianMs": 118.79999999701977,"id": "editor-workflow",- "layoutAckMedianMs": 2.300000011920929,- "layoutReturnSwitchMedianMs": 33.19999998807907,- "layoutSwitchMedianMs": 93.59999999403954,- "loadMedianMs": 115.79999999701977,- "longestTaskMaxMs": 98,+ "layoutAckMedianMs": 2.2000000029802322,+ "layoutReturnSwitchMedianMs": 34.20000000298023,+ "layoutSwitchMedianMs": 90.09999999403954,+ "loadMedianMs": 118.8999999910593,+ "longestTaskMaxMs": 96,"owner": "workflow","projectSwitchMedianMs": 0,"readyMark": "invokeai:ready:widget:center:workflow",@@ -401,24 +401,24 @@"fontRawBytes": 23664,"imageRawBytes": 156376,"largestAssetRawBytes": 746400,- "otherRawBytes": 161908,+ "otherRawBytes": 162513,"requestCount": 122,"scriptRawBytes": 3651747,"scriptRequestCount": 116,- "totalRawBytes": 4011267+ "totalRawBytes": 4011872},"resourceLimits": {"cssRawBytes": 17748,"fontRawBytes": 23901,"imageRawBytes": 157940,"largestAssetRawBytes": 753864,- "otherRawBytes": 163528,+ "otherRawBytes": 164139,"requestCount": 122,"scriptRawBytes": 3688265,"scriptRequestCount": 116,- "totalRawBytes": 4051380+ "totalRawBytes": 4051991},- "routeReadyMedianMs": 1057.7999999970198,+ "routeReadyMedianMs": 1056.0999999940395,"scriptSourceOwnerSet": "editor-workflow-static","stateProfile": "empty"},@@ -445,13 +445,13 @@"scriptRequestCount": 6,"totalRawBytes": 383431},- "domContentLoadedMedianMs": 116.90000000596046,+ "domContentLoadedMedianMs": 118.8999999910593,"id": "editor-workflow",- "layoutAckMedianMs": 2.4000000059604645,- "layoutReturnSwitchMedianMs": 40.900000005960464,- "layoutSwitchMedianMs": 125.30000001192093,- "loadMedianMs": 117,- "longestTaskMaxMs": 352,+ "layoutAckMedianMs": 3.0999999940395355,+ "layoutReturnSwitchMedianMs": 41.29999999701977,+ "layoutSwitchMedianMs": 126.5,+ "loadMedianMs": 119.09999999403954,+ "longestTaskMaxMs": 342,"owner": "workflow","projectSwitchMedianMs": 0,"readyMark": "invokeai:ready:widget:center:workflow",@@ -461,24 +461,24 @@"fontRawBytes": 23664,"imageRawBytes": 156376,"largestAssetRawBytes": 746400,- "otherRawBytes": 161908,+ "otherRawBytes": 162513,"requestCount": 122,"scriptRawBytes": 3651747,"scriptRequestCount": 116,- "totalRawBytes": 4011267+ "totalRawBytes": 4011872},"resourceLimits": {"cssRawBytes": 17748,"fontRawBytes": 23901,"imageRawBytes": 157940,"largestAssetRawBytes": 753864,- "otherRawBytes": 163528,+ "otherRawBytes": 164139,"requestCount": 122,"scriptRawBytes": 3688265,"scriptRequestCount": 116,- "totalRawBytes": 4051380+ "totalRawBytes": 4051991},- "routeReadyMedianMs": 1177.7000000029802,+ "routeReadyMedianMs": 1188.4000000059605,"scriptSourceOwnerSet": "editor-workflow-static","stateProfile": "representative"},@@ -505,13 +505,13 @@"scriptRequestCount": 0,"totalRawBytes": 0},- "domContentLoadedMedianMs": 117.09999999403954,+ "domContentLoadedMedianMs": 116.8999999910593,"id": "editor-gallery","layoutAckMedianMs": 0,"layoutReturnSwitchMedianMs": 0,- "layoutSwitchMedianMs": 26,- "loadMedianMs": 117.29999999701977,- "longestTaskMaxMs": 101,+ "layoutSwitchMedianMs": 25.799999997019768,+ "loadMedianMs": 117.09999999403954,+ "longestTaskMaxMs": 103,"owner": "gallery","projectSwitchMedianMs": 0,"readyMark": "invokeai:ready:widget:center:gallery",@@ -521,24 +521,24 @@"fontRawBytes": 23664,"imageRawBytes": 156376,"largestAssetRawBytes": 746400,- "otherRawBytes": 161908,+ "otherRawBytes": 162513,"requestCount": 115,"scriptRawBytes": 3287526,"scriptRequestCount": 110,- "totalRawBytes": 3631633+ "totalRawBytes": 3632238},"resourceLimits": {"cssRawBytes": 2181,"fontRawBytes": 23901,"imageRawBytes": 157940,"largestAssetRawBytes": 753864,- "otherRawBytes": 163528,+ "otherRawBytes": 164139,"requestCount": 115,"scriptRawBytes": 3320402,"scriptRequestCount": 110,- "totalRawBytes": 3667950+ "totalRawBytes": 3668561},- "routeReadyMedianMs": 1259,+ "routeReadyMedianMs": 1264.1000000089407,"scriptSourceOwnerSet": "editor-minimal-static","stateProfile": "empty"},@@ -565,13 +565,13 @@"scriptRequestCount": 0,"totalRawBytes": 0},- "domContentLoadedMedianMs": 119.5,+ "domContentLoadedMedianMs": 117.70000000298023,"id": "editor-gallery","layoutAckMedianMs": 0,"layoutReturnSwitchMedianMs": 0,- "layoutSwitchMedianMs": 89.90000000596046,- "loadMedianMs": 119.59999999403954,- "longestTaskMaxMs": 180,+ "layoutSwitchMedianMs": 86.29999999701977,+ "loadMedianMs": 117.79999999701977,+ "longestTaskMaxMs": 183,"owner": "gallery","projectSwitchMedianMs": 0,"readyMark": "invokeai:ready:widget:center:gallery",@@ -581,24 +581,24 @@"fontRawBytes": 23664,"imageRawBytes": 156376,"largestAssetRawBytes": 746400,- "otherRawBytes": 161908,+ "otherRawBytes": 162513,"requestCount": 115,"scriptRawBytes": 3287526,"scriptRequestCount": 110,- "totalRawBytes": 3631633+ "totalRawBytes": 3632238},"resourceLimits": {"cssRawBytes": 2181,"fontRawBytes": 23901,"imageRawBytes": 157940,"largestAssetRawBytes": 753864,- "otherRawBytes": 163528,+ "otherRawBytes": 164139,"requestCount": 115,"scriptRawBytes": 3320402,"scriptRequestCount": 110,- "totalRawBytes": 3667950+ "totalRawBytes": 3668561},- "routeReadyMedianMs": 1456.5,+ "routeReadyMedianMs": 1435.1000000089407,"scriptSourceOwnerSet": "editor-minimal-static","stateProfile": "representative"}@@ -2836,6 +2836,7 @@"source:src/workbench/widgets/canvas/tool-options/TextOptions.tsx","source:src/workbench/widgets/canvas/tool-options/geometryForm.tsx","source:src/workbench/widgets/canvas/tool-options/gradientStops.ts",+ "source:src/workbench/widgets/canvas/tool-options/hintForms.tsx","source:src/workbench/widgets/canvas/tool-options/paintForm.tsx","source:src/workbench/widgets/canvas/tool-options/selectionForm.tsx","source:src/workbench/widgets/canvas/tool-options/useBboxEditor.ts",diff --git a/invokeai/frontend/webv2/public/locales/en.json b/invokeai/frontend/webv2/public/locales/en.jsonindex 61bc9f417b..9a34c72a35 100644--- a/invokeai/frontend/webv2/public/locales/en.json+++ b/invokeai/frontend/webv2/public/locales/en.json@@ -1526,6 +1526,8 @@"noCanvas": "Open a canvas to edit its properties.","groups": {"settings": "Settings",+ "gestures": "Gestures",+ "input": "Input","stroke": "Stroke","dynamics": "Dynamics","shape": "Shape",@@ -1537,6 +1539,32 @@"selection": "Selection"},"foreground": "Foreground",+ "gestures": {+ "click": "Click",+ "drag": "Drag",+ "scroll": "Scroll",+ "shiftClick": "Shift+Click",+ "clickPoint": "Click a point",+ "holdAlt": "Hold Alt",+ "holdSpace": "Hold Space"+ },+ "hints": {+ "view": {+ "drag": "Pan the canvas.",+ "scroll": "Zoom in and out.",+ "hold": "Pan from any tool; release to return."+ },+ "colorPicker": {+ "click": "Sample the color under the cursor into the active color target.",+ "hold": "Sample from any tool; release to keep painting with the picked color."+ },+ "sam": {+ "click": "Place a point with the current label.",+ "shiftClick": "Place a point with the opposite label.",+ "clickPoint": "Remove that point.",+ "drag": "Draw or adjust the search box."+ }+ },"target": {"defaults": "Defaults","editing": "Editing: {{name}}",@@ -2411,11 +2439,6 @@"refusedNodeLimit": "The canvas can't hold more than 10,000 layers and groups."},"surface": "Canvas surface",- "toolHints": {- "colorPicker": "Click the canvas to sample a color.",- "sam": "Click an object to select it.",- "view": "Drag to pan and scroll to zoom."- },"toolOptions": {"brushColor": "Brush color","brushSize": "Brush size",diff --git a/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-options/SamOptions.test.ts b/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-options/SamOptions.test.tsindex 5a55cb619b..eae998295a 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-options/SamOptions.test.ts+++ b/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-options/SamOptions.test.ts@@ -17,11 +17,9 @@ import {getSamErrorTranslationKey,getSamStatusTranslationKey,keepSamImageIntermediate,- SamModes,- SamMore,+ selectObjectOperationForm,SamPromptBody,SamModeToggle,- SamStatus,SamStatusSlot,SamVisualInput,} from './SamOptions';@@ -485,25 +483,33 @@ describe('select object regions', () => {createElement(I18nextProvider, { i18n: testI18n }, element)));- const modes = render(createElement(SamModes, { engine: engine as never, isSurfaceInteractionLocked: false }));- const more = render(createElement(SamMore, { engine: engine as never, isSurfaceInteractionLocked: false }));- const status = render(createElement(SamStatus, { engine: engine as never, isExternalInteractionLocked: false }));-- expect(modes.indexOf('>Visual<')).toBeLessThan(modes.indexOf('aria-label="Include 1"'));- expect(modes).not.toContain('>Invert<');- expect(modes).not.toContain('>Process<');-- expect(more.indexOf('>Invert<')).toBeLessThan(more.indexOf('No bounding box'));- expect(more).toContain('aria-label="Select Object settings"');- expect(more.indexOf('aria-label="Select Object settings"')).toBeLessThan(more.indexOf('>Process<'));- expect(more.indexOf('>Process<')).toBeLessThan(more.indexOf('>Reset<'));- expect(more.indexOf('>Reset<')).toBeLessThan(more.indexOf('aria-label="Save As"'));- for (const target of ['Selection', 'Raster layer', 'Control layer']) {- expect(more).toContain(`>${target}<`);- }-- expect(status).toContain('Layer 1 · Raster layer · 1024 × 768');- expect(status.indexOf('>Select Object<')).toBeLessThan(status.indexOf('>Apply<'));- expect(status.indexOf('>Apply<')).toBeLessThan(status.indexOf('>Cancel<'));+ const [inputGroup, settingsGroup] = selectObjectOperationForm.groups;+ const input = render(+ createElement(inputGroup!.body, { engine: engine as never, isSurfaceInteractionLocked: false })+ );+ const settings = render(+ createElement(settingsGroup!.body, { engine: engine as never, isSurfaceInteractionLocked: false })+ );+ const footer = render(+ createElement(selectObjectOperationForm.footer, { engine: engine as never, isExternalInteractionLocked: false })+ );++ // Input group: mode, points, bbox indicator, invert switch — no verbs.+ expect(input.indexOf('>Visual<')).toBeLessThan(input.indexOf('aria-label="Include 1"'));+ expect(input.indexOf('aria-label="Include 1"')).toBeLessThan(input.indexOf('No bounding box'));+ expect(input).toContain('>Invert<');+ expect(input).not.toContain('>Process<');++ // Settings group: the set-once session dials.+ expect(settings).toContain('aria-label="Select Object settings"');+ expect(settings).not.toContain('>Process<');++ // Footer: chip, then Reset, Process, Apply (with the save-as menu trigger), Cancel.+ expect(footer).toContain('Layer 1 · Raster layer · 1024 × 768');+ expect(footer.indexOf('>Select Object<')).toBeLessThan(footer.indexOf('>Reset<'));+ expect(footer.indexOf('>Reset<')).toBeLessThan(footer.indexOf('>Process<'));+ expect(footer.indexOf('>Process<')).toBeLessThan(footer.indexOf('>Apply<'));+ expect(footer.indexOf('>Apply<')).toBeLessThan(footer.indexOf('>Cancel<'));+ expect(footer).toContain('aria-label="Save As"');});});diff --git a/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-options/SamOptions.tsx b/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-options/SamOptions.tsxindex 9c11f035e5..e67fcc56bf 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-options/SamOptions.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-options/SamOptions.tsx@@ -1,14 +1,27 @@import type {- OperationPresentationAdapter,+ OperationPropertyForm,ToolbarRegionProps,ToolbarStatusProps,} from '@workbench/widgets/canvas/tool-presentation/toolbarContracts';/* oxlint-disable react-perf/jsx-no-jsx-as-prop, react-perf/jsx-no-new-function-as-prop, react-perf/jsx-no-new-object-as-prop */import type { ChangeEvent } from 'react';-import { createListCollection, HStack, Input, Stack, Switch, Text, VisuallyHidden } from '@chakra-ui/react';+import {+ Box,+ createListCollection,+ Flex,+ Icon,+ Input,+ Menu,+ Portal,+ Stack,+ Switch,+ Text,+ VisuallyHidden,+} from '@chakra-ui/react';import { Button } from '@platform/ui/Button';import { Group } from '@platform/ui/Group';+import { MenuActionItem, MenuContent } from '@platform/ui/Menu';import { Select } from '@platform/ui/Select';import { Tooltip } from '@platform/ui/Tooltip';import {@@ -22,9 +35,9 @@ import {type SelectObjectSaveTarget,} from '@workbench/canvas-operations/api';import { useSamSession } from '@workbench/widgets/canvas/engineStoreHooks';-import { ToolbarStatus } from '@workbench/widgets/canvas/tool-presentation/ToolbarPrimitives';-import { SquareMinusIcon, SquarePlusIcon } from 'lucide-react';-import { useCallback, useMemo } from 'react';+import { PropertySwitchRow } from '@workbench/widgets/canvas/tool-presentation/PropertyPrimitives';+import { ChevronDownIcon, SquareMinusIcon, SquarePlusIcon } from 'lucide-react';+import { useMemo } from 'react';import { useTranslation } from 'react-i18next';import { OperationStatusChip, OperationStatusSlot } from './OperationStatusSlot';@@ -397,7 +410,9 @@ export const SamSettings = ({};/** Input mode, the visual point labels or the prompt, and invert: what changes between previews. */-export const SamModes = ({ engine, isSurfaceInteractionLocked }: ToolbarRegionProps) => {++/** The session's inputs: visual points or a prompt, plus the invert switch. */+const SamInputSettings = ({ engine, isSurfaceInteractionLocked }: ToolbarRegionProps) => {const { t } = useTranslation();const session = useSamSession(engine);const operations = getCanvasOperations(engine);@@ -429,13 +444,16 @@ export const SamModes = ({ engine, isSurfaceInteractionLocked }: ToolbarRegionPr}/>{session.input.type === 'visual' ? (- <SamVisualInput- disabled={!eligibility.canEditInputs}- pointLabel={session.pointLabel}- viewModel={viewModel}- onExclude={() => operations.updateSelectObjectSession({ pointLabel: 'exclude' })}- onInclude={() => operations.updateSelectObjectSession({ pointLabel: 'include' })}- />+ <>+ <SamVisualInput+ disabled={!eligibility.canEditInputs}+ pointLabel={session.pointLabel}+ viewModel={viewModel}+ onExclude={() => operations.updateSelectObjectSession({ pointLabel: 'exclude' })}+ onInclude={() => operations.updateSelectObjectSession({ pointLabel: 'include' })}+ />+ <SamBboxIndicator viewModel={viewModel} />+ </>) : (<SamPromptBodydisabled={!eligibility.canEditInputs}@@ -445,83 +463,44 @@ export const SamModes = ({ engine, isSurfaceInteractionLocked }: ToolbarRegionPr}/>)}+ <PropertySwitchRow+ checked={session.invert}+ disabled={!eligibility.canEditInputs}+ label={t('widgets.layers.selectObject.invert')}+ onCheckedChange={(invert) => operations.updateSelectObjectSession({ invert })}+ /></>);};-/** Session settings plus the secondary commands; C2 moves these into Properties → Operation. */-export const SamMore = ({ engine, isSurfaceInteractionLocked }: ToolbarRegionProps) => {- const { t } = useTranslation();+/** Set-once session settings: model, refinement, preview behavior. */+const SamSettingsGroup = ({ engine, isSurfaceInteractionLocked }: ToolbarRegionProps) => {const session = useSamSession(engine);const operations = getCanvasOperations(engine);if (!session) {return null;}const eligibility = getSamActionEligibility(session, isSurfaceInteractionLocked);- const actions = getSamActionHandlers(operations);- const isProcessing = isSamProcessingStatus(session.status);- const viewModel = getSamPanelViewModel(session, (layerName, width, height) =>- t('widgets.layers.selectObject.sourceLayerLabel', {- height,- name: layerName,- type: t(`widgets.layers.selectObject.saveAs_${session.layerType}`),- width,- })- );return (- <Stack gap="2" w="full">- <HStack gap="2">- <Button- aria-pressed={session.invert}- disabled={!eligibility.canEditInputs}- size="xs"- variant={session.invert ? 'solid' : 'ghost'}- onClick={() => operations.updateSelectObjectSession({ invert: !session.invert })}- >- {t('widgets.layers.selectObject.invert')}- </Button>- {session.input.type === 'visual' ? <SamBboxIndicator viewModel={viewModel} /> : null}- </HStack>- <SamSettings- eligibility={eligibility}- isProcessing={isProcessing}- session={session}- onModelChange={(model) => operations.updateSelectObjectSession({ model })}- onToggle={(key, value) => operations.updateSelectObjectSession({ [key]: value })}- />- <HStack flexWrap="wrap" gap="1">- <Button disabled={!eligibility.canProcess} loading={isProcessing} size="xs" onClick={actions.process}>- {t('widgets.layers.selectObject.process')}- </Button>- <Button disabled={!eligibility.canReset} size="xs" variant="ghost" onClick={actions.reset}>- {t('widgets.layers.selectObject.reset')}- </Button>- </HStack>- <HStack aria-label={t('widgets.layers.selectObject.saveAs')} flexWrap="wrap" gap="1" role="group">- {SAVE_TARGETS.map((target) => (- <Button- key={target}- disabled={!eligibility.canSave}- size="xs"- variant="ghost"- onClick={() => actions.save(target)}- >- {t(`widgets.layers.selectObject.saveAs_${target}`)}- </Button>- ))}- </HStack>- </Stack>+ <SamSettings+ eligibility={eligibility}+ isProcessing={isSamProcessingStatus(session.status)}+ session={session}+ onModelChange={(model) => operations.updateSelectObjectSession({ model })}+ onToggle={(key, value) => operations.updateSelectObjectSession({ [key]: value })}+ />);};-export const SamStatus = ({ engine, isExternalInteractionLocked }: ToolbarStatusProps) => {+const APPLY_MENU_POSITIONING = { placement: 'top-end' } as const;++/** The sticky footer: status chip, Reset, Process, Apply with its save-as menu, Cancel. */+const SamFooter = ({ engine, isExternalInteractionLocked }: ToolbarStatusProps) => {const { t } = useTranslation();const session = useSamSession(engine);const actions = useMemo(() => getSamActionHandlers(getCanvasOperations(engine)), [engine]);- const onApply = useCallback(() => actions.apply(), [actions]);- const onCancel = useCallback(() => actions.cancel(), [actions]);if (!session) {- return <ToolbarStatus />;+ return null;}const eligibility = getSamActionEligibility(session, isExternalInteractionLocked);const isProcessing = isSamProcessingStatus(session.status);@@ -533,29 +512,97 @@ export const SamStatus = ({ engine, isExternalInteractionLocked }: ToolbarStatuswidth: session.sourceRect.width,});return (- <ToolbarStatus- applyDisabled={!eligibility.canApply}- applyLoading={session.status === 'committing'}- cancelDisabled={!eligibility.canCancel}- onApply={onApply}- onCancel={onCancel}- >- <OperationStatusChip- errorDetail={session.error?.detail ?? null}- errorText={session.error ? t(getSamErrorTranslationKey(session.error.code)) : null}- isBusy={isBusy}- sourceLabel={sourceLabel}- statusText={t(getSamStatusTranslationKey(session.status))}- technicalDetailsLabel={t('widgets.layers.selectObject.technicalDetails')}- title={t('widgets.layers.selectObject.title')}- />- </ToolbarStatus>+ <Flex align="center" gap="1" minW="0" w="full">+ {/* No nowrap: the chip's own two-line clamp must keep the details button visible. */}+ <Box flex="1" minW="0" overflow="hidden">+ <OperationStatusChip+ errorDetail={session.error?.detail ?? null}+ errorText={session.error ? t(getSamErrorTranslationKey(session.error.code)) : null}+ isBusy={isBusy}+ sourceLabel={sourceLabel}+ statusText={t(getSamStatusTranslationKey(session.status))}+ technicalDetailsLabel={t('widgets.layers.selectObject.technicalDetails')}+ title={t('widgets.layers.selectObject.title')}+ />+ </Box>+ <Button disabled={!eligibility.canReset} flexShrink={0} size="xs" variant="ghost" onClick={actions.reset}>+ {t('widgets.layers.selectObject.reset')}+ </Button>+ <Button+ disabled={!eligibility.canProcess}+ flexShrink={0}+ loading={isProcessing}+ size="xs"+ onClick={actions.process}+ >+ {t('widgets.layers.selectObject.process')}+ </Button>+ <Flex flexShrink={0}>+ <Button+ data-toolbar-action="apply"+ disabled={!eligibility.canApply}+ loading={session.status === 'committing'}+ roundedRight="none"+ size="xs"+ variant="solid"+ onClick={actions.apply}+ >+ {t('common.apply')}+ </Button>+ <Menu.Root positioning={APPLY_MENU_POSITIONING}>+ <Menu.Trigger asChild>+ <Button+ aria-label={t('widgets.layers.selectObject.saveAs')}+ disabled={!eligibility.canSave}+ px="1"+ roundedLeft="none"+ size="xs"+ variant="solid"+ >+ <Icon as={ChevronDownIcon} boxSize="3.5" />+ </Button>+ </Menu.Trigger>+ <Portal>+ <Menu.Positioner>+ <MenuContent minW="12rem" py="1">+ {SAVE_TARGETS.map((target) => (+ <MenuActionItem+ key={target}+ disabled={!eligibility.canSave}+ label={t(`widgets.layers.selectObject.saveAs_${target}`)}+ value={`save-${target}`}+ onSelect={() => actions.save(target)}+ />+ ))}+ </MenuContent>+ </Menu.Positioner>+ </Portal>+ </Menu.Root>+ </Flex>+ <Button+ data-toolbar-action="cancel"+ disabled={!eligibility.canCancel}+ flexShrink={0}+ size="xs"+ variant="ghost"+ onClick={actions.cancel}+ >+ {t('common.cancel')}+ </Button>+ </Flex>);};-export const selectObjectOperationAdapter: OperationPresentationAdapter = {+export const selectObjectOperationForm: OperationPropertyForm = {+ footer: SamFooter,+ groups: [+ { body: SamInputSettings, id: 'sam-input', labelKey: 'widgets.properties.groups.input' },+ {+ body: SamSettingsGroup,+ collapsible: 'collapsed',+ id: 'sam-settings',+ labelKey: 'widgets.properties.groups.settings',+ },+ ],kind: 'select-object',- modes: SamModes,- more: SamMore,- status: SamStatus,};diff --git a/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-options/hintForms.tsx b/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-options/hintForms.tsxnew file mode 100644index 0000000000..e55bfa44a8--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-options/hintForms.tsx@@ -0,0 +1,67 @@+import type {+ ToolbarRegionProps,+ ToolPropertyForm,+} from '@workbench/widgets/canvas/tool-presentation/toolbarContracts';++import { HintCard } from '@workbench/widgets/canvas/tool-presentation/PropertyPrimitives';+import { useMemo } from 'react';+import { useTranslation } from 'react-i18next';++/**+ * Gesture cards for the tools whose whole interface is the pointer. The rows+ * mirror what `pointerPipeline`/the tools actually do — hold-keys included —+ * instead of the old single hint sentence.+ */+const ViewHints = (_props: ToolbarRegionProps) => {+ const { t } = useTranslation();+ const rows = useMemo(+ () => [+ { effect: t('widgets.properties.hints.view.drag'), gesture: t('widgets.properties.gestures.drag') },+ { effect: t('widgets.properties.hints.view.scroll'), gesture: t('widgets.properties.gestures.scroll') },+ { effect: t('widgets.properties.hints.view.hold'), gesture: t('widgets.properties.gestures.holdSpace') },+ ],+ [t]+ );+ return <HintCard rows={rows} />;+};++const ColorPickerHints = (_props: ToolbarRegionProps) => {+ const { t } = useTranslation();+ const rows = useMemo(+ () => [+ { effect: t('widgets.properties.hints.colorPicker.click'), gesture: t('widgets.properties.gestures.click') },+ { effect: t('widgets.properties.hints.colorPicker.hold'), gesture: t('widgets.properties.gestures.holdAlt') },+ ],+ [t]+ );+ return <HintCard rows={rows} />;+};++const SamToolHints = (_props: ToolbarRegionProps) => {+ const { t } = useTranslation();+ const rows = useMemo(+ () => [+ { effect: t('widgets.properties.hints.sam.click'), gesture: t('widgets.properties.gestures.click') },+ { effect: t('widgets.properties.hints.sam.shiftClick'), gesture: t('widgets.properties.gestures.shiftClick') },+ { effect: t('widgets.properties.hints.sam.clickPoint'), gesture: t('widgets.properties.gestures.clickPoint') },+ { effect: t('widgets.properties.hints.sam.drag'), gesture: t('widgets.properties.gestures.drag') },+ ],+ [t]+ );+ return <HintCard rows={rows} />;+};++export const viewForm: ToolPropertyForm = {+ groups: [{ body: ViewHints, id: 'view-gestures', labelKey: 'widgets.properties.groups.gestures' }],+ id: 'view',+};++export const colorPickerForm: ToolPropertyForm = {+ groups: [{ body: ColorPickerHints, id: 'color-picker-gestures', labelKey: 'widgets.properties.groups.gestures' }],+ id: 'colorPicker',+};++export const samToolForm: ToolPropertyForm = {+ groups: [{ body: SamToolHints, id: 'sam-gestures', labelKey: 'widgets.properties.groups.gestures' }],+ id: 'sam',+};diff --git a/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-presentation/PropertyPrimitives.tsx b/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-presentation/PropertyPrimitives.tsxindex f87fc39f60..48ed1857ee 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-presentation/PropertyPrimitives.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-presentation/PropertyPrimitives.tsx@@ -187,3 +187,22 @@ export const EditTargetChip = ({ layerName }: { layerName: string | null }) => {</Flex>);};++/**+ * A small gesture/keymap table for tools whose whole story is how you point at+ * the canvas: a chip naming the gesture, then what it does.+ */+export const HintCard = ({ rows }: { rows: readonly { gesture: string; effect: string }[] }) => (+ <Stack gap="1">+ {rows.map((row) => (+ <Grid key={row.gesture} alignItems="baseline" columnGap="2" gridTemplateColumns="auto minmax(0, 1fr)">+ <Badge colorPalette="gray" fontFamily="mono" size="sm" variant="surface">+ {row.gesture}+ </Badge>+ <Text color="fg.muted" fontSize="xs">+ {row.effect}+ </Text>+ </Grid>+ ))}+ </Stack>+);diff --git a/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-presentation/toolAdapters.test.ts b/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-presentation/toolAdapters.test.tsindex 4c2d9c5817..ea2d8bd634 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-presentation/toolAdapters.test.ts+++ b/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-presentation/toolAdapters.test.ts@@ -33,7 +33,6 @@ const englishCatalogModules = import.meta.glob('../../../../../public/locales/enconst en = Object.values(englishCatalogModules)[0] as {widgets: {canvas: {- toolHints: Record<string, string>;tools: Record<string, string>;};properties: { rows: Record<string, string>; sections: Record<string, string> };@@ -49,14 +48,9 @@ describe('tool presentation adapters', () => {}});- it('hints exactly the tools without a control', () => {+ it('gives every tool controls or gesture cards; the bare-hint fallback is dead', () => {for (const toolId of TOOL_IDS) {- const adapter = TOOL_PRESENTATION_ADAPTERS[toolId];- if (hasToolControls(adapter)) {- expect(en.widgets.canvas.toolHints[toolId], toolId).toBeUndefined();- } else {- expect(en.widgets.canvas.toolHints[toolId], toolId).toEqual(expect.any(String));- }+ expect(hasToolControls(TOOL_PRESENTATION_ADAPTERS[toolId]), toolId).toBe(true);}});diff --git a/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-presentation/toolAdapters.ts b/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-presentation/toolAdapters.tsindex 1c8f33c5c6..8a91fc270c 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-presentation/toolAdapters.ts+++ b/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-presentation/toolAdapters.ts@@ -3,8 +3,9 @@ import type { ToolId } from '@workbench/canvas-engine/api';import { filterOperationForm } from '@workbench/widgets/canvas/tool-options/FilterOptions';import { bboxForm, moveForm, transformForm } from '@workbench/widgets/canvas/tool-options/geometryForm';import { gradientForm } from '@workbench/widgets/canvas/tool-options/GradientOptions';+import { colorPickerForm, samToolForm, viewForm } from '@workbench/widgets/canvas/tool-options/hintForms';import { brushForm, eraserForm } from '@workbench/widgets/canvas/tool-options/paintForm';-import { selectObjectOperationAdapter } from '@workbench/widgets/canvas/tool-options/SamOptions';+import { selectObjectOperationForm } from '@workbench/widgets/canvas/tool-options/SamOptions';import { lassoForm, marqueeForm } from '@workbench/widgets/canvas/tool-options/selectionForm';import { shapeForm } from '@workbench/widgets/canvas/tool-options/ShapeOptions';import { textForm } from '@workbench/widgets/canvas/tool-options/TextOptions';@@ -18,28 +19,25 @@ import type {import { isOperationPropertyForm, isToolPropertyForm } from './toolbarContracts';-/** Tools with no primary settings show their name and hint; the shell never unmounts for them. */-const hintOnly = (id: ToolId): ToolPresentationAdapter => ({ id });-export const TOOL_PRESENTATION_ADAPTERS: Readonly<Record<ToolId, ToolPanePresentation>> = {bbox: bboxForm,brush: brushForm,- colorPicker: hintOnly('colorPicker'),+ colorPicker: colorPickerForm,eraser: eraserForm,gradient: gradientForm,lasso: lassoForm,marquee: marqueeForm,move: moveForm,- sam: hintOnly('sam'),+ sam: samToolForm,shape: shapeForm,text: textForm,transform: transformForm,- view: hintOnly('view'),+ view: viewForm,};export const OPERATION_PRESENTATION_ADAPTERS: Readonly<Record<CanvasOperationKind, OperationPanePresentation>> = {filter: filterOperationForm,- 'select-object': selectObjectOperationAdapter,+ 'select-object': selectObjectOperationForm,};export const hasToolRegions = (adapter: ToolPresentationAdapter): boolean =>diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/LayerEditorPanes.browser.test.tsx b/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/LayerEditorPanes.browser.test.tsxindex 2ae71b3156..8a394f017c 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/LayerEditorPanes.browser.test.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/LayerEditorPanes.browser.test.tsx@@ -291,7 +291,9 @@ describe('Properties pane', () => {await act(() => engine!.tools.setTool('view'));await settle();expect(page.getByRole('slider', { exact: true, name: 'Brush size' }).query()).toBeNull();- expect(host!.textContent).toContain('Drag to pan and scroll to zoom.');+ // Hint-only tools show a gesture card now, not a single sentence.+ expect(host!.textContent).toContain('Pan the canvas.');+ expect(host!.textContent).toContain('Hold Space');});it('keeps a slider and its number field on one grid row and shares row identity brush↔eraser', async () => {