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
chore(deps): resolve conflicts with main
Josh Corbett02aa9f93a069
diff --cc invokeai/frontend/webv2/performance/architecture-baseline.jsonindex 0e10506e43,0126e02923..4f1c7de908--- a/invokeai/frontend/webv2/performance/architecture-baseline.json+++ b/invokeai/frontend/webv2/performance/architecture-baseline.json@@@ -858,6 -861,8 +860,7 @@@"source:src/workbench/canvas-engine/render/maskFill.ts","source:src/workbench/canvas-engine/render/rasterComposite.ts","source:src/workbench/canvas-engine/render/rasterizers/textRasterizer.ts",- "source:src/workbench/canvas-engine/render/thumbnail.ts",+ "source:src/workbench/canvas-engine/transform/transformMath.ts","source:src/workbench/canvasDimsSync.ts","source:src/workbench/canvasLayerContent.ts","source:src/workbench/canvasMigration.ts",diff --cc invokeai/frontend/webv2/src/workbench/shell/topbar/InvokeButton.browser.test.tsxindex c85c93d0b2,cb638878dc..6810cbf0fe--- a/invokeai/frontend/webv2/src/workbench/shell/topbar/InvokeButton.browser.test.tsx+++ b/invokeai/frontend/webv2/src/workbench/shell/topbar/InvokeButton.browser.test.tsx@@@ -137,16 -147,15 +147,22 @@@ describe('InvokeButton icon slot', () =it('acknowledges canvas preparation immediately and ignores a second click', async () => {harness.summary.total = 0;const invoke = vi.fn(() => Promise.resolve());-- const { button } = await renderInvokeButton({ invoke, isPreparing: true });++ const { button } = await renderInvokeButton({++ invoke,++ isPreparing: true,++ isValid: false,++ issues: [{ layerId: 'control-2', message: 'Control layer "Depth 1": Choose a model.' }],++ });expect(button.getAttribute('aria-disabled')).toBe('true');- expect(button.getAttribute('aria-label')).toBe('topbar.invoke.preparing');+ await expect.element(button).toHaveAccessibleName('topbar.invoke.invoke');+ await expect.element(button).toHaveAccessibleDescription('topbar.invoke.preparing');expect(hasSpinner(button)).toBe(true);await act(() => button.click());expect(invoke).not.toHaveBeenCalled();++ expect(harness.revealed).toEqual([]);});});@@@ -166,19 -175,17 +182,23 @@@ describe('InvokeButton front of queue'expect(invoke).toHaveBeenNthCalledWith(2, { prepend: true });});- it('ignores both clicks while Invoke is blocked', async () => {+ it('ignores both clicks while Invoke is blocked by issues no layer can show', async () => {const invoke = vi.fn(() => Promise.resolve());const { button } = await renderInvokeButton({- blockingReasons: ['The backend is disconnected.'],invoke,isValid: false,- issues: [{ layerId: null, message: 'The backend is disconnected.' }],++ issues: [++ { layerId: null, message: 'The backend is disconnected.' },++ { layerId: 'control-2', message: 'Control layer "Depth 1": Choose a model.' },++ ],});+ // The visible label names it (WCAG 2.5.3); the blocking reason describes it.expect(button.getAttribute('aria-disabled')).toBe('true');- await expect.element(button).toHaveAccessibleName('topbar.invoke.invoke');- expect(button.getAttribute('aria-label')).toBe('topbar.invoke.unavailable');++ await expect.element(button).toHaveAccessibleName('topbar.invoke.issueCount(2)');+ await expect.element(button).toHaveAccessibleDescription('topbar.invoke.unavailable');++ expect(getComputedStyle(button).opacity).toBe('0.55');// Dispatched: a blocked Invoke is not actionable for a pointer driver.await act(() => button.dispatchEvent(new MouseEvent('click', { bubbles: true })));await act(() => button.dispatchEvent(new MouseEvent('click', { bubbles: true, shiftKey: true })));@@@ -211,3 -215,41 +232,45 @@@await expect.element(page.getByText('topbar.invoke.invokeFrontHintNoShortcut')).toBeVisible();});});++ describe('InvokeButton issues', () => {+ const LAYER_ISSUES = [+ { layerId: 'control-2', message: 'Control layer "Depth 1": Choose a model.' },+ { layerId: null, message: 'The backend is disconnected.' },+ ];++ it('counts the issues in place of the shortcut and keeps listing them in the tooltip', async () => {+ harness.bindings = { 'app.invoke': { aria: 'Control+Enter', display: 'Ctrl+Enter', parts: ['ctrl', 'enter'] } };+ const { button } = await renderInvokeButton({ isValid: false, issues: LAYER_ISSUES });++ expect(button.textContent).toContain('topbar.invoke.issueCount(2)');+ expect(button.querySelector('kbd')).toBeNull();+ await act(() => userEvent.hover(button));++ await expect.element(page.getByText('Control layer "Depth 1": Choose a model.')).toBeVisible();+ await expect.element(page.getByText('backend is disconnected.')).toBeVisible();+ });++ it('shows the first issue’s layer on click or Enter, and never invokes', async () => {+ const invoke = vi.fn(() => Promise.resolve());+ const { button } = await renderInvokeButton({ invoke, isValid: false, issues: LAYER_ISSUES });++ expect(button.getAttribute('aria-disabled')).not.toBe('true');+ // Actionable, so not dimmed like a blocked Invoke.+ expect(getComputedStyle(button).opacity).toBe('1');+ expect(button.getAttribute('aria-label')).toBe(+ 'topbar.invoke.showIssue(2, Control layer "Depth 1": Choose a model.)'+ );++ await expect++ .element(button)++ .toHaveAccessibleName('topbar.invoke.showIssue(2, Control layer "Depth 1": Choose a model.)');++ expect(button.hasAttribute('aria-describedby')).toBe(false);++ await act(() => userEvent.click(button));+ button.focus();+ await act(() => userEvent.keyboard('{Enter}'));++ expect(harness.revealed).toEqual(['control-2', 'control-2']);+ expect(invoke).not.toHaveBeenCalled();+ });+ });diff --cc invokeai/frontend/webv2/src/workbench/shell/topbar/InvokeButton.tsxindex 5ede2187fd,1d53d1a352..efc199ab6b--- a/invokeai/frontend/webv2/src/workbench/shell/topbar/InvokeButton.tsx+++ b/invokeai/frontend/webv2/src/workbench/shell/topbar/InvokeButton.tsx@@@ -76,15 -78,14 +78,23 @@@ export const InvokeButton = ({ state }[invoke]);const canInvoke = isValid && !isPreparing;- // The visible text names the button; why it cannot run now is its description.+ // Blocked by issues: the count replaces the shortcut, and when the first names a layer, activation shows it.+ const showsIssues = !isValid && !isPreparing && issues.length > 0;+ const issueLayerId = showsIssues ? (issues[0]?.layerId ?? null) : null;+ const handleShowIssue = useCallback(() => {+ if (issueLayerId !== null) {+ revealLayerProperties(issueLayerId);+ }+ }, [issueLayerId, revealLayerProperties]);++ // The visible text names unavailable controls; the reason describes why they cannot act.+ const unavailable = useUnavailableControl(- canInvoke++ canInvoke || issueLayerId !== null+ ? undefined+ : isPreparing+ ? t('topbar.invoke.preparing')- : t('topbar.invoke.unavailable', { reason: blockingReasons[0] ?? t('topbar.invoke.unrunnable') }),++ : t('topbar.invoke.unavailable', { reason: issues[0]?.message ?? t('topbar.invoke.unrunnable') }),+ undefined+ );const iconMode = isPreparing? ({ mode: 'progress', value: null } as const)@@@ -97,16 -98,28 +107,22 @@@return (<Tooltip content={tooltipContent} contentProps={TOOLTIP_CONTENT_PROPS} openDelay={200} showArrow><Button- aria-disabled={!canInvoke && issueLayerId === null}+ {...unavailable?.props}aria-keyshortcuts={ariaKeyShortcuts}+ aria-label={- canInvoke- ? t('topbar.invoke.invoke')- : isPreparing- ? t('topbar.invoke.preparing')- : issueLayerId !== null- ? t('topbar.invoke.showIssue', { count: issues.length, reason: issues[0]?.message })- : t('topbar.invoke.unavailable', {- reason: issues[0]?.message ?? t('topbar.invoke.unrunnable'),- })++ issueLayerId !== null++ ? t('topbar.invoke.showIssue', { count: issues.length, reason: issues[0]?.message })++ : undefined+ }colorPalette="brand"css={INVOKE_BUTTON_CSS}- cursor={canInvoke ? undefined : 'not-allowed'}+ cursor={canInvoke || issueLayerId !== null ? undefined : 'not-allowed'}flexShrink={0}- opacity={canInvoke ? undefined : 0.55}+ // A blocked Invoke that can show its first issue is still actionable, so it is not dimmed.+ opacity={canInvoke || issueLayerId !== null ? undefined : 0.55}size="lg"onBlur={handleBlur}- onClick={canInvoke ? handleClick : undefined}+ onClick={canInvoke ? handleClick : issueLayerId !== null ? handleShowIssue : undefined}onFocus={handleFocus}onPointerEnter={handlePointerEnter}onPointerLeave={handlePointerLeave}@@@ -128,11 -140,9 +144,11 @@@</ProgressCircle.Root>)}</Box>- {t('topbar.invoke.invoke')}+ {showsIssues ? t('topbar.invoke.issueCount', { count: issues.length }) : t('topbar.invoke.invoke')}+ {unavailable?.description}- {shortcutParts ? (- // Out of the name, which stays "Invoke" at every width; aria-keyshortcuts announces the binding.+ {shortcutParts && !showsIssues ? (- <Kbd css={HIDE_BELOW_HINT_WIDTH} variant="outline" borderColor={SHORTCUT_BORDER} color="inherit">++ // The keycap stays out of the name; aria-keyshortcuts announces the binding.+ <Kbd aria-hidden css={HIDE_BELOW_HINT_WIDTH} variant="outline" borderColor={SHORTCUT_BORDER} color="inherit"><TopbarShortcutKeys parts={shortcutParts} /></Kbd>) : null}