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(webv2): add launchpad managers
joshistoast811c8d3dfef9
diff --git a/invokeai/frontend/webv2/src/WorkbenchApp.tsx b/invokeai/frontend/webv2/src/WorkbenchApp.tsxindex 4899cca5f8..2959800623 100644--- a/invokeai/frontend/webv2/src/WorkbenchApp.tsx+++ b/invokeai/frontend/webv2/src/WorkbenchApp.tsx@@ -4,15 +4,14 @@ import { WorkbenchShell } from '@workbench/shell';import type { WorkbenchSearch } from './workbench/projects/session';import { SessionExpiryGuard } from './workbench/auth/components/SessionExpiryGuard';-import { ModelsRuntime } from './workbench/widgets/models/ModelsRuntime';import { WorkbenchProvider } from './workbench/WorkbenchContext';import { WorkbenchRuntime } from './workbench/WorkbenchRuntime';import { WorkbenchSessionController } from './workbench/WorkbenchSessionController';/**- * The authenticated editor: providers, runtimes, and the shell. Mounted by- * the /app route once the auth guard has resolved, so the backend socket- * always connects with a valid token (or none, in single-user mode).+ * The authenticated editor: providers, editor-only runtimes, and the shell.+ * The shared backend socket is mounted above this route; `WorkbenchRuntime`+ * attaches the generation queue listeners while the editor is open.** The route's search params shape the boot: ?project deep-links a library* project into the session, ?new starts a fresh draft. Both are consumed by@@ -26,7 +25,6 @@ export const WorkbenchApp = () => {<WorkbenchProvider loadOptions={{ createNew: search.new, openProjectId: search.project }}><SessionExpiryGuard /><WorkbenchRuntime />- <ModelsRuntime /><WorkbenchSessionController search={search} /><WorkbenchShell /></WorkbenchProvider>diff --git a/invokeai/frontend/webv2/src/router.tsx b/invokeai/frontend/webv2/src/router.tsxindex 39dcffbc17..f594717bd7 100644--- a/invokeai/frontend/webv2/src/router.tsx+++ b/invokeai/frontend/webv2/src/router.tsx@@ -10,10 +10,12 @@ import {redirect,} from '@tanstack/react-router';+import { getCapabilities, type Capabilities } from './workbench/auth/capabilities';import { LoginScreen } from './workbench/auth/components/LoginScreen';import { SetupScreen } from './workbench/auth/components/SetupScreen';import { ensureAuthSession } from './workbench/auth/session';-import { HomeScreen } from './workbench/home/HomeScreen';+import { SocketHubRuntime } from './workbench/backend/SocketHubRuntime';+import { Launchpad } from './workbench/launchpad/Launchpad';import { peekOpenProjectIds, type WorkbenchSearch } from './workbench/projects/session';import { loadWorkbenchSettings } from './workbench/settings/store';@@ -25,10 +27,11 @@ import { loadWorkbenchSettings } from './workbench/settings/store';* - setup required → everything funnels to /setup* - signed out → authenticated routes redirect to /login*- * Under it, `/` is the Home surface (project library, profile, resources) and- * `/app` is the editor. The editor bundle — canvas, workflow, widgets — is- * code-split behind `lazyRouteComponent`, so Home stays light; `defaultPreload:- * 'intent'` starts fetching that chunk the moment a project card is hovered.+ * Under it, `/` is the Launchpad (project library, model manager, profile,+ * resources) and `/app` is the editor. The editor bundle — canvas, workflow,+ * widgets — is code-split behind `lazyRouteComponent`, so the Launchpad stays+ * light; `defaultPreload: 'intent'` starts fetching that chunk the moment a+ * project card is hovered.** Hash history is used because the bundle is served with a relative base* (`./`), so the app cannot rely on server-side fallback for deep paths.@@ -36,6 +39,18 @@ import { loadWorkbenchSettings } from './workbench/settings/store';const rootRoute = createRootRoute({ component: Outlet });+/**+ * Wraps every authenticated route with the shared backend socket transport.+ * Feature runtimes attach their own listeners only where needed, keeping the+ * light Launchpad bundle free of editor/model-manager code.+ */+const AuthenticatedLayout = () => (+ <>+ <SocketHubRuntime />+ <Outlet />+ </>+);+const authenticatedRoute = createRoute({beforeLoad: async () => {const session = await ensureAuthSession();@@ -52,25 +67,50 @@ const authenticatedRoute = createRoute({await loadWorkbenchSettings();},- component: Outlet,+ component: AuthenticatedLayout,getParentRoute: () => rootRoute,id: 'authenticated',});+const requireLaunchpadCapability = async (capability: keyof Capabilities): Promise<void> => {+ const session = await ensureAuthSession();++ if (!getCapabilities(session)[capability]) {+ throw redirect({ to: '/projects' });+ }+};++// `/` plus a deep-link alias per Launchpad section. All render the same shell;+// it reads the path to pick the active page.const homeRoute = createRoute({- component: HomeScreen,+ component: Launchpad,getParentRoute: () => authenticatedRoute,path: '/',});const projectsHomeRoute = createRoute({- component: HomeScreen,+ component: Launchpad,getParentRoute: () => authenticatedRoute,path: 'projects',});+const modelsHomeRoute = createRoute({+ beforeLoad: () => requireLaunchpadCapability('canManageModels'),+ component: Launchpad,+ getParentRoute: () => authenticatedRoute,+ path: 'models',+});++const nodesHomeRoute = createRoute({+ beforeLoad: () => requireLaunchpadCapability('canManageNodes'),+ component: Launchpad,+ getParentRoute: () => authenticatedRoute,+ path: 'nodes',+});+const usersHomeRoute = createRoute({- component: HomeScreen,+ beforeLoad: () => requireLaunchpadCapability('canManageUsers'),+ component: Launchpad,getParentRoute: () => authenticatedRoute,path: 'users',});@@ -147,7 +187,14 @@ export const router = createRouter({defaultPreload: 'intent',history: createHashHistory(),routeTree: rootRoute.addChildren([- authenticatedRoute.addChildren([homeRoute, projectsHomeRoute, usersHomeRoute, workbenchRoute]),+ authenticatedRoute.addChildren([+ homeRoute,+ projectsHomeRoute,+ modelsHomeRoute,+ nodesHomeRoute,+ usersHomeRoute,+ workbenchRoute,+ ]),loginRoute,setupRoute,]),diff --git a/invokeai/frontend/webv2/src/workbench/WorkbenchRuntime.tsx b/invokeai/frontend/webv2/src/workbench/WorkbenchRuntime.tsxindex 39d633a25c..5e40bfc277 100644--- a/invokeai/frontend/webv2/src/workbench/WorkbenchRuntime.tsx+++ b/invokeai/frontend/webv2/src/workbench/WorkbenchRuntime.tsx@@ -3,6 +3,7 @@ import { useEffect, useRef, useState, type Dispatch } from 'react';import type { Project, QueueItem } from './types';import type { WorkbenchAction } from './workbenchState';+import { getConnectionStatus, subscribeConnection } from './backend/connectionStore';import { getApiErrorMessage } from './backend/http';import {createQueueCoordinator,@@ -10,6 +11,7 @@ import {type QueueCoordinator,type ReconcileInput,} from './backend/queueCoordinator';+import { socketHub } from './backend/socketHub';import { addImagesToGalleryBoard } from './gallery/api';import { getQueueItemResultImages } from './generation/api';import { sanitizeBatchCount } from './generation/batch';@@ -197,42 +199,64 @@ export const WorkbenchRuntime = () => {stateRef.current = state;+ // Mirror the shared socket's connection status (owned by the hub, above the+ // workbench) into workbench state so the editor's many `backendConnection`+ // consumers and the reconcile gate keep working unchanged. Seeds on mount so+ // opening the editor over an already-live socket reconciles immediately.useEffect(() => {- const coordinator = createQueueCoordinator({- onBackendItemComplete: (localQueueItemId, backendItemId) => {- const routeTarget = stateRef.current.projects- .map((project) => ({ project, queueItem: project.queue.items.find((item) => item.id === localQueueItemId) }))- .find((target) => target.queueItem !== undefined);-- if (!routeTarget?.queueItem || routeTarget.queueItem.completedBackendItemIds?.includes(backendItemId)) {- return;- }+ const syncConnection = () => {+ const { error, status } = getConnectionStatus();- void routeBackendItemResults(routeTarget.project.id, routeTarget.queueItem, backendItemId, dispatch);- },- onBackendItemCancelled: (localQueueItemId, backendItemId) => {- const routeTarget = stateRef.current.projects- .map((project) => ({ project, queueItem: project.queue.items.find((item) => item.id === localQueueItemId) }))- .find((target) => target.queueItem !== undefined);+ dispatch({ error, status, type: 'setBackendConnectionStatus' });+ };- if (!routeTarget?.queueItem || routeTarget.queueItem.cancelledBackendItemIds?.includes(backendItemId)) {- return;- }+ syncConnection();- dispatch({- backendItemId,- projectId: routeTarget.project.id,- queueItemId: localQueueItemId,- type: 'markQueueItemBackendCancelled',- });- },- onConnectionChange: (status, error) => {- dispatch({ error, status, type: 'setBackendConnectionStatus' });- },- onGalleryRefresh: () => {- dispatch({ type: 'refreshBackendData' });+ return subscribeConnection(syncConnection);+ }, [dispatch]);++ useEffect(() => {+ const coordinator = createQueueCoordinator(+ {+ onBackendItemComplete: (localQueueItemId, backendItemId) => {+ const routeTarget = stateRef.current.projects+ .map((project) => ({+ project,+ queueItem: project.queue.items.find((item) => item.id === localQueueItemId),+ }))+ .find((target) => target.queueItem !== undefined);++ if (!routeTarget?.queueItem || routeTarget.queueItem.completedBackendItemIds?.includes(backendItemId)) {+ return;+ }++ void routeBackendItemResults(routeTarget.project.id, routeTarget.queueItem, backendItemId, dispatch);+ },+ onBackendItemCancelled: (localQueueItemId, backendItemId) => {+ const routeTarget = stateRef.current.projects+ .map((project) => ({+ project,+ queueItem: project.queue.items.find((item) => item.id === localQueueItemId),+ }))+ .find((target) => target.queueItem !== undefined);++ if (!routeTarget?.queueItem || routeTarget.queueItem.cancelledBackendItemIds?.includes(backendItemId)) {+ return;+ }++ dispatch({+ backendItemId,+ projectId: routeTarget.project.id,+ queueItemId: localQueueItemId,+ type: 'markQueueItemBackendCancelled',+ });+ },+ onGalleryRefresh: () => {+ dispatch({ type: 'refreshBackendData' });+ },},- });+ { hub: socketHub }+ );coordinatorRef.current = coordinator;coordinator.connect();diff --git a/invokeai/frontend/webv2/src/workbench/auth/capabilities.ts b/invokeai/frontend/webv2/src/workbench/auth/capabilities.tsnew file mode 100644index 0000000000..92c61cfd25--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/auth/capabilities.ts@@ -0,0 +1,20 @@+import { useAuthSession, type AuthSession } from './session';++export interface Capabilities {+ canManageModels: boolean;+ canManageNodes: boolean;+ canManageUsers: boolean;+}++export const getCapabilities = (session: AuthSession): Capabilities => {+ const isSingleUser = !session.multiuserEnabled;+ const isAdmin = isSingleUser || session.user?.is_admin === true;++ return {+ canManageModels: isAdmin,+ canManageNodes: isAdmin,+ canManageUsers: session.multiuserEnabled && session.user?.is_admin === true,+ };+};++export const useCapabilities = (): Capabilities => getCapabilities(useAuthSession());diff --git a/invokeai/frontend/webv2/src/workbench/auth/components/AccountMenu.tsx b/invokeai/frontend/webv2/src/workbench/auth/components/AccountMenu.tsxindex 9c6351e451..aadf92c13f 100644--- a/invokeai/frontend/webv2/src/workbench/auth/components/AccountMenu.tsx+++ b/invokeai/frontend/webv2/src/workbench/auth/components/AccountMenu.tsx@@ -2,39 +2,33 @@ import { Avatar, Badge, Box, chakra, HStack, Icon, Menu, Portal, Stack, Text } fimport { useNavigate } from '@tanstack/react-router';import { logoutSession, useAuthSession } from '@workbench/auth/session';import { MenuContent } from '@workbench/components/ui';-import { SettingsButton } from '@workbench/settings/SettingsDialog';-import { useOptionalOpenWorkbenchWidget } from '@workbench/useOpenWorkbenchWidget';-import { useOptionalWorkbenchStore } from '@workbench/WorkbenchContext';import { ChevronDownIcon, LogOutIcon, UserRoundCogIcon, UsersIcon } from 'lucide-react';import { useState } from 'react';import { ProfileDialog } from './ProfileDialog';/**- * Shared settings/account cluster used by both Home and the workbench shell:- * the settings gear always renders; the avatar menu joins it when a- * multi-user session is signed in.+ * The signed-in user's avatar menu — account settings, user management, and+ * sign-out — shown on both the Launchpad and the workbench shell. Renders only+ * in a multi-user session; the settings gear is a separate control that each+ * surface's top bar places alongside it.*/export const AccountMenu = () => {const session = useAuthSession();- const hasWorkbench = useOptionalWorkbenchStore() !== null;- const openWorkbenchWidget = useOptionalOpenWorkbenchWidget();const navigate = useNavigate();const [isProfileOpen, setIsProfileOpen] = useState(false);if (!session.multiuserEnabled || session.user === null) {- return <SettingsButton />;+ return;}const user = session.user;const label = user.display_name?.trim() || user.email;+ // User management is a Launchpad page (`/users`), not a workbench widget —+ // so this navigates there, working the same from Home and the editor.const openUserManagement = () => {- if (!hasWorkbench) {- return;- }-- openWorkbenchWidget('users', { preferredRegions: ['center'], requireCenterView: true });+ void navigate({ to: '/users' });};const signOut = async () => {@@ -43,8 +37,7 @@ export const AccountMenu = () => {};return (- <HStack gap="0.5">- <SettingsButton />+ <><Menu.Root positioning={{ placement: 'bottom-end' }}><Menu.Trigger asChild><chakra.button@@ -93,7 +86,7 @@ export const AccountMenu = () => {<Icon as={UserRoundCogIcon} boxSize="3.5" />Account settings</Menu.Item>- {user.is_admin && hasWorkbench ? (+ {user.is_admin ? (<Menu.Item value="users" onClick={openUserManagement}><Icon as={UsersIcon} boxSize="3.5" />Manage users@@ -109,6 +102,6 @@ export const AccountMenu = () => {</Portal></Menu.Root><ProfileDialog isOpen={isProfileOpen} user={user} onClose={() => setIsProfileOpen(false)} />- </HStack>+ </>);};diff --git a/invokeai/frontend/webv2/src/workbench/auth/session.ts b/invokeai/frontend/webv2/src/workbench/auth/session.tsindex d42e58754d..5a6c66eb49 100644--- a/invokeai/frontend/webv2/src/workbench/auth/session.ts+++ b/invokeai/frontend/webv2/src/workbench/auth/session.ts@@ -1,4 +1,5 @@import { ApiError, clearAuthToken, getAuthToken, setAuthToken, setUnauthorizedHandler } from '@workbench/backend/http';+import { socketHub } from '@workbench/backend/socketHub';import { createExternalStore } from '@workbench/externalStore';import { getAuthStatus, getCurrentUser, login, logout, setupAdmin, type AuthStatus, type UserDTO } from './api';@@ -132,6 +133,9 @@ export const logoutSession = async (): Promise<void> => {}clearAuthToken();+ // Tear down the shared socket so it does not linger authenticated as the+ // previous user; the next authenticated mount reconnects with a fresh token.+ socketHub.disconnect();store.patchSnapshot({ sessionExpired: false, user: null });};@@ -162,5 +166,6 @@ setUnauthorizedHandler(() => {}clearAuthToken();+ socketHub.disconnect();store.patchSnapshot({ sessionExpired: true, user: null });});diff --git a/invokeai/frontend/webv2/src/workbench/backend/SocketHubRuntime.tsx b/invokeai/frontend/webv2/src/workbench/backend/SocketHubRuntime.tsxnew file mode 100644index 0000000000..9c8a4b9c91--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/backend/SocketHubRuntime.tsx@@ -0,0 +1,20 @@+import { useEffect } from 'react';++import { socketHub } from './socketHub';++/**+ * Renders nothing. Mounted once above both the Launchpad and the editor: opens+ * the single backend socket for the authenticated session. Feature-specific+ * runtimes attach listeners where needed so this base runtime stays lightweight.+ *+ * It intentionally does NOT disconnect on unmount — that keeps it StrictMode+ * safe and lets the socket persist across Launchpad↔editor navigation. The+ * socket is torn down explicitly on logout/expiry (see `auth/session.ts`).+ */+export const SocketHubRuntime = () => {+ useEffect(() => {+ socketHub.connect();+ }, []);++ return null;+};diff --git a/invokeai/frontend/webv2/src/workbench/backend/connectionStore.ts b/invokeai/frontend/webv2/src/workbench/backend/connectionStore.tsnew file mode 100644index 0000000000..7925cf327e--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/backend/connectionStore.ts@@ -0,0 +1,27 @@+import type { BackendConnectionStatus } from '@workbench/types';++import { createExternalStore } from '@workbench/externalStore';++/**+ * Provider-free connection status for the shared backend socket. The socket hub+ * is the sole writer; surfaces that mount no workbench providers (the Launchpad)+ * read it directly, and the editor mirrors it into workbench state via a bridge+ * in `WorkbenchRuntime`. Lives outside the reducer so the connection signal is+ * available everywhere the socket is, not just inside the editor.+ */+export interface ConnectionSnapshot {+ status: BackendConnectionStatus;+ error?: string;+}++const store = createExternalStore<ConnectionSnapshot>({ status: 'connecting' });++export const setConnectionStatus = (status: BackendConnectionStatus, error?: string): void => {+ store.setSnapshot({ error, status });+};++export const getConnectionStatus = (): ConnectionSnapshot => store.getSnapshot();++export const useConnectionStatus = (): ConnectionSnapshot => store.useSnapshot();++export const subscribeConnection = (listener: () => void): (() => void) => store.subscribe(listener);diff --git a/invokeai/frontend/webv2/src/workbench/backend/queueCoordinator.test.ts b/invokeai/frontend/webv2/src/workbench/backend/queueCoordinator.test.tsindex 0537c03f4e..366c366c57 100644--- a/invokeai/frontend/webv2/src/workbench/backend/queueCoordinator.test.ts+++ b/invokeai/frontend/webv2/src/workbench/backend/queueCoordinator.test.ts@@ -10,11 +10,11 @@ import { ApiError } from './http';import {createQueueCoordinator,QueueItemCancelledError,- type BackendSocket,type QueueCoordinator,type QueueCoordinatorApi,type QueueCoordinatorCallbacks,} from './queueCoordinator';+import { createSocketHub, type BackendSocket } from './socketHub';class FakeSocket implements BackendSocket {readonly emitted: { event: string; payload: unknown }[] = [];@@ -24,6 +24,13 @@ class FakeSocket implements BackendSocket {this.handlers.set(event, [...(this.handlers.get(event) ?? []), handler]);}+ off(event: string, handler: (payload: never) => void): void {+ this.handlers.set(+ event,+ (this.handlers.get(event) ?? []).filter((existing) => existing !== handler)+ );+ }+emit(event: string, payload: unknown): void {this.emitted.push({ event, payload });}@@ -96,6 +103,7 @@ interface Harness {api: { [Key in keyof QueueCoordinatorApi]: ReturnType<typeof vi.fn> };callbacks: { [Key in keyof QueueCoordinatorCallbacks]: ReturnType<typeof vi.fn> };coordinator: QueueCoordinator;+ hub: ReturnType<typeof createSocketHub>;nodeExecution: { [Key in keyof NodeExecutionSink]: ReturnType<typeof vi.fn> };progressImage: { clear: ReturnType<typeof vi.fn>; set: ReturnType<typeof vi.fn> };progressEntries: Map<string, QueueItemProgress>;@@ -125,7 +133,6 @@ const createHarness = (options: { galleryRefreshCoalesceMs?: number } = {}): HarlistAllQueueItems: vi.fn((): Promise<QueueItemDTO[]> => Promise.resolve([])),};const callbacks = {- onConnectionChange: vi.fn(),onGalleryRefresh: vi.fn(),};const nodeExecution = {@@ -137,16 +144,20 @@ const createHarness = (options: { galleryRefreshCoalesceMs?: number } = {}): Harstarted: vi.fn(),};const progressImage = { clear: vi.fn(), set: vi.fn() };+ const hub = createSocketHub({ createSocket: () => socket });++ hub.connect();+const coordinator = createQueueCoordinator(callbacks, {api,- createSocket: () => socket,galleryRefreshCoalesceMs: options.galleryRefreshCoalesceMs ?? 1,+ hub,nodeExecution,progress,progressImage,});- return { api, callbacks, coordinator, nodeExecution, progressImage, progressEntries, socket };+ return { api, callbacks, coordinator, hub, nodeExecution, progressImage, progressEntries, socket };};describe('queueCoordinator', () => {@@ -158,17 +169,10 @@ describe('queueCoordinator', () => {afterEach(() => {harness.coordinator.dispose();+ harness.hub.disconnect();vi.useRealTimers();});- it('reports connection lifecycle and subscribes to the queue', () => {- harness.coordinator.connect();-- expect(harness.callbacks.onConnectionChange).toHaveBeenNthCalledWith(1, 'connecting', undefined);- expect(harness.callbacks.onConnectionChange).toHaveBeenNthCalledWith(2, 'connected', undefined);- expect(harness.socket.emitted).toContainEqual({ event: 'subscribe_queue', payload: { queue_id: 'default' } });- });-it('settles submitted runs from terminal socket events without polling', async () => {harness.api.enqueueGenerateGraph.mockResolvedValue({ batchId: 'batch-1', itemIds: [1, 2] });harness.coordinator.connect();@@ -515,12 +519,14 @@ describe('queueCoordinator', () => {expect(harness.api.cancelQueueItemsByBatchIds).toHaveBeenCalledWith(['batch-2']);});- it('stops notifying after dispose', () => {+ it('detaches socket listeners after dispose', async () => {harness.coordinator.connect();- harness.callbacks.onConnectionChange.mockClear();+ await harness.coordinator.submitGenerate('local-1', generateRequest);harness.coordinator.dispose();- expect(harness.callbacks.onConnectionChange).not.toHaveBeenCalled();+ harness.socket.fire('queue_item_status_changed', createStatusEvent({ item_id: 1 }));++ expect(harness.nodeExecution.settleRunning).not.toHaveBeenCalled();});});diff --git a/invokeai/frontend/webv2/src/workbench/backend/queueCoordinator.ts b/invokeai/frontend/webv2/src/workbench/backend/queueCoordinator.tsindex ac405ae7bb..47fa92ab7a 100644--- a/invokeai/frontend/webv2/src/workbench/backend/queueCoordinator.ts+++ b/invokeai/frontend/webv2/src/workbench/backend/queueCoordinator.ts@@ -16,8 +16,8 @@ import {getQueueItemResultImages,listAllQueueItems,} from '@workbench/generation/api';-import { handleModelInstallSocketEvent, MODEL_INSTALL_SOCKET_EVENTS } from '@workbench/models/installsStore';-import { io } from 'socket.io-client';++import type { SocketHub } from './socketHub';import {isTerminalBackendStatus,@@ -29,27 +29,16 @@ import {type QueueItemStatusChangedEvent,type TerminalBackendQueueItemStatus,} from './events';-import { ApiError, getAuthToken, getBackendSocketUrl } from './http';+import { ApiError } from './http';import { modelLoadStore } from './modelLoadStore';import { nodeExecutionStore, type NodeExecutionSink } from './nodeExecutionStore';import { progressImageStore, type ProgressImageSink, type ProgressImageTarget } from './progressImageStore';import { queueItemProgressStore, type QueueItemProgressSink } from './progressStore';-const SOCKET_PATH = '/ws/socket.io';const GALLERY_REFRESH_COALESCE_MS = 400;const SAFETY_SWEEP_INTERVAL_MS = 30_000;const TERMINAL_EVENT_BUFFER_LIMIT = 256;-/**- * The minimal Socket.IO surface the coordinator uses; tests substitute a fake.- */-export interface BackendSocket {- on(event: string, handler: (payload: never) => void): unknown;- emit(event: string, payload: unknown): unknown;- connect(): unknown;- disconnect(): unknown;-}-export interface QueueCoordinatorApi {cancelQueueItems: typeof cancelQueueItems;cancelQueueItemsByBatchIds: typeof cancelQueueItemsByBatchIds;@@ -61,7 +50,6 @@ export interface QueueCoordinatorApi {}export interface QueueCoordinatorCallbacks {- onConnectionChange(status: BackendConnectionStatus, error?: string): void;/** Fired when one backend item in a local batch completes, before the whole local batch necessarily settles. */onBackendItemComplete?(localQueueItemId: string, backendItemId: number): void;/** Fired when one backend item in a local batch is canceled. */@@ -155,18 +143,6 @@ const defaultApi: QueueCoordinatorApi = {listAllQueueItems,};-const createDefaultSocket = (): BackendSocket => {- const token = getAuthToken();-- return io(getBackendSocketUrl(), {- auth: token ? { token } : undefined,- autoConnect: false,- extraHeaders: token ? { Authorization: `Bearer ${token}` } : undefined,- path: SOCKET_PATH,- timeout: 60000,- });-};-const toTerminalOutcome = (status: TerminalBackendQueueItemStatus,error?: string | null,@@ -186,17 +162,17 @@ const toTerminalOutcome = (export const createQueueCoordinator = (callbacks: QueueCoordinatorCallbacks,options: {+ hub: Pick<SocketHub, 'on' | 'emit' | 'onConnectionChange'>;api?: Partial<QueueCoordinatorApi>;- createSocket?: () => BackendSocket;galleryRefreshCoalesceMs?: number;nodeExecution?: NodeExecutionSink;progress?: QueueItemProgressSink;progressImage?: ProgressImageSink;sweepIntervalMs?: number;- } = {}+ }): QueueCoordinator => {const api: QueueCoordinatorApi = { ...defaultApi, ...options.api };- const createSocket = options.createSocket ?? createDefaultSocket;+ const hub = options.hub;const progress = options.progress ?? queueItemProgressStore;const nodeExecution = options.nodeExecution ?? nodeExecutionStore;const progressImage = options.progressImage ?? progressImageStore;@@ -213,7 +189,8 @@ export const createQueueCoordinator = (*/const recentTerminalOutcomes = new Map<number, TerminalOutcome>();- let socket: BackendSocket | null = null;+ const detachers: Array<() => void> = [];+ let isAttached = false;let isDisposed = false;let galleryRefreshTimer: ReturnType<typeof setTimeout> | null = null;let sweepTimer: ReturnType<typeof setInterval> | null = null;@@ -426,91 +403,81 @@ export const createQueueCoordinator = (}};- /** Dropped after dispose so socket teardown does not dispatch into unmounted React. */- const notifyConnection = (status: BackendConnectionStatus, error?: string): void => {- if (!isDisposed) {- callbacks.onConnectionChange(status, error);+ /**+ * React to the shared socket's connection lifecycle. The hub owns the socket,+ * the connection store, and `modelLoadStore.reset()`; the coordinator only+ * clears its generation-scoped stores and, on (re)connect, schedules a gallery+ * refresh and sweeps for events missed while disconnected.+ */+ const handleConnectionChange = (status: BackendConnectionStatus): void => {+ progress.clearAll?.();+ nodeExecution.clearAll();++ if (status === 'connected') {+ scheduleGalleryRefresh();+ void sweep();}};+ /** Attach generation listeners to the shared socket hub. */const connect = (): void => {- if (isDisposed || socket) {+ if (isDisposed || isAttached) {return;}- socket = createSocket();- notifyConnection('connecting');-- socket.on('connect', () => {- modelLoadStore.reset();- progress.clearAll?.();- nodeExecution.clearAll();- notifyConnection('connected');- socket?.emit('subscribe_queue', { queue_id: 'default' });- scheduleGalleryRefresh();- void sweep();- });- socket.on('connect_error', (error: { message: string }) => {- modelLoadStore.reset();- progress.clearAll?.();- nodeExecution.clearAll();- notifyConnection('disconnected', error.message);- });- socket.on('disconnect', (reason: string) => {- modelLoadStore.reset();- progress.clearAll?.();- nodeExecution.clearAll();- notifyConnection('disconnected', reason);- });- socket.on('queue_item_status_changed', handleStatusChanged);- socket.on('invocation_progress', handleProgress);- socket.on('invocation_started', (event: InvocationStartedEvent) => {- if (!isTrackedEvent(event)) {- return;- }-- nodeExecution.started(event);- });- socket.on('invocation_complete', (event: InvocationCompleteEvent) => {- if (!isTrackedEvent(event)) {- return;- }-- nodeExecution.completed(event);- });- socket.on('invocation_error', (event: InvocationErrorEvent) => {- if (!isTrackedEvent(event)) {- return;- }-- nodeExecution.failed(event);- });- socket.on('model_load_started', (payload: never) => {- modelLoadStore.started(payload);- });- socket.on('model_load_complete', (payload: never) => {- modelLoadStore.completed(payload);- });-- // Model install lifecycle events are broadcast to every connected client- // (no room subscription needed); forward them to the installs store so the- // model manager tracks downloads without a second socket.- for (const modelInstallEvent of MODEL_INSTALL_SOCKET_EVENTS) {- socket.on(modelInstallEvent, (payload: never) => {- handleModelInstallSocketEvent(modelInstallEvent, payload);- });- }-- socket.connect();+ isAttached = true;++ detachers.push(+ hub.on('queue_item_status_changed', handleStatusChanged),+ hub.on('invocation_progress', handleProgress),+ hub.on('invocation_started', (event: InvocationStartedEvent) => {+ if (!isTrackedEvent(event)) {+ return;+ }++ nodeExecution.started(event);+ }),+ hub.on('invocation_complete', (event: InvocationCompleteEvent) => {+ if (!isTrackedEvent(event)) {+ return;+ }++ nodeExecution.completed(event);+ }),+ hub.on('invocation_error', (event: InvocationErrorEvent) => {+ if (!isTrackedEvent(event)) {+ return;+ }++ nodeExecution.failed(event);+ }),+ hub.on('model_load_started', (payload: never) => {+ modelLoadStore.started(payload);+ }),+ hub.on('model_load_complete', (payload: never) => {+ modelLoadStore.completed(payload);+ })+ );++ // Fires synchronously with the current status, so attaching after the hub+ // has already connected still triggers the initial clear + sweep.+ detachers.push(hub.onConnectionChange(handleConnectionChange));sweepTimer = setInterval(() => {void sweep();}, sweepIntervalMs);};+ /** Detach generation listeners; the hub keeps the socket alive. */const dispose = (): void => {isDisposed = true;+ for (const detach of detachers) {+ detach();+ }++ detachers.length = 0;+if (galleryRefreshTimer !== null) {clearTimeout(galleryRefreshTimer);galleryRefreshTimer = null;@@ -520,9 +487,6 @@ export const createQueueCoordinator = (clearInterval(sweepTimer);sweepTimer = null;}-- socket?.disconnect();- socket = null;};const reconcile = async (items: ReconcileInput[]): Promise<Map<string, ReconcileOutcome>> => {diff --git a/invokeai/frontend/webv2/src/workbench/backend/socketHub.test.ts b/invokeai/frontend/webv2/src/workbench/backend/socketHub.test.tsnew file mode 100644index 0000000000..3f2a574786--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/backend/socketHub.test.ts@@ -0,0 +1,156 @@+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';++import type { BackendSocket } from './socketHub';++import { getConnectionStatus } from './connectionStore';+import { modelLoadStore } from './modelLoadStore';+import { createSocketHub } from './socketHub';++class FakeSocket implements BackendSocket {+ readonly emitted: { event: string; payload: unknown }[] = [];+ private readonly handlers = new Map<string, Set<(payload: never) => void>>();++ on(event: string, handler: (payload: never) => void): void {+ let handlers = this.handlers.get(event);++ if (!handlers) {+ handlers = new Set();+ this.handlers.set(event, handlers);+ }++ handlers.add(handler);+ }++ off(event: string, handler: (payload: never) => void): void {+ this.handlers.get(event)?.delete(handler);+ }++ emit(event: string, payload: unknown): void {+ this.emitted.push({ event, payload });+ }++ connect(): void {+ this.fire('connect', undefined);+ }++ disconnect(): void {+ this.fire('disconnect', 'io client disconnect');+ }++ fire(event: string, payload: unknown): void {+ for (const handler of this.handlers.get(event) ?? []) {+ (handler as (value: unknown) => void)(payload);+ }+ }+}++describe('socketHub', () => {+ beforeEach(() => {+ vi.clearAllMocks();+ });++ afterEach(() => {+ vi.restoreAllMocks();+ });++ it('connects, reports connected status, and subscribes to the queue', () => {+ const socket = new FakeSocket();+ const hub = createSocketHub({ createSocket: () => socket });+ const onChange = vi.fn();++ hub.onConnectionChange(onChange);+ onChange.mockClear();+ hub.connect();++ expect(getConnectionStatus().status).toBe('connected');+ expect(onChange).toHaveBeenNthCalledWith(1, 'connecting', undefined);+ expect(onChange).toHaveBeenLastCalledWith('connected', undefined);+ expect(socket.emitted).toContainEqual({ event: 'subscribe_queue', payload: { queue_id: 'default' } });+ });++ it('fires the current status synchronously on subscribe', () => {+ const socket = new FakeSocket();+ const hub = createSocketHub({ createSocket: () => socket });++ hub.connect();++ const late = vi.fn();++ hub.onConnectionChange(late);++ expect(late).toHaveBeenCalledWith('connected', undefined);+ });++ it('is idempotent — repeated connect keeps one socket', () => {+ let created = 0;+ const hub = createSocketHub({+ createSocket: () => {+ created += 1;++ return new FakeSocket();+ },+ });++ hub.connect();+ hub.connect();++ expect(created).toBe(1);+ });++ it('delivers consumer listeners and detaches them on unsubscribe', () => {+ const socket = new FakeSocket();+ const hub = createSocketHub({ createSocket: () => socket });++ hub.connect();++ const handler = vi.fn();+ const off = hub.on('queue_item_status_changed', handler);++ socket.fire('queue_item_status_changed', { item_id: 1 });+ expect(handler).toHaveBeenCalledTimes(1);++ off();+ socket.fire('queue_item_status_changed', { item_id: 2 });+ expect(handler).toHaveBeenCalledTimes(1);+ });++ it('re-binds consumer listeners after a reconnect', () => {+ const sockets: FakeSocket[] = [];+ const hub = createSocketHub({+ createSocket: () => {+ const socket = new FakeSocket();++ sockets.push(socket);++ return socket;+ },+ });++ hub.connect();++ const handler = vi.fn();++ hub.on('queue_item_status_changed', handler);+ hub.disconnect();+ hub.connect();++ expect(sockets).toHaveLength(2);++ sockets[1]!.fire('queue_item_status_changed', { item_id: 1 });++ expect(handler).toHaveBeenCalledTimes(1);+ });++ it('resets model loads and reports a disconnect', () => {+ const resetSpy = vi.spyOn(modelLoadStore, 'reset');+ const socket = new FakeSocket();+ const hub = createSocketHub({ createSocket: () => socket });++ hub.connect();+ expect(resetSpy).toHaveBeenCalled();++ socket.fire('disconnect', 'transport close');++ expect(getConnectionStatus().status).toBe('disconnected');+ });+});diff --git a/invokeai/frontend/webv2/src/workbench/backend/socketHub.ts b/invokeai/frontend/webv2/src/workbench/backend/socketHub.tsnew file mode 100644index 0000000000..344d236bb8--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/backend/socketHub.ts@@ -0,0 +1,150 @@+import type { BackendConnectionStatus } from '@workbench/types';++import { io } from 'socket.io-client';++import { setConnectionStatus } from './connectionStore';+import { getAuthToken, getBackendSocketUrl } from './http';+import { modelLoadStore } from './modelLoadStore';++const SOCKET_PATH = '/ws/socket.io';++/**+ * The minimal Socket.IO surface the hub uses; tests substitute a fake.+ */+export interface BackendSocket {+ on(event: string, handler: (payload: never) => void): unknown;+ off(event: string, handler: (payload: never) => void): unknown;+ emit(event: string, payload: unknown): unknown;+ connect(): unknown;+ disconnect(): unknown;+}++export type ConnectionListener = (status: BackendConnectionStatus, error?: string) => void;++/**+ * Owns the single backend socket for the whole authenticated app. It is only a+ * transport/status hub; feature runtimes attach their own listeners so admin+ * model code and editor queue code do not leak into the base Launchpad bundle.+ */+export interface SocketHub {+ /** Idempotent: connects the single socket if one is not already live. */+ connect(): void;+ /** Tears down the socket (identity change / logout); a later `connect` rebuilds it. */+ disconnect(): void;+ /** Attach a raw socket listener; returns an unsubscribe. Survives socket recreation. */+ on(event: string, handler: (payload: never) => void): () => void;+ emit(event: string, payload: unknown): void;+ /** Subscribe to connection transitions; fires synchronously with current status on subscribe. */+ onConnectionChange(handler: ConnectionListener): () => void;+}++const createDefaultSocket = (): BackendSocket => {+ const token = getAuthToken();++ // Socket.IO's generic `off` overload does not structurally match our minimal+ // facade; the socket satisfies the surface we actually use, so narrow it here.+ return io(getBackendSocketUrl(), {+ auth: token ? { token } : undefined,+ autoConnect: false,+ extraHeaders: token ? { Authorization: `Bearer ${token}` } : undefined,+ path: SOCKET_PATH,+ timeout: 60000,+ }) as unknown as BackendSocket;+};++export const createSocketHub = (options: { createSocket?: () => BackendSocket } = {}): SocketHub => {+ const createSocket = options.createSocket ?? createDefaultSocket;++ let socket: BackendSocket | null = null;+ let status: BackendConnectionStatus = 'connecting';+ let lastError: string | undefined;++ /** Registered consumer listeners, kept so they can be re-bound to a fresh socket. */+ const eventHandlers = new Map<string, Set<(payload: never) => void>>();+ const connectionListeners = new Set<ConnectionListener>();++ const publishStatus = (next: BackendConnectionStatus, error?: string): void => {+ status = next;+ lastError = error;+ setConnectionStatus(next, error);++ for (const listener of connectionListeners) {+ listener(next, error);+ }+ };++ const connect = (): void => {+ if (socket) {+ return;+ }++ const nextSocket = createSocket();++ socket = nextSocket;+ publishStatus('connecting');++ nextSocket.on('connect', () => {+ modelLoadStore.reset();+ publishStatus('connected');+ nextSocket.emit('subscribe_queue', { queue_id: 'default' });+ });+ nextSocket.on('connect_error', (error: { message: string }) => {+ modelLoadStore.reset();+ publishStatus('disconnected', error.message);+ });+ nextSocket.on('disconnect', (reason: string) => {+ modelLoadStore.reset();+ publishStatus('disconnected', reason);+ });++ // Re-bind consumer listeners so they survive a socket recreation.+ for (const [event, handlers] of eventHandlers) {+ for (const handler of handlers) {+ nextSocket.on(event, handler);+ }+ }++ nextSocket.connect();+ };++ const disconnect = (): void => {+ socket?.disconnect();+ socket = null;+ publishStatus('connecting');+ };++ const on = (event: string, handler: (payload: never) => void): (() => void) => {+ let handlers = eventHandlers.get(event);++ if (!handlers) {+ handlers = new Set();+ eventHandlers.set(event, handlers);+ }++ handlers.add(handler);+ socket?.on(event, handler);++ return () => {+ eventHandlers.get(event)?.delete(handler);+ socket?.off(event, handler);+ };+ };++ const emit = (event: string, payload: unknown): void => {+ socket?.emit(event, payload);+ };++ const onConnectionChange = (handler: ConnectionListener): (() => void) => {+ connectionListeners.add(handler);+ handler(status, lastError);++ return () => {+ connectionListeners.delete(handler);+ };+ };++ return { connect, disconnect, emit, on, onConnectionChange };+};++/** The app-wide socket hub singleton, connected by `SocketHubRuntime`. */+export const socketHub = createSocketHub();diff --git a/invokeai/frontend/webv2/src/workbench/customNodes/api.ts b/invokeai/frontend/webv2/src/workbench/customNodes/api.tsnew file mode 100644index 0000000000..eec33c2f4a--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/customNodes/api.ts@@ -0,0 +1,48 @@+import { apiFetch, apiFetchJson } from '@workbench/backend/http';++/** REST client for the custom nodes manager (`/api/v2/custom_nodes`). */++const CUSTOM_NODES_BASE = '/api/v2/custom_nodes';++export interface NodePackInfo {+ name: string;+ path: string;+ node_count: number;+ node_types: string[];+}++export interface NodePackListResponse {+ node_packs: NodePackInfo[];+ custom_nodes_path: string;+}++export interface InstallNodePackResponse {+ name: string;+ success: boolean;+ message: string;+ workflows_imported: number;+ requires_dependencies: boolean;+ dependency_file: string | null;+}++export interface UninstallNodePackResponse {+ name: string;+ success: boolean;+ message: string;+}++export const listCustomNodePacks = (): Promise<NodePackListResponse> =>+ apiFetchJson<NodePackListResponse>(`${CUSTOM_NODES_BASE}/`);++export const installCustomNodePack = (source: string): Promise<InstallNodePackResponse> =>+ apiFetchJson<InstallNodePackResponse>(`${CUSTOM_NODES_BASE}/install`, {+ body: JSON.stringify({ source }),+ method: 'POST',+ });++export const uninstallCustomNodePack = (packName: string): Promise<UninstallNodePackResponse> =>+ apiFetchJson<UninstallNodePackResponse>(`${CUSTOM_NODES_BASE}/${encodeURIComponent(packName)}`, { method: 'DELETE' });++export const reloadCustomNodes = async (): Promise<void> => {+ await apiFetch(`${CUSTOM_NODES_BASE}/reload`, { method: 'POST' });+};diff --git a/invokeai/frontend/webv2/src/workbench/customNodes/installLogStore.ts b/invokeai/frontend/webv2/src/workbench/customNodes/installLogStore.tsnew file mode 100644index 0000000000..e28070ad4d--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/customNodes/installLogStore.ts@@ -0,0 +1,36 @@+import { createExternalStore } from '@workbench/externalStore';++export interface CustomNodeInstallLogEntry {+ id: number;+ name: string;+ status: 'installing' | 'completed' | 'error' | 'uninstalled';+ message?: string;+ timestamp: number;+}++const LOG_LIMIT = 50;++const store = createExternalStore<{ log: CustomNodeInstallLogEntry[] }>({ log: [] });++let nextId = 1;++export const addCustomNodeInstallLogEntry = (+ entry: Omit<CustomNodeInstallLogEntry, 'id' | 'timestamp'>+): CustomNodeInstallLogEntry => {+ const nextEntry: CustomNodeInstallLogEntry = {+ ...entry,+ id: nextId,+ timestamp: Date.now(),+ };++ nextId += 1;+ store.patchSnapshot({ log: [nextEntry, ...store.getSnapshot().log].slice(0, LOG_LIMIT) });++ return nextEntry;+};++export const clearCustomNodeInstallLog = (): void => {+ store.patchSnapshot({ log: [] });+};++export const useCustomNodeInstallLog = (): CustomNodeInstallLogEntry[] => store.useSnapshot().log;diff --git a/invokeai/frontend/webv2/src/workbench/customNodes/nodesStore.ts b/invokeai/frontend/webv2/src/workbench/customNodes/nodesStore.tsnew file mode 100644index 0000000000..fa1ab977e1--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/customNodes/nodesStore.ts@@ -0,0 +1,63 @@+import { getApiErrorMessage } from '@workbench/backend/http';+import { createExternalStore } from '@workbench/externalStore';++import type { NodePackInfo } from './api';++import { listCustomNodePacks } from './api';++export interface CustomNodesSnapshot {+ nodePacks: NodePackInfo[];+ customNodesPath: string | null;+ status: 'idle' | 'loading' | 'loaded' | 'error';+ error: string | null;+}++const store = createExternalStore<CustomNodesSnapshot>({+ customNodesPath: null,+ error: null,+ nodePacks: [],+ status: 'idle',+});++let inflightRefresh: Promise<void> | null = null;++export const refreshCustomNodePacks = (): Promise<void> => {+ if (inflightRefresh) {+ return inflightRefresh;+ }++ store.patchSnapshot({ status: store.getSnapshot().status === 'loaded' ? 'loaded' : 'loading' });++ inflightRefresh = listCustomNodePacks()+ .then((response) => {+ store.patchSnapshot({+ customNodesPath: response.custom_nodes_path,+ error: null,+ nodePacks: response.node_packs,+ status: 'loaded',+ });+ })+ .catch((error: unknown) => {+ store.patchSnapshot({+ error: getApiErrorMessage(error, 'Failed to load custom node packs.'),+ status: store.getSnapshot().nodePacks.length > 0 ? 'loaded' : 'error',+ });+ })+ .finally(() => {+ inflightRefresh = null;+ });++ return inflightRefresh;+};++export const ensureCustomNodePacksLoaded = (): void => {+ if (store.getSnapshot().status === 'idle') {+ void refreshCustomNodePacks();+ }+};++export const removeCustomNodePackFromStore = (packName: string): void => {+ store.patchSnapshot({ nodePacks: store.getSnapshot().nodePacks.filter((pack) => pack.name !== packName) });+};++export const useCustomNodesSnapshot = (): CustomNodesSnapshot => store.useSnapshot();diff --git a/invokeai/frontend/webv2/src/workbench/customNodes/nodesUiStore.ts b/invokeai/frontend/webv2/src/workbench/customNodes/nodesUiStore.tsnew file mode 100644index 0000000000..c76879065a--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/customNodes/nodesUiStore.ts@@ -0,0 +1,43 @@+import { createExternalStore } from '@workbench/externalStore';++/**+ * Session-lived UI state for the Launchpad nodes manager. Keeping the active+ * detail tab, selected pack, search term, and add-node form tab in an external+ * store (the same pattern as the models UI store) means nothing resets while+ * the user navigates within the manager.+ */++export type NodesManagerTab = 'details' | 'add';+export type AddNodesTab = 'git' | 'scan';++export interface NodesUiSnapshot {+ activeTab: NodesManagerTab;+ addTab: AddNodesTab;+ activePackName: string | null;+ activityExpanded: boolean;+ searchTerm: string;+}++const store = createExternalStore<NodesUiSnapshot>({+ activeTab: 'details',+ activePackName: null,+ activityExpanded: false,+ addTab: 'git',+ searchTerm: '',+});++export const updateNodesUi = (next: Partial<NodesUiSnapshot>): void => store.patchSnapshot(next);++export const openNodePackDetail = (activePackName: string): void => {+ updateNodesUi({ activePackName, activeTab: 'details' });+};++export const openNodesManagerTab = (activeTab: NodesManagerTab): void => {+ updateNodesUi({ activeTab });+};++export const setNodeActivityExpanded = (activityExpanded: boolean): void => {+ updateNodesUi({ activityExpanded });+};++export const useNodesUi = (): NodesUiSnapshot => store.useSnapshot();diff --git a/invokeai/frontend/webv2/src/workbench/home/HomeScreen.tsx b/invokeai/frontend/webv2/src/workbench/home/HomeScreen.tsxdeleted file mode 100644index 4e063202b0..0000000000--- a/invokeai/frontend/webv2/src/workbench/home/HomeScreen.tsx+++ /dev/null@@ -1,213 +0,0 @@-import type { SystemStyleObject } from '@chakra-ui/react';--import { Box, Flex, Heading, HStack, Icon, Stack, Tabs, Text } from '@chakra-ui/react';-import { Link, useLocation, useNavigate } from '@tanstack/react-router';-import { useAuthSession } from '@workbench/auth/session';-import { Button, toaster } from '@workbench/components/ui';-import { refreshProjectLibrary } from '@workbench/projects/library';-import { importProjectFile, pickProjectFile } from '@workbench/projects/projectFile';-import { UsersManagementPanel } from '@workbench/users';-import { FileUpIcon, FolderIcon, PlusIcon, UsersIcon, type LucideIcon } from 'lucide-react';-import { useEffect, type ReactNode } from 'react';--import { HomeTopBar } from './HomeTopBar';-import { ProjectsGrid } from './ProjectsGrid';-import { ResourceLinks } from './ResourceLinks';--const HOME_SCREEN_CONTENT_WRAPPER_SX: SystemStyleObject = {- flex: 1,- maxW: '6xl',- mx: 'auto',- p: { base: 4, md: 8 },- w: 'full',-};--type HomeTabId = 'projects' | 'users';--interface HomeTabDefinition {- id: HomeTabId;- label: string;- icon: LucideIcon;- children: ReactNode;- condition?: boolean;-}--const DEFAULT_HOME_TAB_ID: HomeTabId = 'projects';--const isHomeTabId = (value: string): value is HomeTabId => value === 'projects' || value === 'users';--const normalizeHomeTabId = (value: string): HomeTabId | null => {- const id = value.replace(/^\/+/, '');-- return isHomeTabId(id) ? id : null;-};--const getRequestedHomeTabId = (pathname: string, hash: string): HomeTabId | null =>- normalizeHomeTabId(pathname) ?? normalizeHomeTabId(hash);--const getActiveHomeTabId = (tabs: HomeTabDefinition[], requestedTabId: HomeTabId | null): HomeTabId =>- requestedTabId && tabs.some((tab) => tab.id === requestedTabId) ? requestedTabId : DEFAULT_HOME_TAB_ID;--const replaceHomeTabHash = (tabId: HomeTabId): void => {- window.history.replaceState(- window.history.state,- '',- `${window.location.pathname}${window.location.search}#${tabId}`- );-};--const pushHomeTabHash = (tabId: HomeTabId): void => {- if (window.location.hash !== `#${tabId}`) {- window.location.hash = tabId;- }-};--/**- * The landing surface at `/`: your project library, profile/admin controls,- * and pointers to docs and community — the editor equivalent of Photoshop's- * home screen. It deliberately mounts none of the workbench providers or- * runtimes, so it stays on the light side of the route-level code split.- */-export const HomeScreen = () => {- const session = useAuthSession();- const navigate = useNavigate();-- useEffect(() => {- void refreshProjectLibrary();- }, []);-- const displayName = session.user?.display_name?.trim();- const greeting = displayName ? `Welcome back, ${displayName}` : 'Welcome to Invoke';- const canManageUsers = session.multiuserEnabled && session.user?.is_admin === true;-- const handleImport = async () => {- const file = await pickProjectFile();-- if (!file) {- return;- }-- try {- const record = await importProjectFile(file);-- await navigate({ search: { project: record.project_id }, to: '/app' });- } catch (error) {- toaster.create({- description: error instanceof Error ? error.message : undefined,- title: 'Import failed',- type: 'error',- });- }- };-- const allTabs: HomeTabDefinition[] = [- {- label: 'Projects',- icon: FolderIcon,- id: 'projects',- children: <ProjectsPanel greeting={greeting} onImport={handleImport} />,- },- {- label: 'Manage Users',- icon: UsersIcon,- id: 'users',- children: <UsersPanel />,- condition: canManageUsers,- },- ];- const tabs = allTabs.filter((tab) => tab.condition ?? true);-- return (- <Flex bg="bg" color="fg" direction="column" minH="100dvh">- <HomeTopBar />- <Box css={HOME_SCREEN_CONTENT_WRAPPER_SX}>- <HomeTabs tabs={tabs} />- </Box>- </Flex>- );-};--const HomeTabs = ({ tabs }: { tabs: HomeTabDefinition[] }) => {- const location = useLocation();- const requestedTabId = getRequestedHomeTabId(location.pathname, location.hash);- const activeTabId = getActiveHomeTabId(tabs, requestedTabId);-- useEffect(() => {- if (window.location.hash !== `#${activeTabId}`) {- replaceHomeTabHash(activeTabId);- }- }, [activeTabId]);-- return (- <Tabs.Root- display="flex"- flexDirection={{ base: 'column', md: 'row' }}- gap={{ base: '6', md: '10' }}- minH="0"- orientation="vertical"- value={activeTabId}- variant="subtle"- onValueChange={(details) => {- if (isHomeTabId(details.value)) {- pushHomeTabHash(details.value);- }- }}- >- <Stack flexShrink={0} gap="4" w={{ base: 'full', md: '60' }}>- {tabs.length > 1 ? (- <Tabs.List>- {tabs.map((tab) => (- <Tabs.Trigger key={tab.id} value={tab.id}>- <Icon as={tab.icon} boxSize="3.5" flexShrink={0} />- <Text truncate>{tab.label}</Text>- </Tabs.Trigger>- ))}- </Tabs.List>- ) : null}-- <ResourceLinks />- </Stack>- <Box flex="1" minW="0">- {tabs.map((tab) => (- <Tabs.Content key={tab.id} m="0" p="0" value={tab.id}>- {tab.children}- </Tabs.Content>- ))}- </Box>- </Tabs.Root>- );-};--const UsersPanel = () => (- <Box flex="1" minW={0}>- <UsersManagementPanel />- </Box>-);--const ProjectsPanel = ({ greeting, onImport }: { greeting: string; onImport: () => Promise<void> }) => (- <Stack flex="1" gap="5" minW="0">- <Flex align="center" gap="3" justify="space-between" wrap="wrap">- <Stack gap="0.5">- <Heading fontSize="xl" fontWeight="700">- {greeting}- </Heading>- <Text color="fg.muted" fontSize="xs">- Pick up where you left off, or start something new.- </Text>- </Stack>- <HStack gap="2" wrap="wrap">- <Button size="xs" variant="outline" onClick={() => void onImport()}>- <FileUpIcon />- Import…- </Button>- <Button asChild size="xs" variant="solid">- <Link search={{ new: true }} to="/app">- <PlusIcon />- New project- </Link>- </Button>- </HStack>- </Flex>- <ProjectsGrid />- </Stack>-);diff --git a/invokeai/frontend/webv2/src/workbench/home/HomeTopBar.tsx b/invokeai/frontend/webv2/src/workbench/home/HomeTopBar.tsxdeleted file mode 100644index 3f7869c28e..0000000000--- a/invokeai/frontend/webv2/src/workbench/home/HomeTopBar.tsx+++ /dev/null@@ -1,26 +0,0 @@-import { Flex, HStack, Text } from '@chakra-ui/react';-import { AccountMenu } from '@workbench/auth/components/AccountMenu';-import { InvokeMark } from '@workbench/auth/components/AuthScreen';--/**- * Home's slim header: brand on the left, shared account/settings controls on the right.- */-export const HomeTopBar = () => (- <Flex- align="center"- borderBottomWidth="1px"- borderColor="border.subtle"- flexShrink={0}- justify="space-between"- px={{ base: '5', md: '8' }}- py="3"- >- <HStack gap="2.5">- <InvokeMark size={22} />- <Text fontSize="sm" fontWeight="700">- Invoke- </Text>- </HStack>- <AccountMenu />- </Flex>-);diff --git a/invokeai/frontend/webv2/src/workbench/home/ResourceLinks.tsx b/invokeai/frontend/webv2/src/workbench/home/ResourceLinks.tsxdeleted file mode 100644index 510e5e36e8..0000000000--- a/invokeai/frontend/webv2/src/workbench/home/ResourceLinks.tsx+++ /dev/null@@ -1,37 +0,0 @@-import type { ComponentType } from 'react';--import { Card, Flex, Icon, Link, Stack, Text } from '@chakra-ui/react';-import { BookOpenTextIcon, ClapperboardIcon, CodeIcon, ExternalLinkIcon, MessagesSquareIcon } from 'lucide-react';--/**- * Home's side rail: pointers out to the docs and community, plus the- * placeholder slot where in-app tutorials will land.- */--const RESOURCES: { href: string; icon: ComponentType; label: string }[] = [- { href: 'https://invoke-ai.github.io/InvokeAI/', icon: BookOpenTextIcon, label: 'Documentation' },- { href: 'https://www.youtube.com/@invokeai', icon: ClapperboardIcon, label: 'YouTube' },- { href: 'https://discord.gg/ZmtBAhwWhy', icon: MessagesSquareIcon, label: 'Discord' },- { href: 'https://github.com/invoke-ai/InvokeAI', icon: CodeIcon, label: 'GitHub' },-];--export const ResourceLinks = () => (- <Stack>- <Card.Root variant="outline">- <Card.Header>Resources</Card.Header>- <Card.Body>- {RESOURCES.map((resource) => (- <Link href={resource.href} target="_blank" rel="noreferrer" asChild key={resource.href}>- <Flex align="center" gap={2} py={1}>- <Icon as={resource.icon} boxSize="3.5" />- <Text fontSize="sm">{resource.label}</Text>- <Icon as={ExternalLinkIcon} boxSize="3" color="fg.subtle" ms="auto" />- </Flex>- </Link>- ))}- </Card.Body>- </Card.Root>-- {/* TODO: Tutorials */}- </Stack>-);diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/Launchpad.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/Launchpad.tsxnew file mode 100644index 0000000000..2f0d2aed39--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/Launchpad.tsx@@ -0,0 +1,115 @@+import { Box, Flex } from '@chakra-ui/react';+import { useLocation, useNavigate } from '@tanstack/react-router';+import { useCapabilities } from '@workbench/auth/capabilities';+import { Tabs } from '@workbench/components/ui';+import { BoxIcon, BlocksIcon, FolderIcon, UsersIcon, type LucideIcon } from 'lucide-react';+import { type ReactNode } from 'react';++import { LaunchpadNav } from './LaunchpadNav';+import { LaunchpadTopBar } from './LaunchpadTopBar';+import { ModelsPage } from './pages/ModelsPage';+import { NodesPage } from './pages/NodesPage';+import { ProjectsPage } from './pages/ProjectsPage';+import { UsersPage } from './pages/UsersPage';++/**+ * The landing surface at `/`: a full-height shell with a slim section rail and+ * a full-width page area — the editor equivalent of Photoshop's home screen.+ * Sections live as switchable pages (Projects, the model manager, and admin+ * user management) so the surface has room to grow without crowding any one of+ * them. It deliberately mounts none of the workbench providers or runtimes, so+ * it stays on the light side of the route-level code split; the heaviest page,+ * the model manager, lazy-loads its own chunk the first time it is opened.+ */++type LaunchpadSectionId = 'projects' | 'models' | 'nodes' | 'users';++interface LaunchpadSection {+ id: LaunchpadSectionId;+ label: string;+ icon: LucideIcon;+ render: () => ReactNode;+ condition?: boolean;+}++const DEFAULT_SECTION_ID: LaunchpadSectionId = 'projects';+const SECTION_IDS: readonly string[] = ['projects', 'models', 'nodes', 'users'];++const isSectionId = (value: string): value is LaunchpadSectionId => SECTION_IDS.includes(value);++const normalizeSectionId = (value: string): LaunchpadSectionId | null => {+ const id = value.replace(/^\/+/, '');++ return isSectionId(id) ? id : null;+};++const SECTION_PATHS: Record<LaunchpadSectionId, '/projects' | '/models' | '/nodes' | '/users'> = {+ models: '/models',+ nodes: '/nodes',+ projects: '/projects',+ users: '/users',+};++const getRequestedSectionId = (pathname: string): LaunchpadSectionId | null => normalizeSectionId(pathname);++const getActiveSectionId = (+ sections: LaunchpadSection[],+ requestedSectionId: LaunchpadSectionId | null+): LaunchpadSectionId =>+ requestedSectionId && sections.some((section) => section.id === requestedSectionId)+ ? requestedSectionId+ : DEFAULT_SECTION_ID;++export const Launchpad = () => {+ const { canManageModels, canManageNodes, canManageUsers } = useCapabilities();++ const allSections: LaunchpadSection[] = [+ { icon: FolderIcon, id: 'projects', label: 'Projects', render: () => <ProjectsPage /> },+ { condition: canManageModels, icon: BoxIcon, id: 'models', label: 'Models', render: () => <ModelsPage /> },+ { condition: canManageNodes, icon: BlocksIcon, id: 'nodes', label: 'Nodes', render: () => <NodesPage /> },+ { condition: canManageUsers, icon: UsersIcon, id: 'users', label: 'Users', render: () => <UsersPage /> },+ ];+ const sections = allSections.filter((section) => section.condition ?? true);++ return (+ <Flex bg="bg" color="fg" direction="column" h="100dvh" overflow="hidden">+ <LaunchpadTopBar />+ <LaunchpadSections sections={sections} />+ </Flex>+ );+};++const LaunchpadSections = ({ sections }: { sections: LaunchpadSection[] }) => {+ const location = useLocation();+ const navigate = useNavigate();+ const requestedSectionId = getRequestedSectionId(location.pathname);+ const activeSectionId = getActiveSectionId(sections, requestedSectionId);++ return (+ <Tabs.Root+ display="flex"+ flex="1"+ flexDirection={{ base: 'column', md: 'row' }}+ lazyMount+ minH="0"+ size="sm"+ orientation="vertical"+ value={activeSectionId}+ variant="subtle"+ onValueChange={(details) => {+ if (isSectionId(details.value)) {+ void navigate({ to: SECTION_PATHS[details.value] });+ }+ }}+ >+ <LaunchpadNav items={sections} />+ <Box flex="1" minH="0" minW="0" position="relative">+ {sections.map((section) => (+ <Tabs.Content key={section.id} h="full" m="0" minH="0" p="0" value={section.id}>+ {section.render()}+ </Tabs.Content>+ ))}+ </Box>+ </Tabs.Root>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/LaunchpadNav.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/LaunchpadNav.tsxnew file mode 100644index 0000000000..815d373321--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/LaunchpadNav.tsx@@ -0,0 +1,49 @@+import type { LucideIcon } from 'lucide-react';++import { Box, Icon, Stack, Text } from '@chakra-ui/react';+import { Tabs } from '@workbench/components/ui';++import { ResourceLinks } from './ResourceLinks';++export interface LaunchpadNavItem {+ id: string;+ label: string;+ icon: LucideIcon;+}++/**+ * The Launchpad's persistent left rail: top-level section switcher up top,+ * docs/community links pinned to the bottom. Kept deliberately narrow so the+ * page area to its right gets the room — the model manager in particular wants+ * the full width. Renders inside the section `Tabs.Root`, so the triggers carry+ * the roving-focus and selection semantics for free.+ */+export const LaunchpadNav = ({ items }: { items: LaunchpadNavItem[] }) => (+ <Stack+ aria-label="Launchpad sections"+ as="nav"+ borderColor="border.subtle"+ borderEndWidth={{ md: '1px' }}+ flexShrink={0}+ gap="4"+ h="full"+ minH="0"+ p="2"+ w={{ base: 'full', md: '56' }}+ >+ {items.length > 1 ? (+ <Tabs.List flexShrink={0}>+ {items.map((item) => (+ <Tabs.Trigger key={item.id} value={item.id}>+ <Icon as={item.icon} boxSize="3.5" flexShrink={0} />+ <Text truncate>{item.label}</Text>+ </Tabs.Trigger>+ ))}+ </Tabs.List>+ ) : null}++ <Box mt={{ md: 'auto' }}>+ <ResourceLinks />+ </Box>+ </Stack>+);diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/LaunchpadTopBar.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/LaunchpadTopBar.tsxnew file mode 100644index 0000000000..a5c9c70f90--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/LaunchpadTopBar.tsx@@ -0,0 +1,67 @@+import type { BackendConnectionStatus } from '@workbench/types';++import { Box, Flex, HStack, Text } from '@chakra-ui/react';+import { AccountMenu } from '@workbench/auth/components/AccountMenu';+import { InvokeMark } from '@workbench/auth/components/AuthScreen';+import { useConnectionStatus } from '@workbench/backend/connectionStore';+import { SettingsButton } from '@workbench/settings/SettingsDialog';++const CONNECTION_LABEL: Record<Exclude<BackendConnectionStatus, 'connected'>, string> = {+ connecting: 'Connecting…',+ disconnected: 'Disconnected',+};++/** Subtle backend-connection indicator; hidden while the socket is healthy. */+const ConnectionChip = () => {+ const { status } = useConnectionStatus();++ if (status === 'connected') {+ return null;+ }++ const isDown = status === 'disconnected';++ return (+ <HStack+ bg="bg.muted"+ borderColor={isDown ? 'border.error' : 'border.subtle'}+ borderWidth="1px"+ gap="1.5"+ px="2.5"+ py="1"+ rounded="full"+ >+ <Box bg={isDown ? 'fg.error' : 'fg.muted'} boxSize="1.5" rounded="full" />+ <Text color={isDown ? 'fg.error' : 'fg.muted'} fontSize="2xs" fontWeight="600">+ {CONNECTION_LABEL[status]}+ </Text>+ </HStack>+ );+};++export const LaunchpadTopBar = () => (+ <Flex+ align="center"+ borderBottomWidth="1px"+ bg="bg.subtle"+ flexShrink={0}+ justify="space-between"+ pe="1.5"+ ps="4"+ h="12"+ >+ <HStack gap="3">+ <InvokeMark size={20} />+ <Text fontSize="sm" fontWeight="700">+ Invoke+ </Text>+ </HStack>+ <HStack gap="2">+ <ConnectionChip />+ <HStack gap="0.5">+ <SettingsButton />+ <AccountMenu />+ </HStack>+ </HStack>+ </Flex>+);diff --git a/invokeai/frontend/webv2/src/workbench/home/NewProjectCard.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/NewProjectCard.tsxsimilarity index 100%rename from invokeai/frontend/webv2/src/workbench/home/NewProjectCard.tsxrename to invokeai/frontend/webv2/src/workbench/launchpad/NewProjectCard.tsxdiff --git a/invokeai/frontend/webv2/src/workbench/home/ProjectCard.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/ProjectCard.tsxsimilarity index 83%rename from invokeai/frontend/webv2/src/workbench/home/ProjectCard.tsxrename to invokeai/frontend/webv2/src/workbench/launchpad/ProjectCard.tsxindex a3c0413ffb..b1ffba7f89 100644--- a/invokeai/frontend/webv2/src/workbench/home/ProjectCard.tsx+++ b/invokeai/frontend/webv2/src/workbench/launchpad/ProjectCard.tsx@@ -30,6 +30,8 @@ import { formatRelativeTime } from './formatRelativeTime';export const ProjectCard = ({ summary }: { summary: ProjectSummary }) => {const [isRenameOpen, setIsRenameOpen] = useState(false);const [isDeleteOpen, setIsDeleteOpen] = useState(false);+ const [isActionsOpen, setIsActionsOpen] = useState(false);+ const [contextMenuTarget, setContextMenuTarget] = useState<{ x: number; y: number } | null>(null);const handleRename = async (name: string) => {try {@@ -92,6 +94,11 @@ export const ProjectCard = ({ summary }: { summary: ProjectSummary }) => {rounded="lg"transition="border-color 0.15s ease, background 0.15s ease"_hover={{ bg: 'bg.muted', borderColor: 'border.emphasized' }}+ onContextMenu={(event) => {+ event.preventDefault();+ setContextMenuTarget({ x: event.clientX, y: event.clientY });+ setIsActionsOpen(true);+ }}><Linkaria-label={`Open ${summary.name}`}@@ -113,9 +120,32 @@ export const ProjectCard = ({ summary }: { summary: ProjectSummary }) => {</Stack></Flex><Box bottom="2" pointerEvents="auto" position="absolute" right="2" zIndex="1">- <Menu.Root positioning={{ placement: 'bottom-end' }}>+ <Menu.Root+ open={isActionsOpen}+ positioning={+ contextMenuTarget+ ? {+ getAnchorRect: () => ({ height: 1, width: 1, x: contextMenuTarget.x, y: contextMenuTarget.y }),+ placement: 'bottom-start',+ }+ : { placement: 'bottom-end' }+ }+ onOpenChange={(event) => {+ setIsActionsOpen(event.open);++ if (!event.open) {+ setContextMenuTarget(null);+ }+ }}+ ><Menu.Trigger asChild>- <IconButton aria-label={`Actions for ${summary.name}`} color="fg.muted" size="2xs" variant="ghost">+ <IconButton+ aria-label={`Actions for ${summary.name}`}+ color="fg.muted"+ size="2xs"+ variant="ghost"+ onClick={() => setContextMenuTarget(null)}+ ><EllipsisVerticalIcon /></IconButton></Menu.Trigger>@@ -155,12 +185,14 @@ export const ProjectCard = ({ summary }: { summary: ProjectSummary }) => {</Portal></Menu.Root></Box>+<RenameDialoginitialName={summary.name}isOpen={isRenameOpen}onClose={() => setIsRenameOpen(false)}onSubmit={handleRename}/>+<ConfirmDialogbody={`Delete "${summary.name}"? The project is removed from the server permanently.`}confirmLabel="Delete project"diff --git a/invokeai/frontend/webv2/src/workbench/home/ProjectsGrid.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/ProjectsGrid.tsxsimilarity index 100%rename from invokeai/frontend/webv2/src/workbench/home/ProjectsGrid.tsxrename to invokeai/frontend/webv2/src/workbench/launchpad/ProjectsGrid.tsxdiff --git a/invokeai/frontend/webv2/src/workbench/launchpad/ResourceLinks.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/ResourceLinks.tsxnew file mode 100644index 0000000000..e8296153ee--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/ResourceLinks.tsx@@ -0,0 +1,52 @@+import type { ComponentType } from 'react';++import { Card, Flex, Icon, Link, Stack, Text } from '@chakra-ui/react';+import { BookOpenTextIcon, ClapperboardIcon, CodeIcon, ExternalLinkIcon, MessagesSquareIcon } from 'lucide-react';++type ResourceLink = { href: string; icon: ComponentType; label: string };++const COMMUNITY: ResourceLink[] = [+ { href: 'https://discord.gg/ZmtBAhwWhy', icon: MessagesSquareIcon, label: 'Discord' },+ { href: 'https://github.com/invoke-ai/InvokeAI', icon: CodeIcon, label: 'GitHub' },+];++const GUIDES: ResourceLink[] = [+ { href: 'https://invoke-ai.github.io/InvokeAI/', icon: BookOpenTextIcon, label: 'Documentation' },+ { href: 'https://www.youtube.com/@invokeai', icon: ClapperboardIcon, label: 'YouTube' },+];++const RESOURCES = [+ {+ label: 'Community',+ resources: COMMUNITY,+ },+ {+ label: 'Guides',+ resources: GUIDES,+ },+];++const ResourceItem = ({ href, icon, label }: ResourceLink) => (+ <Link href={href} target="_blank" rel="noreferrer" asChild>+ <Flex align="center" gap={2} py={1}>+ <Icon as={icon} boxSize="3.5" />+ <Text fontSize="sm">{label}</Text>+ <Icon as={ExternalLinkIcon} boxSize="3" color="fg.subtle" ms="auto" />+ </Flex>+ </Link>+);++export const ResourceLinks = () => (+ <Stack>+ {RESOURCES.map((section) => (+ <Card.Root variant="outline" size="sm" key={section.label}>+ <Card.Header fontSize="sm">{section.label}</Card.Header>+ <Card.Body pt="2">+ {section.resources.map((resource) => (+ <ResourceItem {...resource} key={resource.href} />+ ))}+ </Card.Body>+ </Card.Root>+ ))}+ </Stack>+);diff --git a/invokeai/frontend/webv2/src/workbench/home/formatRelativeTime.ts b/invokeai/frontend/webv2/src/workbench/launchpad/formatRelativeTime.tssimilarity index 100%rename from invokeai/frontend/webv2/src/workbench/home/formatRelativeTime.tsrename to invokeai/frontend/webv2/src/workbench/launchpad/formatRelativeTime.tsdiff --git a/invokeai/frontend/webv2/src/workbench/launchpad/models/ModelManagerView.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/ModelManagerView.tsxnew file mode 100644index 0000000000..ba30a42d9a--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/ModelManagerView.tsx@@ -0,0 +1,24 @@+import { Flex } from '@chakra-ui/react';+import { ModelInstallRuntime } from '@workbench/models/ModelInstallRuntime';+import { ensureModelsLoaded } from '@workbench/models/modelsStore';+import { useEffect } from 'react';++import { DetailPane } from './manager/DetailPane';+import { LibraryColumn } from './manager/LibraryColumn';++/** Full model manager: persistent library column plus right-side detail pane. */+export const ModelManagerView = () => {+ useEffect(() => {+ ensureModelsLoaded();+ }, []);++ return (+ <Flex direction="column" h="full" minH="0" w="full">+ <ModelInstallRuntime />+ <Flex flex="1" minH="0" w="full">+ <LibraryColumn />+ <DetailPane />+ </Flex>+ </Flex>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/AccessTokenPopover.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/AccessTokenPopover.tsxnew file mode 100644index 0000000000..e7fda5b5d6--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/AccessTokenPopover.tsx@@ -0,0 +1,54 @@+import { Icon, Input, Popover, Portal, Stack, Text } from '@chakra-ui/react';+import { Button, IconButton } from '@workbench/components/ui';+import { KeyRoundIcon } from 'lucide-react';++/** Key icon -> popover with a one-off access token and a jump to the keys tab. */+export const AccessTokenPopover = ({+ onChange,+ onManageKeys,+ value,+}: {+ onChange: (value: string) => void;+ onManageKeys: () => void;+ value: string;+}) => (+ <Popover.Root lazyMount positioning={{ placement: 'bottom-end' }}>+ <Popover.Trigger asChild>+ <IconButton+ aria-label="Access token for this download"+ color={value.trim() === '' ? 'fg.muted' : 'accent.solid'}+ size="sm"+ variant="outline"+ >+ <Icon as={KeyRoundIcon} boxSize="4" />+ </IconButton>+ </Popover.Trigger>+ <Portal>+ <Popover.Positioner>+ <Popover.Content bg="bg.muted" borderColor="border.emphasized" borderWidth="1px" w="20rem">+ <Popover.Body p="2.5">+ <Stack gap="2">+ <Text color="fg.subtle" fontSize="2xs" fontWeight="700" textTransform="uppercase">+ Access Token+ </Text>+ <Input+ aria-label="Access token"+ placeholder="Only needed for protected sources"+ size="xs"+ type="password"+ value={value}+ onChange={(event) => onChange(event.currentTarget.value)}+ />+ <Text color="fg.subtle" fontSize="2xs">+ Attached to the next Pull only. For saved HuggingFace, Civitai, and provider keys, use the API Keys tab.+ </Text>+ <Button alignSelf="start" size="2xs" variant="ghost" onClick={onManageKeys}>+ Manage API keys {'->'}+ </Button>+ </Stack>+ </Popover.Body>+ </Popover.Content>+ </Popover.Positioner>+ </Portal>+ </Popover.Root>+);diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/AddModelsView.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/AddModelsView.tsxnew file mode 100644index 0000000000..355db4f502--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/AddModelsView.tsx@@ -0,0 +1,431 @@+import type { ModelSortField } from '@workbench/models/library';+import type { StarterModel } from '@workbench/models/types';++import { Box, Checkbox, Flex, HStack, Icon, Input, InputGroup, Stack, Text } from '@chakra-ui/react';+import { Button, Scrollable, Tooltip } from '@workbench/components/ui';+import { getExternalProviderConfigs, getHuggingFaceModels, scanFolderForModels } from '@workbench/models/api';+import { getModelBaseLabel } from '@workbench/models/baseIdentity';+import { collectBases, collectTypes } from '@workbench/models/library';+import { ensureStartersLoaded, useStartersSnapshot } from '@workbench/models/startersStore';+import { updateModelsUi, useModelsUi } from '@workbench/models/uiStore';+import { useNotify } from '@workbench/useNotify';+import { DownloadIcon, FileIcon, FolderIcon, FolderSearchIcon, LinkIcon, SearchIcon } from 'lucide-react';+import { useDeferredValue, useEffect, useMemo, useState } from 'react';+import { SiHuggingface } from 'react-icons/si';++import type { StarterInstallSource } from './starterModelInstallSources';++import { AccessTokenPopover } from './AccessTokenPopover';+import { BundleChips } from './BundleChips';+import { HuggingFaceFiles } from './HuggingFaceFiles';+import { ScanResults } from './ScanResults';+import { SelectedBundleBar } from './SelectedBundleBar';+import { classifySource } from './sourceClassifier';+import { DEFAULT_STARTER_MODEL_FILTERS, StarterFilterMenu, type StarterModelFilters } from './StarterFilterMenu';+import { StarterList } from './StarterList';+import { getStarterBundleInstallSources, getStarterModelInstallSources } from './starterModelInstallSources';+import { useInstallActions } from './useInstallActions';++interface IndexedStarterModel {+ index: number;+ model: StarterModel;+}++const compareStarterModels = (a: IndexedStarterModel, b: IndexedStarterModel, field: ModelSortField): number => {+ switch (field) {+ case 'default':+ return a.index - b.index;+ case 'name':+ return a.model.name.localeCompare(b.model.name, undefined, { sensitivity: 'base' });+ case 'base':+ return getModelBaseLabel(a.model.base).localeCompare(getModelBaseLabel(b.model.base));+ case 'format':+ return String(a.model.format ?? '').localeCompare(String(b.model.format ?? ''));+ case 'size':+ return 0;+ }+};++/**+ * One box to add any model. The same field searches the curated starter+ * catalog and accepts a URL, local path, or HuggingFace repo to install+ * directly. Source-specific result panels live under `add-models/` so this file+ * stays focused on state and install orchestration.+ */+export const AddModelsView = () => {+ const notify = useNotify();+ const { install, pendingSources } = useInstallActions();+ const { error: loadError, response, status } = useStartersSnapshot();+ const { hfLookup, scan } = useModelsUi();++ const [query, setQuery] = useState('');+ const [accessToken, setAccessToken] = useState('');+ const [inplace, setInplace] = useState(true);+ const [selectedBundleName, setSelectedBundleName] = useState<string | null>(null);+ const [isPulling, setIsPulling] = useState(false);+ const [isScanning, setIsScanning] = useState(false);+ const [installingBundle, setInstallingBundle] = useState<string | null>(null);+ const [configuredExternalProviders, setConfiguredExternalProviders] = useState<ReadonlySet<string>>(() => new Set());+ const [starterFilters, setStarterFilters] = useState<StarterModelFilters>(DEFAULT_STARTER_MODEL_FILTERS);++ useEffect(() => {+ ensureStartersLoaded();+ }, []);++ useEffect(() => {+ let isStale = false;++ getExternalProviderConfigs()+ .then((configs) => {+ if (isStale) {+ return;+ }++ setConfiguredExternalProviders(+ new Set(configs.filter((config) => config.api_key_configured).map((config) => config.provider_id))+ );+ })+ .catch((error) => {+ if (isStale) {+ return;+ }++ setConfiguredExternalProviders(new Set());+ notify.error('External provider keys unavailable', error instanceof Error ? error.message : String(error));+ });++ return () => {+ isStale = true;+ };+ }, [notify]);++ const trimmed = query.trim();+ const deferredTrimmed = useDeferredValue(trimmed);+ // A pull/scan results panel is showing: focus on the results and hide the+ // browse-only chrome (bundles, filter menu, starter catalog).+ const hasResults = hfLookup !== null || scan !== null;+ const kind = useMemo(() => classifySource(trimmed), [trimmed]);+ const searchIcon = kind.looksRepo+ ? SiHuggingface+ : kind.looksUrl+ ? LinkIcon+ : kind.localKind === 'file'+ ? FileIcon+ : kind.localKind === 'folder'+ ? FolderIcon+ : SearchIcon;+ const token = accessToken.trim() === '' ? undefined : accessToken.trim();+ // The primary action depends on the detected input: folders are scanned for+ // models; files, URLs, and HF repos are pulled. Access tokens only apply to URLs.+ const canScan = kind.localKind === 'folder';+ const canPull = kind.isInstallable && !canScan;++ const bundles = useMemo(() => (response ? Object.values(response.starter_bundles) : []), [response]);+ const selectedBundle = useMemo(+ () => bundles.find((bundle) => bundle.name === selectedBundleName) ?? null,+ [bundles, selectedBundleName]+ );+ const sourceModels = useMemo(+ () => selectedBundle?.models ?? response?.starter_models ?? [],+ [response, selectedBundle]+ );+ const selectedBundleSources = useMemo(+ () => (selectedBundle ? new Set(selectedBundle.models.map((model) => model.source)) : undefined),+ [selectedBundle]+ );+ const availableStarterBases = useMemo(() => collectBases(sourceModels), [sourceModels]);+ const availableStarterTypes = useMemo(() => collectTypes(sourceModels), [sourceModels]);++ const filteredModels = useMemo(() => {+ const terms = deferredTrimmed.toLowerCase().split(/\s+/).filter(Boolean);+ const directionFactor = starterFilters.sortDirection === 'desc' ? -1 : 1;++ return sourceModels+ .map((model, index) => ({ index, model }))+ .filter(({ model }) => {+ const haystack =+ `${model.name} ${model.description} ${model.base} ${model.type} ${model.format ?? ''} ${model.variant ?? ''}`.toLowerCase();++ return (+ (starterFilters.typeFilter === null || model.type === starterFilters.typeFilter) &&+ (starterFilters.baseFilter === null || model.base === starterFilters.baseFilter) &&+ terms.every((term) => haystack.includes(term))+ );+ })+ .sort((a, b) => compareStarterModels(a, b, starterFilters.sortField) * directionFactor)+ .map(({ model }) => model);+ }, [deferredTrimmed, sourceModels, starterFilters]);++ const queueSources = async (entries: StarterInstallSource[]): Promise<number> => {+ let queued = 0;++ for (const { config, source } of entries) {+ if (await install({ config, source }, { silent: true })) {+ queued += 1;+ }+ }++ return queued;+ };++ const installStarter = async (model: StarterModel) => {+ const queued = await queueSources(+ getStarterModelInstallSources(model, { dependencySourcesToSkip: selectedBundleSources })+ );++ if (queued > 0) {+ notify.success(+ 'Model install queued',+ queued > 1 ? `${model.name} and ${queued - 1} dependenc${queued === 2 ? 'y' : 'ies'}` : model.name+ );+ }+ };++ const installBundle = async () => {+ if (!selectedBundle) {+ return;+ }++ setInstallingBundle(selectedBundle.name);++ try {+ const queued = await queueSources(getStarterBundleInstallSources(selectedBundle));++ if (queued > 0) {+ notify.success(+ 'Bundle install queued',+ `${selectedBundle.name}: ${queued} install${queued === 1 ? '' : 's'} queued.`+ );+ }+ } finally {+ setInstallingBundle(null);+ }+ };++ const handlePull = async () => {+ if (!kind.isInstallable) {+ return;+ }++ setIsPulling(true);++ try {+ if (kind.looksRepo) {+ const lookup = await getHuggingFaceModels(trimmed);++ if (lookup.is_diffusers) {+ updateModelsUi({ hfLookup: null });++ if (await install({ accessToken: token, source: trimmed })) {+ setQuery('');+ }++ return;+ }++ if (!lookup.urls || lookup.urls.length === 0) {+ notify.error('No model files found', 'This HuggingFace repo has no installable model files.');++ return;+ }++ // A single-file repo has nothing to choose from — install it directly,+ // mirroring the diffusers path, instead of showing a one-row list.+ const [onlyUrl] = lookup.urls;++ if (lookup.urls.length === 1 && onlyUrl) {+ updateModelsUi({ hfLookup: null });++ if (await install({ accessToken: token, source: onlyUrl })) {+ setQuery('');+ }++ return;+ }++ updateModelsUi({ hfLookup: { repo: trimmed, urls: lookup.urls } });++ return;+ }++ if (await install({ accessToken: token, inplace: kind.looksLocal ? inplace : undefined, source: trimmed })) {+ setQuery('');+ }+ } catch (error) {+ notify.error('Install failed', error instanceof Error ? error.message : String(error));+ } finally {+ setIsPulling(false);+ }+ };++ const handleScan = async () => {+ setIsScanning(true);++ try {+ updateModelsUi({ scan: { path: trimmed, results: await scanFolderForModels(trimmed) } });+ } catch (error) {+ notify.error('Scan failed', error instanceof Error ? error.message : String(error));+ } finally {+ setIsScanning(false);+ }+ };++ return (+ <Flex direction="column" h="full" minH="0">+ <Stack gap="2" pb="2" pt="3">+ <HStack align="center" gap="2" px="3">+ <InputGroup flex="1" startElement={<Icon as={searchIcon} boxSize="3.5" color="fg.subtle" />}>+ <Input+ aria-label="Search or add a model"+ placeholder="Search models, or paste a URL, file path, or Hugging Face repo"+ size="sm"+ value={query}+ onChange={(event) => setQuery(event.currentTarget.value)}+ onKeyDown={(event) => {+ if (event.key !== 'Enter') {+ return;+ }++ if (canScan) {+ event.preventDefault();+ void handleScan();+ } else if (canPull) {+ event.preventDefault();+ void handlePull();+ }+ }}+ />+ </InputGroup>++ {kind.looksUrl ? (+ <AccessTokenPopover+ value={accessToken}+ onChange={setAccessToken}+ onManageKeys={() => updateModelsUi({ activeTab: 'keys' })}+ />+ ) : null}++ {canScan ? (+ <Tooltip content="Scan this folder for model files">+ <Button loading={isScanning} size="sm" variant="solid" onClick={() => void handleScan()}>+ <Icon as={FolderSearchIcon} boxSize="3.5" />+ Scan+ </Button>+ </Tooltip>+ ) : null}++ {canPull ? (+ <Button loading={isPulling} size="sm" variant="solid" onClick={() => void handlePull()}>+ <Icon as={DownloadIcon} boxSize="3.5" />+ Pull+ </Button>+ ) : null}+ </HStack>++ {kind.isInstallable && !hasResults ? (+ <HStack color="fg.subtle" fontSize="2xs" gap="2" px="3" wrap="wrap">+ {canScan ? (+ <Text>+ Press{' '}+ <Text as="span" color="fg.muted" fontWeight="600">+ Scan+ </Text>{' '}+ to find models in this folder.+ </Text>+ ) : (+ <Text>+ Press{' '}+ <Text as="span" color="fg.muted" fontWeight="600">+ Pull+ </Text>{' '}+ to install from {kind.label}.+ </Text>+ )}+ {kind.localKind === 'file' ? (+ <Checkbox.Root+ checked={inplace}+ colorPalette="accent"+ size="xs"+ onCheckedChange={(event) => setInplace(event.checked === true)}+ >+ <Checkbox.HiddenInput />+ <Checkbox.Control />+ <Checkbox.Label fontSize="2xs">Install in place</Checkbox.Label>+ </Checkbox.Root>+ ) : null}+ </HStack>+ ) : null}++ {!hasResults ? (+ <>+ <BundleChips+ bundles={bundles}+ selectedName={selectedBundleName}+ starterCount={response?.starter_models.length ?? 0}+ trailing={+ response ? (+ <StarterFilterMenu+ availableBases={availableStarterBases}+ availableTypes={availableStarterTypes}+ filters={starterFilters}+ onChange={setStarterFilters}+ />+ ) : undefined+ }+ onSelect={setSelectedBundleName}+ />++ {selectedBundle ? (+ <SelectedBundleBar+ bundle={selectedBundle}+ isInstalling={installingBundle === selectedBundle.name}+ onInstall={() => void installBundle()}+ />+ ) : null}+ </>+ ) : null}+ </Stack>++ <Box flex="1" minH="0">+ <Scrollable h="full" label="Add models results" minH="0" px="3" pb="3">+ <Stack gap="3">+ {hfLookup ? (+ <HuggingFaceFiles+ lookup={hfLookup}+ pendingSources={pendingSources}+ onClear={() => updateModelsUi({ hfLookup: null })}+ onInstall={(url) => void install({ accessToken: token, source: url })}+ />+ ) : null}++ {scan ? (+ <ScanResults+ inplace={inplace}+ pendingSources={pendingSources}+ scan={scan}+ onClear={() => updateModelsUi({ scan: null })}+ onInstall={(path) => void install({ inplace, source: path })}+ onSetInplace={setInplace}+ />+ ) : null}++ {!hasResults ? (+ <StarterList+ configuredExternalProviders={configuredExternalProviders}+ isInstallable={kind.isInstallable}+ loadError={loadError}+ models={filteredModels}+ pendingSources={pendingSources}+ response={response}+ selectedBundleSources={selectedBundleSources}+ status={status}+ onConfigureExternalProvider={() => updateModelsUi({ activeTab: 'keys' })}+ onInstall={(model) => void installStarter(model)}+ />+ ) : null}+ </Stack>+ </Scrollable>+ </Box>+ </Flex>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/BundleChips.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/BundleChips.tsxnew file mode 100644index 0000000000..9a1686f9a9--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/BundleChips.tsx@@ -0,0 +1,85 @@+import type { StarterModelBundle } from '@workbench/models/types';+import type { ReactNode } from 'react';++import { Badge, Box, HStack, Icon } from '@chakra-ui/react';+import { Button } from '@workbench/components/ui';+import { CheckIcon, FolderIcon } from 'lucide-react';++/** Horizontal row of bundle filters. */+export const BundleChips = ({+ bundles,+ onSelect,+ selectedName,+ starterCount,+ trailing,+}: {+ bundles: StarterModelBundle[];+ onSelect: (name: string | null) => void;+ selectedName: string | null;+ starterCount: number;+ trailing?: ReactNode;+}) => {+ if (bundles.length === 0 && !trailing) {+ return null;+ }++ return (+ <HStack align="center" gap="2" minW="0" px="3" pb="1">+ {bundles.length > 0 ? (+ <HStack+ flex="1"+ gap="1.5"+ minW="0"+ overflowX="auto"+ css={{ scrollbarWidth: 'thin', '&::-webkit-scrollbar': { height: '4px' } }}+ >+ <BundleChip+ isSelected={selectedName === null}+ label="All"+ subLabel={`${starterCount}`}+ onSelect={() => onSelect(null)}+ />+ {bundles.map((bundle) => {+ const missingCount = bundle.models.filter((model) => !model.is_installed).length;++ return (+ <BundleChip+ key={bundle.name}+ isComplete={missingCount === 0}+ isSelected={selectedName === bundle.name}+ label={bundle.name}+ subLabel={`${bundle.models.length}`}+ onSelect={() => onSelect(bundle.name)}+ />+ );+ })}+ </HStack>+ ) : (+ <Box flex="1" minW="0" />+ )}+ {trailing}+ </HStack>+ );+};++const BundleChip = ({+ isComplete = false,+ isSelected,+ label,+ onSelect,+ subLabel,+}: {+ isComplete?: boolean;+ isSelected: boolean;+ label: string;+ onSelect: () => void;+ subLabel: string;+}) => (+ <Button flexShrink={0} size="xs" variant={isSelected ? 'solid' : 'subtle'} onClick={onSelect}>+ <Icon as={isComplete ? CheckIcon : FolderIcon} boxSize="3" />+ {label}+ <Badge variant="surface" size="xs" ms="1" me="-1">+ {subLabel}+ </Badge>+ </Button>+);diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/HuggingFaceFiles.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/HuggingFaceFiles.tsxnew file mode 100644index 0000000000..446ed36bcd--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/HuggingFaceFiles.tsx@@ -0,0 +1,64 @@+import type { HFLookupState } from '@workbench/models/uiStore';++import { Stack } from '@chakra-ui/react';+import { ResultsListHeader } from '@workbench/launchpad/models/shared/ResultsListHeader';+import { InstallSourceButton, SourceListItem } from '@workbench/launchpad/models/shared/SourceListItem';+import { useDeferredValue, useMemo, useState } from 'react';++const fileNameOf = (url: string): string => url.split(/[\\/]/).at(-1) ?? url;++export const HuggingFaceFiles = ({+ lookup,+ onClear,+ onInstall,+ pendingSources,+}: {+ lookup: HFLookupState;+ onClear: () => void;+ onInstall: (url: string) => void;+ pendingSources: ReadonlySet<string>;+}) => {+ const [filter, setFilter] = useState('');+ const deferredFilter = useDeferredValue(filter);++ const filteredUrls = useMemo(() => {+ const term = deferredFilter.trim().toLowerCase();++ if (!term) {+ return lookup.urls;+ }++ return lookup.urls.filter((url) => fileNameOf(url).toLowerCase().includes(term));+ }, [deferredFilter, lookup.urls]);++ const installAll = () => {+ for (const url of filteredUrls) {+ onInstall(url);+ }+ };++ return (+ <Stack gap="1.5">+ <ResultsListHeader+ installAllDisabled={filteredUrls.length === 0}+ installAllLabel={`Install all (${filteredUrls.length})`}+ searchPlaceholder="Filter files"+ searchValue={filter}+ summary={`${lookup.urls.length} file${lookup.urls.length === 1 ? '' : 's'} in ${lookup.repo}`}+ onClear={onClear}+ onInstallAll={installAll}+ onSearchChange={setFilter}+ />+ {filteredUrls.map((url) => (+ <SourceListItem+ key={url}+ title={fileNameOf(url)}+ titleTooltip={url}+ trailing={+ <InstallSourceButton isPending={pendingSources.has(url)} source={url} onInstall={() => onInstall(url)} />+ }+ />+ ))}+ </Stack>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/ScanResults.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/ScanResults.tsxnew file mode 100644index 0000000000..748f8ad6d8--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/ScanResults.tsx@@ -0,0 +1,103 @@+import type { FoundModel } from '@workbench/models/types';++import { Checkbox, HStack, Icon, Stack, Text } from '@chakra-ui/react';+import { IconButton } from '@workbench/components/ui';+import { ResultsListHeader } from '@workbench/launchpad/models/shared/ResultsListHeader';+import { InstallSourceButton, SourceListItem } from '@workbench/launchpad/models/shared/SourceListItem';+import { XIcon } from 'lucide-react';+import { useDeferredValue, useMemo, useState } from 'react';++const fileNameOf = (path: string): string => path.split(/[\\/]/).at(-1) ?? path;++export const ScanResults = ({+ inplace,+ onClear,+ onInstall,+ onSetInplace,+ pendingSources,+ scan,+}: {+ inplace: boolean;+ onClear: () => void;+ onInstall: (path: string) => void;+ onSetInplace: (inplace: boolean) => void;+ pendingSources: ReadonlySet<string>;+ scan: { path: string; results: FoundModel[] };+}) => {+ const [filter, setFilter] = useState('');+ const deferredFilter = useDeferredValue(filter);++ const filteredResults = useMemo(() => {+ const term = deferredFilter.trim().toLowerCase();++ if (!term) {+ return scan.results;+ }++ return scan.results.filter((result) => fileNameOf(result.path).toLowerCase().includes(term));+ }, [deferredFilter, scan.results]);++ const notInstalledCount = scan.results.filter((result) => !result.is_installed).length;+ const installable = filteredResults.filter((result) => !result.is_installed);++ const installAll = () => {+ for (const result of installable) {+ onInstall(result.path);+ }+ };++ if (scan.results.length === 0) {+ return (+ <HStack justify="space-between">+ <Text color="fg.subtle" fontSize="2xs">+ No model files found in {scan.path}.+ </Text>+ <IconButton aria-label="Dismiss scan results" size="2xs" variant="ghost" onClick={onClear}>+ <Icon as={XIcon} boxSize="3" />+ </IconButton>+ </HStack>+ );+ }++ return (+ <Stack gap="1.5">+ <ResultsListHeader+ extra={+ <Checkbox.Root+ checked={inplace}+ colorPalette="accent"+ size="xs"+ onCheckedChange={(event) => onSetInplace(event.checked === true)}+ >+ <Checkbox.HiddenInput />+ <Checkbox.Control />+ <Checkbox.Label fontSize="2xs">Install in place</Checkbox.Label>+ </Checkbox.Root>+ }+ installAllDisabled={installable.length === 0}+ installAllLabel={`Install all (${installable.length})`}+ searchValue={filter}+ summary={`${scan.results.length} file${scan.results.length === 1 ? '' : 's'} in ${scan.path} · ${notInstalledCount} not installed`}+ onClear={onClear}+ onInstallAll={installAll}+ onSearchChange={setFilter}+ />+ {filteredResults.map((result) => (+ <SourceListItem+ key={result.path}+ description={result.path}+ title={fileNameOf(result.path)}+ titleTooltip={result.path}+ trailing={+ <InstallSourceButton+ isInstalled={result.is_installed}+ isPending={pendingSources.has(result.path)}+ source={result.path}+ onInstall={() => onInstall(result.path)}+ />+ }+ />+ ))}+ </Stack>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/SelectedBundleBar.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/SelectedBundleBar.tsxnew file mode 100644index 0000000000..fb9ef8305a--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/SelectedBundleBar.tsx@@ -0,0 +1,33 @@+import type { StarterModelBundle } from '@workbench/models/types';++import { HStack, Icon, Text } from '@chakra-ui/react';+import { Button } from '@workbench/components/ui';+import { DownloadIcon } from 'lucide-react';++/** Summary + install action for the currently selected bundle. */+export const SelectedBundleBar = ({+ bundle,+ isInstalling,+ onInstall,+}: {+ bundle: StarterModelBundle;+ isInstalling: boolean;+ onInstall: () => void;+}) => {+ const missingCount = bundle.models.filter((model) => !model.is_installed).length;++ return (+ <HStack gap="2" justify="space-between" px="3">+ <Text color="fg.subtle" fontSize="2xs" truncate>+ {bundle.name} · {bundle.models.length} models ·{' '}+ {missingCount === 0 ? 'all installed' : `${missingCount} to install`}+ </Text>+ {missingCount > 0 ? (+ <Button flexShrink={0} loading={isInstalling} size="2xs" variant="outline" onClick={onInstall}>+ <Icon as={DownloadIcon} boxSize="3" />+ Install bundle+ </Button>+ ) : null}+ </HStack>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/StarterFilterMenu.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/StarterFilterMenu.tsxnew file mode 100644index 0000000000..011b524010--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/StarterFilterMenu.tsx@@ -0,0 +1,58 @@+import type { ModelFilterSortOption } from '@workbench/launchpad/models/shared/ModelFilterMenu';+import type { ModelSortField } from '@workbench/models/library';+import type { ModelTaxonomyType } from '@workbench/models/types';++import { ModelFilterMenu } from '@workbench/launchpad/models/shared/ModelFilterMenu';++export interface StarterModelFilters {+ /** null = all types. */+ typeFilter: ModelTaxonomyType | null;+ /** null = all bases. */+ baseFilter: string | null;+ sortField: ModelSortField;+ sortDirection: 'asc' | 'desc';+}++export const DEFAULT_STARTER_MODEL_FILTERS: StarterModelFilters = {+ baseFilter: null,+ sortDirection: 'asc',+ sortField: 'default',+ typeFilter: null,+};++const STARTER_SORT_FIELDS: ModelFilterSortOption[] = [+ { field: 'default', label: 'Default' },+ { field: 'name', label: 'Name' },+ { field: 'base', label: 'Base' },+ { field: 'format', label: 'Format' },+];++const isFiltering = (filters: StarterModelFilters): boolean =>+ filters.typeFilter !== null || filters.baseFilter !== null;++export const StarterFilterMenu = ({+ availableBases,+ availableTypes,+ filters,+ onChange,+}: {+ availableBases: string[];+ availableTypes: ModelTaxonomyType[];+ filters: StarterModelFilters;+ onChange: (filters: StarterModelFilters) => void;+}) => (+ <ModelFilterMenu+ ariaLabel="Filter and sort starter models"+ availableBases={availableBases}+ availableTypes={availableTypes}+ baseFilter={filters.baseFilter}+ isActive={isFiltering(filters)}+ sortDirection={filters.sortDirection}+ sortField={filters.sortField}+ sortFields={STARTER_SORT_FIELDS}+ typeFilter={filters.typeFilter}+ onBaseFilterChange={(baseFilter) => onChange({ ...filters, baseFilter })}+ onSortChange={(sortField, sortDirection) => onChange({ ...filters, sortDirection, sortField })}+ onTypeFilterChange={(typeFilter) => onChange({ ...filters, typeFilter })}+ />+);diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/StarterList.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/StarterList.tsxnew file mode 100644index 0000000000..700f9af1cb--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/StarterList.tsx@@ -0,0 +1,139 @@+import type { useStartersSnapshot } from '@workbench/models/startersStore';+import type { StarterModel } from '@workbench/models/types';++import { Badge, Flex, Icon, Spinner, Stack, Text } from '@chakra-ui/react';+import { Button } from '@workbench/components/ui';+import { InstallSourceButton, SourceListItem } from '@workbench/launchpad/models/shared/SourceListItem';+import { getModelBaseColorPalette, getModelBaseLabel } from '@workbench/models/baseIdentity';+import { getModelTypeLabel } from '@workbench/models/taxonomy';+import { KeyRoundIcon } from 'lucide-react';++const getExternalProviderId = (source: string): string | null => {+ if (!source.startsWith('external://')) {+ return null;+ }++ return source.slice('external://'.length).split('/', 1)[0] || null;+};++export const StarterList = ({+ configuredExternalProviders,+ isInstallable,+ loadError,+ models,+ onConfigureExternalProvider,+ onInstall,+ pendingSources,+ response,+ selectedBundleSources,+ status,+}: {+ configuredExternalProviders: ReadonlySet<string>;+ isInstallable: boolean;+ loadError: string | null;+ models: StarterModel[];+ onConfigureExternalProvider: () => void;+ onInstall: (model: StarterModel) => void;+ pendingSources: ReadonlySet<string>;+ response: ReturnType<typeof useStartersSnapshot>['response'];+ selectedBundleSources: ReadonlySet<string> | undefined;+ status: ReturnType<typeof useStartersSnapshot>['status'];+}) => {+ if (status === 'error' && loadError) {+ return (+ <Stack align="center" gap="1" py="8">+ <Text color="fg.error" fontSize="xs" fontWeight="600">+ Could not load starter models+ </Text>+ <Text color="fg.subtle" fontSize="2xs">+ {loadError}+ </Text>+ </Stack>+ );+ }++ if (!response) {+ return (+ <Flex align="center" justify="center" py="10">+ <Spinner color="fg.subtle" size="sm" />+ </Flex>+ );+ }++ if (models.length === 0) {+ return (+ <Text color="fg.subtle" fontSize="2xs" py="6" textAlign="center">+ {isInstallable+ ? 'No starter models match - press Pull to install the source you entered.'+ : 'No starter models match your search.'}+ </Text>+ );+ }++ return (+ <Stack gap="1.5">+ {models.map((model) => {+ const externalProviderId = getExternalProviderId(model.source);+ const dependencyCount = (model.dependencies ?? []).filter(+ (dependency) => !dependency.is_installed && !selectedBundleSources?.has(dependency.source)+ ).length;+ const trailing = externalProviderId ? (+ configuredExternalProviders.has(externalProviderId) ? (+ <Badge colorPalette="green" flexShrink={0} fontSize="2xs" size="sm" variant="surface">+ Installed+ </Badge>+ ) : (+ <Button+ flexShrink={0}+ size="2xs"+ variant="outline"+ onClick={(event) => {+ event.stopPropagation();+ onConfigureExternalProvider();+ }}+ >+ <Icon as={KeyRoundIcon} boxSize="3" />+ Configure+ </Button>+ )+ ) : (+ <InstallSourceButton+ isInstalled={model.is_installed}+ isPending={pendingSources.has(model.source)}+ source={model.source}+ onInstall={() => onInstall(model)}+ />+ );++ return (+ <SourceListItem+ key={`${model.source}-${model.name}`}+ badges={+ <>+ <Badge+ colorPalette={getModelBaseColorPalette(model.base)}+ flexShrink={0}+ fontSize="2xs"+ size="sm"+ variant="surface"+ >+ {getModelBaseLabel(model.base)}+ </Badge>+ <Badge colorPalette="gray" flexShrink={0} fontSize="2xs" size="sm" variant="outline">+ {getModelTypeLabel(model.type)}+ </Badge>+ </>+ }+ description={`${model.description}${+ dependencyCount > 0+ ? ` (installs ${dependencyCount} dependenc${dependencyCount === 1 ? 'y' : 'ies'})`+ : ''+ }`}+ title={model.name}+ trailing={trailing}+ />+ );+ })}+ </Stack>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/sourceClassifier.ts b/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/sourceClassifier.tsnew file mode 100644index 0000000000..523f52ab00--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/sourceClassifier.ts@@ -0,0 +1,41 @@+/** owner/repo with optional :variant[:path] qualifiers - the HF repo shape. */+const HF_REPO_PATTERN = /^[\w.-]+\/[\w.-]+(:[\w./-]*)*$/;+const FILE_EXTENSION_PATTERN = /\.[A-Za-z0-9]{1,10}$/;++export interface SourceKind {+ looksLocal: boolean;+ looksUrl: boolean;+ looksRepo: boolean;+ isInstallable: boolean;+ localKind: 'file' | 'folder' | null;+ /** Human label of the detected source kind, or null when it reads as a search. */+ label: string | null;+}++const classifyLocalPath = (value: string): 'file' | 'folder' => {+ if (/[\\/]$/.test(value)) {+ return 'folder';+ }++ const lastSegment = value.split(/[\\/]/).at(-1) ?? '';++ return FILE_EXTENSION_PATTERN.test(lastSegment) ? 'file' : 'folder';+};++/** Classify the box's text: a search term, or an installable source to Pull. */+export const classifySource = (value: string): SourceKind => {+ const looksLocal = value.startsWith('/') || /^[A-Za-z]:[\\/]/.test(value);+ const looksUrl = /^https?:\/\//i.test(value);+ const looksRepo = !looksLocal && !looksUrl && HF_REPO_PATTERN.test(value);+ const isInstallable = looksLocal || looksUrl || looksRepo;+ const localKind = looksLocal ? classifyLocalPath(value) : null;++ return {+ isInstallable,+ label: looksLocal ? `${localKind} path` : looksUrl ? 'URL' : looksRepo ? 'Hugging Face repo' : null,+ localKind,+ looksLocal,+ looksRepo,+ looksUrl,+ };+};diff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/starterModelInstallSources.test.ts b/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/starterModelInstallSources.test.tssimilarity index 59%rename from invokeai/frontend/webv2/src/workbench/widgets/models/starterModelInstallSources.test.tsrename to invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/starterModelInstallSources.test.tsindex 0145122bcc..3f5600e6bc 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/models/starterModelInstallSources.test.ts+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/starterModelInstallSources.test.ts@@ -2,6 +2,8 @@ import type { StarterModel, StarterModelBundle } from '@workbench/models/types';import { describe, expect, it } from 'vitest';+import type { StarterInstallSource } from './starterModelInstallSources';+import { getStarterBundleInstallSources, getStarterModelInstallSources } from './starterModelInstallSources';const model = (source: string, overrides: Partial<StarterModel> = {}): StarterModel => ({@@ -14,13 +16,26 @@ const model = (source: string, overrides: Partial<StarterModel> = {}): StarterMo...overrides,});+const sourcesOf = (entries: StarterInstallSource[]): string[] => entries.map((entry) => entry.source);+describe('starter model install sources', () => {it('queues uninstalled dependencies before the model', () => {const sources = getStarterModelInstallSources(model('main', { dependencies: [model('vae'), model('encoder', { is_installed: true })] }));- expect(sources).toEqual(['vae', 'main']);+ expect(sourcesOf(sources)).toEqual(['vae', 'main']);+ });++ it('registers each entry with its own curated config', () => {+ const sources = getStarterModelInstallSources(+ model('main', { base: 'flux', dependencies: [model('vae', { base: 'sdxl', type: 'vae' })] })+ );++ expect(sources).toEqual([+ { config: { base: 'sdxl', description: 'vae', name: 'vae', type: 'vae' }, source: 'vae' },+ { config: { base: 'flux', description: 'main', name: 'main', type: 'main' }, source: 'main' },+ ]);});it('skips dependency sources already visible in the opened bundle', () => {@@ -28,7 +43,7 @@ describe('starter model install sources', () => {dependencySourcesToSkip: new Set(['vae']),});- expect(sources).toEqual(['encoder', 'main']);+ expect(sourcesOf(sources)).toEqual(['encoder', 'main']);});it('deduplicates sources across bundle models', () => {@@ -40,6 +55,6 @@ describe('starter model install sources', () => {name: 'Bundle',};- expect(getStarterBundleInstallSources(bundle)).toEqual(['shared-vae', 'main-a', 'main-b']);+ expect(sourcesOf(getStarterBundleInstallSources(bundle))).toEqual(['shared-vae', 'main-a', 'main-b']);});});diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/starterModelInstallSources.ts b/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/starterModelInstallSources.tsnew file mode 100644index 0000000000..1d17e06ad0--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/starterModelInstallSources.ts@@ -0,0 +1,75 @@+import type { ModelRecordChanges, StarterModel, StarterModelBundle } from '@workbench/models/types';++/** A source to install plus the curated config metadata to register it with. */+export interface StarterInstallSource {+ source: string;+ config: ModelRecordChanges;+}++export interface StarterModelInstallSourceOptions {+ /** Dependencies visible as their own rows in the active bundle should not be auto-installed by a row action. */+ dependencySourcesToSkip?: ReadonlySet<string>;+}++/**+ * The curated metadata a starter carries: passed as the install `config` so the+ * model is registered with its known name/base/type instead of relying purely on+ * server-side probing (matches the legacy install path). Built per-model, so a+ * dependency gets its own metadata rather than the parent's.+ */+const buildStarterConfig = (model: StarterModel | Omit<StarterModel, 'dependencies'>): ModelRecordChanges => ({+ base: model.base,+ description: model.description,+ name: model.name,+ type: model.type,+ ...(model.format ? { format: model.format } : {}),+ ...(model.variant ? { variant: model.variant } : {}),+});++const appendSource = (sources: StarterInstallSource[], seen: Set<string>, entry: StarterInstallSource): void => {+ if (seen.has(entry.source)) {+ return;+ }++ seen.add(entry.source);+ sources.push(entry);+};++export const getStarterModelInstallSources = (+ model: StarterModel,+ options: StarterModelInstallSourceOptions = {}+): StarterInstallSource[] => {+ const sources: StarterInstallSource[] = [];+ const seen = new Set<string>();++ for (const dependency of model.dependencies ?? []) {+ if (dependency.is_installed || options.dependencySourcesToSkip?.has(dependency.source)) {+ continue;+ }++ appendSource(sources, seen, { config: buildStarterConfig(dependency), source: dependency.source });+ }++ if (!model.is_installed) {+ appendSource(sources, seen, { config: buildStarterConfig(model), source: model.source });+ }++ return sources;+};++export const getStarterBundleInstallSources = (bundle: StarterModelBundle): StarterInstallSource[] => {+ const sources: StarterInstallSource[] = [];+ const seen = new Set<string>();++ for (const model of bundle.models) {+ if (model.is_installed) {+ continue;+ }++ for (const entry of getStarterModelInstallSources(model)) {+ appendSource(sources, seen, entry);+ }+ }++ return sources;+};diff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/useInstallActions.ts b/invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/useInstallActions.tssimilarity index 100%rename from invokeai/frontend/webv2/src/workbench/widgets/models/useInstallActions.tsrename to invokeai/frontend/webv2/src/workbench/launchpad/models/add-models/useInstallActions.tsdiff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/ApiKeysSection.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/credentials/ApiKeysSection.tsxsimilarity index 59%rename from invokeai/frontend/webv2/src/workbench/widgets/models/ApiKeysSection.tsxrename to invokeai/frontend/webv2/src/workbench/launchpad/models/credentials/ApiKeysSection.tsxindex 015fa29754..e521acff49 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/models/ApiKeysSection.tsx+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/credentials/ApiKeysSection.tsx@@ -1,6 +1,6 @@import type { HFTokenStatus } from '@workbench/models/types';-import { Badge, Flex, Grid, HStack, Icon, Input, Stack, Text } from '@chakra-ui/react';+import { Badge, Flex, Grid, HStack, Icon, Input, Stack, Switch, Text } from '@chakra-ui/react';import { Button } from '@workbench/components/ui';import {getExternalProviderConfigs,@@ -12,6 +12,8 @@ import {type ExternalProviderConfig,} from '@workbench/models/api';import { clearCivitaiApiKey, getCivitaiApiKey, setCivitaiApiKey } from '@workbench/models/apiKeys';+import { refreshInstalls } from '@workbench/models/installsStore';+import { refreshStartersIfLoaded } from '@workbench/models/startersStore';import { useNotify } from '@workbench/useNotify';import { HexagonIcon } from 'lucide-react';import { useEffect, useState, type ElementType } from 'react';@@ -308,31 +310,227 @@ const ExternalProviderKeyCards = ({ onError }: { onError: (title: string, messag};return (- <ApiKeyCard+ <ExternalProviderKeyCard+ config={config}key={config.provider_id}description="External image generator. The key is stored in the InvokeAI server config and used by external API models."icon={presentation.icon}placeholder={presentation.placeholder}- status={- config.api_key_configured- ? { label: 'Configured', palette: 'green' }- : { label: 'Not set', palette: 'gray' }- }title={presentation.title}onError={(message) => onError(presentation.title, message)}- onClear={- config.api_key_configured- ? async () => {- replaceConfig(await resetExternalProviderConfig(config.provider_id));- }- : undefined- }- onSave={async (key) => {- replaceConfig(await setExternalProviderConfig(config.provider_id, { api_key: key }));- }}+ onUpdated={replaceConfig}/>);})}</>);};++const ExternalProviderKeyCard = ({+ config,+ description,+ icon,+ onError,+ onUpdated,+ placeholder,+ title,+}: {+ config: ExternalProviderConfig;+ description: string;+ icon: ElementType;+ onError: (message: string) => void;+ onUpdated: (next: ExternalProviderConfig) => void;+ placeholder: string;+ title: string;+}) => {+ const [apiKeyDraft, setApiKeyDraft] = useState('');+ const [baseUrlDraft, setBaseUrlDraft] = useState(config.base_url ?? '');+ const [overrideBaseUrl, setOverrideBaseUrl] = useState(config.base_url !== null);+ const [isBusy, setIsBusy] = useState(false);++ useEffect(() => {+ setApiKeyDraft('');+ setBaseUrlDraft(config.base_url ?? '');+ setOverrideBaseUrl(config.base_url !== null);+ }, [config.base_url, config.provider_id]);++ const hasApiKeyDraft = apiKeyDraft.trim().length > 0;+ const hasBaseUrlChange = overrideBaseUrl ? baseUrlDraft.trim() !== (config.base_url ?? '') : config.base_url !== null;++ const runAction = async (+ action: () => Promise<ExternalProviderConfig>,+ onSuccess?: (next: ExternalProviderConfig) => void+ ): Promise<void> => {+ setIsBusy(true);++ try {+ const nextConfig = await action();++ onUpdated(nextConfig);+ setApiKeyDraft('');+ setBaseUrlDraft(nextConfig.base_url ?? '');+ setOverrideBaseUrl(nextConfig.base_url !== null);+ onSuccess?.(nextConfig);+ } catch (error) {+ onError(error instanceof Error ? error.message : 'Something went wrong.');+ } finally {+ setIsBusy(false);+ }+ };++ const handleSave = async () => {+ const apiKey = apiKeyDraft.trim();+ const baseUrl = baseUrlDraft.trim();+ const nextConfig: { api_key?: string; base_url?: string | null } = {};++ if (apiKey.length > 0) {+ nextConfig.api_key = apiKey;+ }++ if (!overrideBaseUrl && config.base_url !== null) {+ nextConfig.base_url = '';+ } else if (overrideBaseUrl && baseUrl !== (config.base_url ?? '')) {+ nextConfig.base_url = baseUrl;+ }++ if (!nextConfig.api_key && nextConfig.base_url === undefined) {+ return;+ }++ const apiKeyWasSet = nextConfig.api_key !== undefined;++ await runAction(+ () => setExternalProviderConfig(config.provider_id, nextConfig),+ (next) => {+ if (apiKeyWasSet && next.api_key_configured) {+ // The backend queues this provider's external starter models on+ // key-set; pull the new jobs and refresh starters so its rows flip to+ // Installed without an app restart.+ void refreshInstalls();+ refreshStartersIfLoaded();+ }+ }+ );+ };++ const canClear = config.api_key_configured || config.base_url !== null;++ return (+ <Stack bg="bg.subtle" borderColor="border.subtle" borderWidth="1px" gap="2.5" p="3" rounded="lg">+ <HStack align="start" gap="2.5">+ <Flex+ align="center"+ bg="bg.emphasized"+ borderColor="border.subtle"+ borderWidth="1px"+ boxSize="8"+ color="fg.muted"+ flexShrink={0}+ justify="center"+ rounded="md"+ >+ <Icon as={icon} boxSize="4" />+ </Flex>+ <Stack flex="1" gap="0" minW="0">+ <HStack gap="1.5">+ <Text fontSize="xs" fontWeight="700" truncate>+ {title}+ </Text>+ <Badge+ colorPalette={config.api_key_configured ? 'green' : 'gray'}+ flexShrink={0}+ fontSize="2xs"+ size="sm"+ variant="surface"+ >+ {config.api_key_configured ? 'Configured' : 'Not set'}+ </Badge>+ </HStack>+ <Text color="fg.subtle" fontSize="2xs" lineClamp={2}>+ {description}+ </Text>+ </Stack>+ </HStack>++ <Stack gap="2">+ <HStack gap="1.5">+ <Input+ aria-label={`${title} API key`}+ disabled={isBusy}+ placeholder={config.api_key_configured ? 'API key configured' : placeholder}+ size="xs"+ type="password"+ value={apiKeyDraft}+ onChange={(event) => setApiKeyDraft(event.currentTarget.value)}+ onKeyDown={(event) => {+ if (event.key === 'Enter') {+ event.preventDefault();+ void handleSave();+ }+ }}+ />+ </HStack>+ <Switch.Root+ checked={overrideBaseUrl}+ disabled={isBusy}+ size="sm"+ onCheckedChange={(event) => {+ const checked = event.checked === true;++ setOverrideBaseUrl(checked);++ if (!checked) {+ setBaseUrlDraft('');+ }+ }}+ >+ <Switch.HiddenInput />+ <Switch.Control _checked={{ bg: 'accent.solid' }}>+ <Switch.Thumb />+ </Switch.Control>+ <Switch.Label color="fg.muted" fontSize="2xs">+ Override base URL+ </Switch.Label>+ </Switch.Root>+ {overrideBaseUrl ? (+ <Input+ aria-label={`${title} base URL`}+ disabled={isBusy}+ placeholder="https://api.example.com"+ size="xs"+ value={baseUrlDraft}+ onChange={(event) => setBaseUrlDraft(event.currentTarget.value)}+ onKeyDown={(event) => {+ if (event.key === 'Enter') {+ event.preventDefault();+ void handleSave();+ }+ }}+ />+ ) : null}+ </Stack>++ <HStack gap="1.5">+ <Button+ disabled={(!hasApiKeyDraft && !hasBaseUrlChange) || isBusy}+ loading={isBusy}+ size="xs"+ variant="solid"+ onClick={() => void handleSave()}+ >+ Save+ </Button>+ {canClear ? (+ <Button+ disabled={isBusy}+ size="sm"+ variant="ghost"+ onClick={() => void runAction(() => resetExternalProviderConfig(config.provider_id))}+ >+ Clear+ </Button>+ ) : null}+ </HStack>+ </Stack>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/DefaultSettingsSection.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/detail/DefaultSettingsSection.tsxsimilarity index 100%rename from invokeai/frontend/webv2/src/workbench/widgets/models/DefaultSettingsSection.tsxrename to invokeai/frontend/webv2/src/workbench/launchpad/models/detail/DefaultSettingsSection.tsxdiff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/ModelBadges.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/detail/ModelBadges.tsxsimilarity index 100%rename from invokeai/frontend/webv2/src/workbench/widgets/models/ModelBadges.tsxrename to invokeai/frontend/webv2/src/workbench/launchpad/models/detail/ModelBadges.tsxdiff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/ModelDetail.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/detail/ModelDetail.tsxsimilarity index 100%rename from invokeai/frontend/webv2/src/workbench/widgets/models/ModelDetail.tsxrename to invokeai/frontend/webv2/src/workbench/launchpad/models/detail/ModelDetail.tsxdiff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/ModelEditForm.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/detail/ModelEditForm.tsxsimilarity index 100%rename from invokeai/frontend/webv2/src/workbench/widgets/models/ModelEditForm.tsxrename to invokeai/frontend/webv2/src/workbench/launchpad/models/detail/ModelEditForm.tsxdiff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/ModelImageUpload.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/detail/ModelImageUpload.tsxsimilarity index 100%rename from invokeai/frontend/webv2/src/workbench/widgets/models/ModelImageUpload.tsxrename to invokeai/frontend/webv2/src/workbench/launchpad/models/detail/ModelImageUpload.tsxdiff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/RelatedModelsSection.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/detail/RelatedModelsSection.tsxsimilarity index 98%rename from invokeai/frontend/webv2/src/workbench/widgets/models/RelatedModelsSection.tsxrename to invokeai/frontend/webv2/src/workbench/launchpad/models/detail/RelatedModelsSection.tsxindex 22580aa213..3cfd7fa94a 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/models/RelatedModelsSection.tsx+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/detail/RelatedModelsSection.tsx@@ -2,6 +2,7 @@ import type { ModelConfig, ModelTaxonomyType } from '@workbench/models/types';import { Badge, Icon, Spinner, Stack, Text } from '@chakra-ui/react';import { IconButton, FieldLabel, Tooltip } from '@workbench/components/ui';+import { SourceListItem } from '@workbench/launchpad/models/shared/SourceListItem';import { addModelRelationship, getRelatedModelKeys, removeModelRelationship } from '@workbench/models/api';import { getModelBaseColorPalette, getModelBaseLabel } from '@workbench/models/baseIdentity';import { ModelSelect } from '@workbench/models/components';@@ -10,8 +11,6 @@ import { getModelTypeLabel } from '@workbench/models/taxonomy';import { Link2OffIcon } from 'lucide-react';import { useEffect, useMemo, useState } from 'react';-import { SourceListItem } from './SourceListItem';-/** Types offered when linking related models, grouped in one picker. */const LINKABLE_TYPES: ModelTaxonomyType[] = ['main',diff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/TriggerPhrasesEditor.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/detail/TriggerPhrasesEditor.tsxsimilarity index 100%rename from invokeai/frontend/webv2/src/workbench/widgets/models/TriggerPhrasesEditor.tsxrename to invokeai/frontend/webv2/src/workbench/launchpad/models/detail/TriggerPhrasesEditor.tsxdiff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/useModelActions.ts b/invokeai/frontend/webv2/src/workbench/launchpad/models/detail/useModelActions.tssimilarity index 100%rename from invokeai/frontend/webv2/src/workbench/widgets/models/useModelActions.tsrename to invokeai/frontend/webv2/src/workbench/launchpad/models/detail/useModelActions.tsdiff --git a/invokeai/frontend/webv2/src/workbench/launchpad/models/install-queue/InstallJobProgress.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/install-queue/InstallJobProgress.tsxnew file mode 100644index 0000000000..088bc98854--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/install-queue/InstallJobProgress.tsx@@ -0,0 +1,28 @@+import type { ModelInstallJob } from '@workbench/models/types';++import { Box, Progress, Text } from '@chakra-ui/react';+import { useInstallProgress } from '@workbench/models/installsStore';+import { formatBytes } from '@workbench/models/taxonomy';++export const InstallJobProgress = ({ job }: { job: ModelInstallJob }) => {+ const liveProgress = useInstallProgress(job.id);+ const bytes = liveProgress?.bytes ?? job.bytes ?? 0;+ const totalBytes = liveProgress?.totalBytes ?? job.total_bytes ?? 0;+ const hasTotal = totalBytes > 0;+ const ratio = hasTotal ? Math.min(1, bytes / totalBytes) : null;++ return (+ <Box>+ <Progress.Root aria-label="Download progress" max={1} size="xs" value={ratio}>+ <Progress.Track>+ <Progress.Range />+ </Progress.Track>+ </Progress.Root>+ <Text color="fg.subtle" fontSize="2xs" mt="1">+ {hasTotal+ ? `${Math.round((ratio ?? 0) * 100)}% · ${formatBytes(bytes)} / ${formatBytes(totalBytes)}`+ : 'Waiting for download to start…'}+ </Text>+ </Box>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/models/install-queue/InstallJobRow.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/install-queue/InstallJobRow.tsxnew file mode 100644index 0000000000..6fb1e1c3df--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/install-queue/InstallJobRow.tsx@@ -0,0 +1,194 @@+import type { ModelInstallJob } from '@workbench/models/types';++import { Badge, HStack, Icon, Stack, Text } from '@chakra-ui/react';+import { useConnectionStatus } from '@workbench/backend/connectionStore';+import { IconButton, Tooltip } from '@workbench/components/ui';+import {+ cancelModelInstall,+ pauseModelInstall,+ restartFailedModelInstall,+ restartModelInstallFile,+ resumeModelInstall,+} from '@workbench/models/api';+import { isActiveInstallStatus, refreshInstalls, replaceInstallJob } from '@workbench/models/installsStore';+import { getInstallSourceLabel } from '@workbench/models/taxonomy';+import { PauseIcon, PlayIcon, RotateCcwIcon, TriangleAlertIcon, XIcon } from 'lucide-react';+import { useState } from 'react';++import { InstallJobProgress } from './InstallJobProgress';+import { STATUS_BADGES, getInstallJobDisplayName } from './queueUtils';++const partFileName = (part: { url?: string; source?: string; local_path?: string }): string =>+ (part.url ?? part.source ?? part.local_path ?? 'file').split(/[\\/]/).at(-1) ?? 'file';++export const InstallJobRow = ({+ job,+ onError,+}: {+ job: ModelInstallJob;+ onError: (title: string, message: string) => void;+}) => {+ const [isActing, setIsActing] = useState(false);+ const { status: connectionStatus } = useConnectionStatus();+ const badge = STATUS_BADGES[job.status] ?? { label: job.status, palette: 'gray' };+ const sourceLabel = getInstallSourceLabel(job.source);+ const displayName = getInstallJobDisplayName(job);+ // Parts the backend could not resume (or that errored) need a manual restart.+ const problemParts = (job.download_parts ?? []).filter(+ (part) => part.resume_required === true || part.status === 'error'+ );+ const showDisconnected = connectionStatus !== 'connected' && isActiveInstallStatus(job.status);++ const runAction = async (action: () => Promise<unknown>, failureTitle: string) => {+ setIsActing(true);++ try {+ const result = await action();++ if (result && typeof result === 'object' && 'id' in (result as ModelInstallJob)) {+ replaceInstallJob(result as ModelInstallJob);+ } else {+ await refreshInstalls();+ }+ } catch (actionError) {+ onError(failureTitle, actionError instanceof Error ? actionError.message : String(actionError));+ } finally {+ setIsActing(false);+ }+ };++ return (+ <Stack+ bg="bg"+ borderColor={job.status === 'error' ? 'border.error' : 'border.subtle'}+ borderWidth="1px"+ gap="1.5"+ p="2"+ rounded="md"+ >+ <HStack gap="2" justify="space-between">+ <Text flex="1" fontSize="2xs" fontWeight="600" minW="0" truncate title={sourceLabel}>+ {displayName}+ </Text>+ {showDisconnected ? (+ <Tooltip content="Backend disconnected — progress may be stale">+ <Icon as={TriangleAlertIcon} boxSize="3" color="fg.warning" flexShrink={0} />+ </Tooltip>+ ) : null}+ <Badge colorPalette={badge.palette} flexShrink={0} fontSize="2xs" size="sm" variant="surface">+ {badge.label}+ </Badge>+ <HStack flexShrink={0} gap="0.5">+ {job.status === 'downloading' ? (+ <Tooltip content="Pause download">+ <IconButton+ aria-label="Pause install"+ disabled={isActing}+ size="2xs"+ variant="ghost"+ onClick={() => void runAction(() => pauseModelInstall(job.id), 'Pause failed')}+ >+ <Icon as={PauseIcon} boxSize="3" />+ </IconButton>+ </Tooltip>+ ) : null}+ {job.status === 'paused' ? (+ <Tooltip content="Resume download">+ <IconButton+ aria-label="Resume install"+ disabled={isActing}+ size="2xs"+ variant="ghost"+ onClick={() => void runAction(() => resumeModelInstall(job.id), 'Resume failed')}+ >+ <Icon as={PlayIcon} boxSize="3" />+ </IconButton>+ </Tooltip>+ ) : null}+ {job.status === 'error' ? (+ <Tooltip content="Retry failed download">+ <IconButton+ aria-label="Retry install"+ disabled={isActing}+ size="2xs"+ variant="ghost"+ onClick={() => void runAction(() => restartFailedModelInstall(job.id), 'Retry failed')}+ >+ <Icon as={RotateCcwIcon} boxSize="3" />+ </IconButton>+ </Tooltip>+ ) : null}+ {isActiveInstallStatus(job.status) || job.status === 'paused' ? (+ <Tooltip content="Cancel install">+ <IconButton+ aria-label="Cancel install"+ disabled={isActing}+ size="2xs"+ variant="ghost"+ onClick={() => void runAction(() => cancelModelInstall(job.id), 'Cancel failed')}+ >+ <Icon as={XIcon} boxSize="3" />+ </IconButton>+ </Tooltip>+ ) : null}+ </HStack>+ </HStack>+ {displayName !== sourceLabel ? (+ <Text color="fg.subtle" fontSize="2xs" truncate>+ {sourceLabel}+ </Text>+ ) : null}+ {job.status === 'downloading' || job.status === 'waiting' ? <InstallJobProgress job={job} /> : null}+ {job.status === 'error' && job.error ? (+ <Text color="fg.error" fontSize="2xs" overflowWrap="anywhere">+ {job.error_reason ? `${job.error_reason}: ` : ''}+ {job.error}+ </Text>+ ) : null}+ {problemParts.map((part) => {+ const isResume = part.resume_required === true;+ const partUrl = typeof part.url === 'string' ? part.url : undefined;++ return (+ <Stack key={part.url ?? part.source ?? partFileName(part)} bg="bg.muted" gap="0.5" p="1.5" rounded="sm">+ <HStack gap="1.5">+ <Icon as={TriangleAlertIcon} boxSize="3" color={isResume ? 'fg.warning' : 'fg.error'} flexShrink={0} />+ <Text flex="1" fontSize="2xs" minW="0" title={partFileName(part)} truncate>+ {partFileName(part)}+ </Text>+ <Badge+ colorPalette={isResume ? 'orange' : 'red'}+ flexShrink={0}+ fontSize="2xs"+ size="sm"+ variant="surface"+ >+ {isResume ? 'Resume required' : 'Failed'}+ </Badge>+ {partUrl ? (+ <Tooltip content="Restart this file">+ <IconButton+ aria-label="Restart file"+ disabled={isActing}+ size="2xs"+ variant="ghost"+ onClick={() =>+ void runAction(() => restartModelInstallFile(job.id, partUrl), 'Restart file failed')+ }+ >+ <Icon as={RotateCcwIcon} boxSize="3" />+ </IconButton>+ </Tooltip>+ ) : null}+ </HStack>+ {part.resume_message ? (+ <Text color="fg.subtle" fontSize="2xs" overflowWrap="anywhere">+ {part.resume_message}+ </Text>+ ) : null}+ </Stack>+ );+ })}+ </Stack>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/models/install-queue/InstallQueueBar.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/install-queue/InstallQueueBar.tsxnew file mode 100644index 0000000000..f8d780f604--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/install-queue/InstallQueueBar.tsx@@ -0,0 +1,207 @@+import type { ModelInstallJob } from '@workbench/models/types';++import { Badge, Box, Collapsible, Flex, HStack, Icon, Spinner, Text } from '@chakra-ui/react';+import { Button, IconButton, Tooltip } from '@workbench/components/ui';+import {+ cancelModelInstall,+ pauseModelInstall,+ pruneCompletedModelInstalls,+ resumeModelInstall,+} from '@workbench/models/api';+import {+ ensureInstallsLoaded,+ isActiveInstallStatus,+ refreshInstalls,+ useInstallsSnapshot,+} from '@workbench/models/installsStore';+import { setQueueExpanded, useModelsUi } from '@workbench/models/uiStore';+import { useNotify } from '@workbench/useNotify';+import { ChevronUpIcon, ListOrderedIcon, PauseIcon, PlayIcon, RefreshCcwIcon, Trash2Icon, XIcon } from 'lucide-react';+import { useEffect, useState } from 'react';++import { InstallQueueList } from './InstallQueueList';+import { getInstallJobDisplayName } from './queueUtils';++/** Persistent, collapsible install queue footer for the model manager detail pane. */+export const InstallQueueBar = () => {+ const notify = useNotify();+ const { error, jobs, status } = useInstallsSnapshot();+ const { queueExpanded } = useModelsUi();++ useEffect(() => {+ ensureInstallsLoaded();+ }, []);++ const activeJobs = jobs.filter((job) => isActiveInstallStatus(job.status));+ const pausedJobs = jobs.filter((job) => job.status === 'paused');+ const pausableJobs = jobs.filter((job) => job.status === 'downloading');+ const cancellableJobs = jobs.filter((job) => isActiveInstallStatus(job.status) || job.status === 'paused');+ const settledCount = jobs.filter((job) => !isActiveInstallStatus(job.status) && job.status !== 'paused').length;++ const [busyAction, setBusyAction] = useState<'pause' | 'resume' | 'cancel' | 'prune' | 'refresh' | null>(null);++ const runBulk = async (action: 'pause' | 'resume' | 'cancel', targets: ModelInstallJob[]) => {+ const call = action === 'pause' ? pauseModelInstall : action === 'resume' ? resumeModelInstall : cancelModelInstall;++ setBusyAction(action);++ try {+ await Promise.all(targets.map((job) => call(job.id)));+ await refreshInstalls();+ } catch (bulkError) {+ notify.error('Queue action failed', bulkError instanceof Error ? bulkError.message : String(bulkError));+ void refreshInstalls();+ } finally {+ setBusyAction(null);+ }+ };++ const handlePrune = async () => {+ setBusyAction('prune');++ try {+ await pruneCompletedModelInstalls();+ await refreshInstalls();+ } catch (pruneError) {+ notify.error('Prune failed', pruneError instanceof Error ? pruneError.message : String(pruneError));+ } finally {+ setBusyAction(null);+ }+ };++ const handleRefresh = async () => {+ setBusyAction('refresh');++ try {+ await refreshInstalls();+ } finally {+ setBusyAction(null);+ }+ };++ const summary =+ activeJobs.length > 0+ ? `${getInstallJobDisplayName(activeJobs[0]!)}${activeJobs.length > 1 ? ` +${activeJobs.length - 1} more` : ''}`+ : jobs.length > 0+ ? `${jobs.length} job${jobs.length === 1 ? '' : 's'} · no active installs`+ : 'No installs yet';++ return (+ <Collapsible.Root+ bg="bg.subtle"+ borderTopWidth={1}+ flexShrink={0}+ open={queueExpanded}+ overflow="hidden"+ onOpenChange={(event) => setQueueExpanded(event.open)}+ >+ <Collapsible.Content>+ <Flex direction="column" h="min(22rem, 45dvh)" minH="0" overflow="hidden">+ <HStack borderBottomWidth={1} gap="2" justify="space-between" px="3" py="1.5">+ <Text color="fg.subtle" fontSize="2xs" fontWeight="700" textTransform="uppercase">+ Install Queue+ </Text>+ <HStack gap="1">+ <Button+ loading={busyAction === 'refresh'}+ size="2xs"+ variant="ghost"+ onClick={() => void handleRefresh()}+ >+ <Icon as={RefreshCcwIcon} boxSize="3" />+ Refresh+ </Button>+ <Button+ disabled={settledCount === 0}+ loading={busyAction === 'prune'}+ size="2xs"+ variant="ghost"+ onClick={() => void handlePrune()}+ >+ <Icon as={Trash2Icon} boxSize="3" />+ Clear finished+ </Button>+ </HStack>+ </HStack>+ <Box flex="1" minH="0" overflow="hidden" p="2">+ <InstallQueueList error={error} jobs={jobs} status={status} />+ </Box>+ </Flex>+ </Collapsible.Content>++ <HStack gap="1" px="3" py="2">+ <Collapsible.Trigger+ alignItems="center"+ bg="transparent"+ color="inherit"+ display="flex"+ flex="1"+ gap="2"+ minW="0"+ textAlign="start"+ _hover={{ color: 'fg' }}+ >+ {activeJobs.length > 0 ? (+ <Spinner borderWidth="1.5px" boxSize="3.5" color="accent.solid" flexShrink={0} />+ ) : (+ <Icon as={ListOrderedIcon} boxSize="3.5" color="fg.subtle" flexShrink={0} />+ )}+ <Text flex="1" fontSize="xs" fontWeight="600" minW="0" truncate>+ {summary}+ </Text>++ {activeJobs.length > 0 ? (+ <Badge colorPalette="accent" flexShrink={0} fontSize="2xs" size="sm" variant="solid">+ {activeJobs.length}+ </Badge>+ ) : null}+ <Collapsible.Indicator _open={{ transform: 'rotate(180deg)' }} transition="transform 0.2s">+ <Icon as={ChevronUpIcon} boxSize="4" color="fg.subtle" flexShrink={0} />+ </Collapsible.Indicator>+ </Collapsible.Trigger>++ <HStack flexShrink={0} gap="0.5">+ {pausableJobs.length > 0 ? (+ <Tooltip content="Pause all downloads">+ <IconButton+ aria-label="Pause all installs"+ loading={busyAction === 'pause'}+ size="2xs"+ variant="ghost"+ onClick={() => void runBulk('pause', pausableJobs)}+ >+ <Icon as={PauseIcon} boxSize="3.5" />+ </IconButton>+ </Tooltip>+ ) : null}+ {pausedJobs.length > 0 ? (+ <Tooltip content="Resume all paused downloads">+ <IconButton+ aria-label="Resume all installs"+ loading={busyAction === 'resume'}+ size="2xs"+ variant="ghost"+ onClick={() => void runBulk('resume', pausedJobs)}+ >+ <Icon as={PlayIcon} boxSize="3.5" />+ </IconButton>+ </Tooltip>+ ) : null}+ {cancellableJobs.length > 0 ? (+ <Tooltip content="Cancel all installs">+ <IconButton+ aria-label="Cancel all installs"+ loading={busyAction === 'cancel'}+ size="2xs"+ variant="ghost"+ onClick={() => void runBulk('cancel', cancellableJobs)}+ >+ <Icon as={XIcon} boxSize="3.5" />+ </IconButton>+ </Tooltip>+ ) : null}+ </HStack>+ </HStack>+ </Collapsible.Root>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/models/install-queue/InstallQueueList.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/install-queue/InstallQueueList.tsxnew file mode 100644index 0000000000..0fdb1670cf--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/install-queue/InstallQueueList.tsx@@ -0,0 +1,67 @@+import type { ModelInstallJob } from '@workbench/models/types';++import { Flex, Spinner, Stack, Text } from '@chakra-ui/react';+import { Button, Scrollable } from '@workbench/components/ui';+import { refreshInstalls } from '@workbench/models/installsStore';+import { useNotify } from '@workbench/useNotify';++import { InstallJobRow } from './InstallJobRow';++export const InstallQueueList = ({+ error,+ jobs,+ status,+}: {+ error: string | null;+ jobs: ModelInstallJob[];+ status: 'idle' | 'loading' | 'loaded' | 'error';+}) => {+ const notify = useNotify();++ if (status === 'loading' || status === 'idle') {+ return (+ <Flex align="center" justify="center" py="6">+ <Spinner color="fg.subtle" size="sm" />+ </Flex>+ );+ }++ if (status === 'error') {+ return (+ <Stack align="center" gap="1" py="6">+ <Text color="fg.error" fontSize="xs" fontWeight="600">+ Could not load the install queue+ </Text>+ <Text color="fg.subtle" fontSize="2xs">+ {error}+ </Text>+ <Button mt="1" size="xs" variant="outline" onClick={() => void refreshInstalls()}>+ Retry+ </Button>+ </Stack>+ );+ }++ if (jobs.length === 0) {+ return (+ <Stack align="center" gap="1" py="6">+ <Text color="fg.muted" fontSize="xs" fontWeight="600">+ No installs yet+ </Text>+ <Text color="fg.subtle" fontSize="2xs">+ Models you install will download here.+ </Text>+ </Stack>+ );+ }++ return (+ <Scrollable h="full" label="Install jobs" minH="0">+ <Stack gap="1.5">+ {jobs.map((job) => (+ <InstallJobRow key={job.id} job={job} onError={notify.error} />+ ))}+ </Stack>+ </Scrollable>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/models/install-queue/queueUtils.ts b/invokeai/frontend/webv2/src/workbench/launchpad/models/install-queue/queueUtils.tsnew file mode 100644index 0000000000..652c00ad07--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/install-queue/queueUtils.ts@@ -0,0 +1,17 @@+import type { ModelInstallJob, ModelInstallStatus } from '@workbench/models/types';++import { getInstallSourceLabel } from '@workbench/models/taxonomy';++export const STATUS_BADGES: Record<ModelInstallStatus, { label: string; palette: string }> = {+ cancelled: { label: 'Cancelled', palette: 'gray' },+ completed: { label: 'Installed', palette: 'green' },+ downloading: { label: 'Downloading', palette: 'blue' },+ downloads_done: { label: 'Downloaded', palette: 'blue' },+ error: { label: 'Failed', palette: 'red' },+ paused: { label: 'Paused', palette: 'orange' },+ running: { label: 'Installing', palette: 'blue' },+ waiting: { label: 'Waiting', palette: 'gray' },+};++export const getInstallJobDisplayName = (job: ModelInstallJob): string =>+ job.config_out?.name ?? getInstallSourceLabel(job.source);diff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/MaintenanceMenu.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/library/MaintenanceMenu.tsxsimilarity index 99%rename from invokeai/frontend/webv2/src/workbench/widgets/models/MaintenanceMenu.tsxrename to invokeai/frontend/webv2/src/workbench/launchpad/models/library/MaintenanceMenu.tsxindex 2258221cc4..9f343a06ac 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/models/MaintenanceMenu.tsx+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/library/MaintenanceMenu.tsx@@ -30,7 +30,7 @@ export const MaintenanceMenu = () => {<><Menu.Root positioning={{ placement: 'bottom-end' }}><Menu.Trigger asChild>- <IconButton aria-label="Model library maintenance" size="xs" variant="ghost">+ <IconButton aria-label="Model library maintenance" size="2xs" variant="ghost"><Icon as={MoreHorizontalIcon} boxSize="4" /></IconButton></Menu.Trigger>diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/models/library/ModelFilterBar.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/library/ModelFilterBar.tsxnew file mode 100644index 0000000000..36e68c8df2--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/library/ModelFilterBar.tsx@@ -0,0 +1,72 @@+import type { ModelLibraryFilters, ModelSortField } from '@workbench/models/library';+import type { ModelTaxonomyType } from '@workbench/models/types';++import { HStack, Icon, Input, InputGroup } from '@chakra-ui/react';+import { FilterMenuItem, ModelFilterMenu } from '@workbench/launchpad/models/shared/ModelFilterMenu';+import { SearchIcon } from 'lucide-react';++const SORT_FIELDS: { field: ModelSortField; label: string }[] = [+ { field: 'default', label: 'Default' },+ { field: 'name', label: 'Name' },+ { field: 'base', label: 'Base' },+ { field: 'size', label: 'Size' },+ { field: 'format', label: 'Format' },+];++const isFiltering = (filters: ModelLibraryFilters): boolean =>+ filters.typeFilter !== null || filters.baseFilter !== null || filters.missingOnly;++/**+ * Search box plus a combined filter/sort menu. The menu reflects only values+ * present in the current library so it never offers dead filters.+ */+export const ModelFilterBar = ({+ availableBases,+ availableTypes,+ filters,+ missingCount,+ onChange,+}: {+ availableBases: string[];+ availableTypes: ModelTaxonomyType[];+ filters: ModelLibraryFilters;+ missingCount: number;+ onChange: (filters: ModelLibraryFilters) => void;+}) => (+ <HStack gap="1.5" w="full" px="3" pt="3">+ <InputGroup startElement={<Icon as={SearchIcon} boxSize="3.5" color="fg.subtle" />}>+ <Input+ aria-label="Search models"+ placeholder="Search models…"+ size="xs"+ value={filters.searchTerm}+ onChange={(event) => onChange({ ...filters, searchTerm: event.currentTarget.value })}+ />+ </InputGroup>+ <ModelFilterMenu+ ariaLabel="Filter and sort models"+ availableBases={availableBases}+ availableTypes={availableTypes}+ baseFilter={filters.baseFilter}+ extraTypeItems={+ missingCount > 0 ? (+ <FilterMenuItem+ isChecked={filters.missingOnly}+ label={`Missing files (${missingCount})`}+ value="type-missing"+ onSelect={() => onChange({ ...filters, missingOnly: !filters.missingOnly, typeFilter: null })}+ />+ ) : null+ }+ isActive={isFiltering(filters)}+ sortDirection={filters.sortDirection}+ sortField={filters.sortField}+ sortFields={SORT_FIELDS}+ typeAllChecked={filters.typeFilter === null && !filters.missingOnly}+ typeFilter={filters.typeFilter}+ onBaseFilterChange={(baseFilter) => onChange({ ...filters, baseFilter })}+ onSortChange={(sortField, sortDirection) => onChange({ ...filters, sortDirection, sortField })}+ onTypeFilterChange={(typeFilter) => onChange({ ...filters, missingOnly: false, typeFilter })}+ />+ </HStack>+);diff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/ModelLibraryList.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/library/ModelLibraryList.tsxsimilarity index 93%rename from invokeai/frontend/webv2/src/workbench/widgets/models/ModelLibraryList.tsxrename to invokeai/frontend/webv2/src/workbench/launchpad/models/library/ModelLibraryList.tsxindex 88d50eaa3e..150c547a70 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/models/ModelLibraryList.tsx+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/library/ModelLibraryList.tsx@@ -4,6 +4,7 @@ import { Box, Checkbox, Flex, HStack, Icon, Image, ScrollArea, Spinner, Stack, Timport { defaultRangeExtractor, useVirtualizer, type Range } from '@tanstack/react-virtual';import { Button, Row } from '@workbench/components/ui';import { EmptyState } from '@workbench/components/ui/EmptyState';+import { ModelBadgeRow } from '@workbench/launchpad/models/detail/ModelBadges';import { getModelImageUrl } from '@workbench/models/api';import {filterModels,@@ -13,11 +14,10 @@ import {} from '@workbench/models/library';import { useModelsSnapshot } from '@workbench/models/modelsStore';import { formatBytes } from '@workbench/models/taxonomy';-import { getLibraryScrollOffset, openModelsCenterTab, saveLibraryScrollOffset } from '@workbench/models/uiStore';+import { getLibraryScrollOffset, openModelManagerTab, saveLibraryScrollOffset } from '@workbench/models/uiStore';import { ArrowRightIcon, BoxIcon, CircleAlert } from 'lucide-react';-import { useCallback, useEffect, useMemo, useRef, useState } from 'react';+import { useCallback, useDeferredValue, useEffect, useMemo, useRef, useState } from 'react';-import { ModelBadgeRow } from './ModelBadges';import { ModelRowContextMenu, type ModelContextMenuTarget } from './ModelRowContextMenu';const HEADER_ROW_HEIGHT_PX = 30;@@ -42,23 +42,24 @@ export const ModelLibraryList = ({}: {activeModelKey: string | null;filters: ModelLibraryFilters;- /** Identifies this list's scroll-offset slot ('panel', 'center', ...). */+ /** Identifies this list's scroll-offset slot ('panel', 'manager', ...). */instanceId: string;onActivate: (model: ModelConfig) => void;- /** Present in center view: enables bulk-select checkboxes. */+ /** Present in the manager library: enables bulk-select checkboxes. */onToggleSelected?: (model: ModelConfig) => void;selectedKeys?: ReadonlySet<string>;}) => {const { coverImageVersions, error, missingModelKeys, models, status } = useModelsSnapshot();+ const deferredFilters = useDeferredValue(filters);const scrollRef = useRef<HTMLDivElement | null>(null);const [contextMenuTarget, setContextMenuTarget] = useState<ModelContextMenuTarget | null>(null);const openAddModels = () => {- openModelsCenterTab('add');+ openModelManagerTab('add');};const rows = useMemo(- () => flattenGroupsToRows(groupModelsByType(filterModels(models, filters, missingModelKeys))),- [filters, missingModelKeys, models]+ () => flattenGroupsToRows(groupModelsByType(filterModels(models, deferredFilters, missingModelKeys))),+ [deferredFilters, missingModelKeys, models]);const headerIndexes = useMemo(() => rows.flatMap((row, index) => (row.kind === 'header' ? [index] : [])), [rows]);@@ -150,6 +151,7 @@ export const ModelLibraryList = ({top="0"transform={`translateY(${virtualRow.start}px)`}w="full"+ px="3">{row.kind === 'header' ? (<GroupHeader count={row.group.models.length} label={row.group.label} />@@ -178,7 +180,7 @@ export const ModelLibraryList = ({{/* Pinned copy of the current group's header, above the viewport.aria-hidden: it duplicates a header already in the list. */}{pinnedRow?.kind === 'header' ? (- <Box aria-hidden bg="bg" left="0" pointerEvents="none" position="absolute" right="0" top="0" zIndex={1}>+ <Box aria-hidden bg="bg" left="0" pointerEvents="none" position="absolute" right="0" top="0" zIndex={1} px="3"><GroupHeader count={pinnedRow.group.models.length} label={pinnedRow.group.label} /></Box>) : null}@@ -188,7 +190,7 @@ export const ModelLibraryList = ({};const GroupHeader = ({ count, label }: { count: number; label: string }) => (- <HStack bg="bg.inset" gap="1.5" h={`${HEADER_ROW_HEIGHT_PX}px`} pt="2" px="1" w="full">+ <HStack bg="bg.inset" gap="1.5" h={`${HEADER_ROW_HEIGHT_PX}px`} pt="2" w="full"><Text color="fg.subtle" fontSize="2xs" fontWeight="700" textTransform="uppercase">{label}</Text>diff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/ModelRowContextMenu.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/library/ModelRowContextMenu.tsxsimilarity index 97%rename from invokeai/frontend/webv2/src/workbench/widgets/models/ModelRowContextMenu.tsxrename to invokeai/frontend/webv2/src/workbench/launchpad/models/library/ModelRowContextMenu.tsxindex 9d416ca684..e4a8c37f83 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/models/ModelRowContextMenu.tsx+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/library/ModelRowContextMenu.tsx@@ -2,13 +2,12 @@ import type { ModelConfig } from '@workbench/models/types';import { Icon, Menu, Portal } from '@chakra-ui/react';import { ConfirmDialog, MenuContent } from '@workbench/components/ui';+import { useModelActions } from '@workbench/launchpad/models/detail/useModelActions';import { isConvertibleToDiffusers } from '@workbench/models/baseIdentity';import { RefreshCcwIcon, Trash2Icon } from 'lucide-react';import { useRef, useState } from 'react';import { SiHuggingface } from 'react-icons/si';-import { useModelActions } from './useModelActions';-export interface ModelContextMenuTarget {model: ModelConfig;x: number;diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/models/manager/DetailPane.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/manager/DetailPane.tsxnew file mode 100644index 0000000000..d39ff9565b--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/manager/DetailPane.tsx@@ -0,0 +1,90 @@+import { Box, Flex, Icon, Text } from '@chakra-ui/react';+import { Scrollable, Tabs } from '@workbench/components/ui';+import { AddModelsView } from '@workbench/launchpad/models/add-models/AddModelsView';+import { ApiKeysSection } from '@workbench/launchpad/models/credentials/ApiKeysSection';+import { ModelDetail } from '@workbench/launchpad/models/detail/ModelDetail';+import { InstallQueueBar } from '@workbench/launchpad/models/install-queue/InstallQueueBar';+import { useModelsSnapshot } from '@workbench/models/modelsStore';+import { updateModelsUi, useModelsUi, type ModelManagerTab } from '@workbench/models/uiStore';+import { BoxIcon, KeyRoundIcon, PlusIcon } from 'lucide-react';++import { HEADER_MIN_HEIGHT } from './layoutConstants';++/** The tabbed detail pane: selected model, Add Models, API Keys, and queue footer. */+export const DetailPane = () => {+ const { activeModelKey, activeTab } = useModelsUi();+ const { models } = useModelsSnapshot();++ const activeModel = activeModelKey ? models.find((model) => model.key === activeModelKey) : undefined;+ const detailLabel = activeModel?.name ?? 'Model Details';++ return (+ <Flex direction="column" flex="1" minH="0" minW="0">+ <Flex align="flex-end" borderBottomWidth={1} flexShrink={0} minH={HEADER_MIN_HEIGHT} px="2">+ <Tabs.Root+ size="sm"+ mb="-1px"+ value={activeTab}+ onValueChange={(event) => updateModelsUi({ activeTab: event.value as ModelManagerTab })}+ >+ <Tabs.List h="full">+ <Tabs.Trigger fontSize="xs" value="details">+ <Icon as={BoxIcon} boxSize="3" />+ <Text maxW="14rem" truncate>+ {detailLabel}+ </Text>+ </Tabs.Trigger>+ <Tabs.Trigger fontSize="xs" value="add">+ <Icon as={PlusIcon} boxSize="3" />+ Add Models+ </Tabs.Trigger>+ <Tabs.Trigger fontSize="xs" value="keys">+ <Icon as={KeyRoundIcon} boxSize="3" />+ API Keys+ </Tabs.Trigger>+ </Tabs.List>+ </Tabs.Root>+ </Flex>++ <Box flex="1" minH="0">+ {activeTab === 'details' ? <DetailTab modelKey={activeModelKey} /> : null}+ {activeTab === 'add' ? <AddModelsView /> : null}+ {activeTab === 'keys' ? (+ <Scrollable h="full" label="API keys" minH="0" p="3">+ <ApiKeysSection />+ </Scrollable>+ ) : null}+ </Box>++ <InstallQueueBar />+ </Flex>+ );+};++const DetailTab = ({ modelKey }: { modelKey: string | null }) => {+ if (modelKey === null) {+ return (+ <Flex align="center" direction="column" gap="2" h="full" justify="center" p="6">+ <Icon as={BoxIcon} boxSize="8" color="fg.subtle" />+ <Text color="fg.muted" fontSize="sm" fontWeight="600">+ Select a model+ </Text>+ <Text color="fg.subtle" fontSize="xs" maxW="22rem" textAlign="center">+ Pick a model from the library to view details, edit metadata, set per-model defaults, and manage trigger+ phrases.+ </Text>+ </Flex>+ );+ }++ return (+ <Scrollable h="full" label="Model details" minH="0" p="3">+ <ModelDetail+ key={modelKey}+ density="full"+ modelKey={modelKey}+ onDeleted={() => updateModelsUi({ activeModelKey: null })}+ />+ </Scrollable>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/models/manager/LibraryColumn.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/manager/LibraryColumn.tsxnew file mode 100644index 0000000000..f53b23115d--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/manager/LibraryColumn.tsx@@ -0,0 +1,144 @@+import { Box, Flex, HStack, Icon, Separator, Text } from '@chakra-ui/react';+import { Button, IconButton, ConfirmDialog } from '@workbench/components/ui';+import { MaintenanceMenu } from '@workbench/launchpad/models/library/MaintenanceMenu';+import { ModelFilterBar } from '@workbench/launchpad/models/library/ModelFilterBar';+import { ModelLibraryList } from '@workbench/launchpad/models/library/ModelLibraryList';+import { bulkDeleteModels } from '@workbench/models/api';+import { collectBases, collectTypes } from '@workbench/models/library';+import { refreshModels, removeModelsFromStore, useModelsSnapshot } from '@workbench/models/modelsStore';+import {+ openModelDetail,+ pruneModelsUiKeys,+ toggleModelSelection,+ updateModelsUi,+ useModelsUi,+} from '@workbench/models/uiStore';+import { useNotify } from '@workbench/useNotify';+import { Trash2Icon, XIcon } from 'lucide-react';+import { useMemo, useState } from 'react';++import { HEADER_MIN_HEIGHT, LIBRARY_WIDTH } from './layoutConstants';++/** The persistent master list: header, search/filter bar, and bulk actions. */+export const LibraryColumn = () => {+ const notify = useNotify();+ const { missingModelKeys, models } = useModelsSnapshot();+ const { activeModelKey, filters, selectedKeys } = useModelsUi();+ const [isBulkDeleteOpen, setIsBulkDeleteOpen] = useState(false);++ const availableTypes = useMemo(() => collectTypes(models), [models]);+ const availableBases = useMemo(() => collectBases(models), [models]);++ const handleBulkDelete = async () => {+ const keys = [...selectedKeys];++ try {+ const result = await bulkDeleteModels(keys);++ removeModelsFromStore(result.deleted);+ pruneModelsUiKeys(result.deleted);+ updateModelsUi({ selectedKeys: new Set(result.failed.map((failure) => failure.key)) });++ if (result.failed.length > 0) {+ notify.error(+ 'Some models could not be deleted',+ `${result.deleted.length} deleted; ${result.failed.length} failed: ${result.failed[0]?.error ?? ''}`+ );+ } else {+ notify.success(+ 'Models deleted',+ `${result.deleted.length} model${result.deleted.length === 1 ? '' : 's'} deleted.`+ );+ }+ } catch (error) {+ notify.error('Bulk delete failed', error instanceof Error ? error.message : String(error));+ void refreshModels();+ }+ };++ return (+ <Flex direction="column" flexShrink={0} h="full" minH="0" position="relative" w={LIBRARY_WIDTH} borderEndWidth={1}>+ <HStack align="center" borderBottomWidth={1} flexShrink={0} gap="2" minH={HEADER_MIN_HEIGHT} px="3">+ <Text fontSize="sm" fontWeight="700">+ Models+ </Text>+ <Text color="fg.subtle" fontSize="xs">+ {models.length}+ </Text>+ <Box ms="auto">+ <MaintenanceMenu />+ </Box>+ </HStack>++ <ModelFilterBar+ availableBases={availableBases}+ availableTypes={availableTypes}+ filters={filters}+ missingCount={missingModelKeys.size}+ onChange={(nextFilters) => updateModelsUi({ filters: nextFilters })}+ />++ <ModelLibraryList+ activeModelKey={activeModelKey}+ filters={filters}+ instanceId="manager"+ selectedKeys={selectedKeys}+ onActivate={(model) => openModelDetail(model.key)}+ onToggleSelected={(model) => toggleModelSelection(model.key)}+ />++ {selectedKeys.size > 0 ? (+ <HStack+ bg="bg.muted"+ borderColor="border.emphasized"+ borderWidth="1px"+ bottom="2"+ gap="2"+ insetX="2"+ p="1.5"+ position="absolute"+ rounded="lg"+ shadow="lg"+ zIndex={2}+ >+ <Text+ borderColor="border.subtle"+ borderStyle="dashed"+ borderWidth="1px"+ color="fg.muted"+ fontSize="2xs"+ fontWeight="600"+ px="2"+ py="1"+ rounded="md"+ >+ {selectedKeys.size} selected+ </Text>+ <Separator borderColor="border.subtle" h="5" orientation="vertical" />+ <Button colorPalette="red" size="2xs" variant="solid" onClick={() => setIsBulkDeleteOpen(true)}>+ <Icon as={Trash2Icon} boxSize="3" />+ Delete+ </Button>+ <Box flex="1" />+ <IconButton+ aria-label="Clear selection"+ size="2xs"+ variant="ghost"+ onClick={() => updateModelsUi({ selectedKeys: new Set() })}+ >+ <Icon as={XIcon} boxSize="3" />+ </IconButton>+ </HStack>+ ) : null}++ <ConfirmDialog+ body={`Delete ${selectedKeys.size} selected model${selectedKeys.size === 1 ? '' : 's'}? Database records are removed, and files inside the InvokeAI models directory are deleted.`}+ confirmLabel={`Delete ${selectedKeys.size} Model${selectedKeys.size === 1 ? '' : 's'}`}+ isOpen={isBulkDeleteOpen}+ title="Delete selected models"+ onClose={() => setIsBulkDeleteOpen(false)}+ onConfirm={handleBulkDelete}+ />+ </Flex>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/models/manager/layoutConstants.ts b/invokeai/frontend/webv2/src/workbench/launchpad/models/manager/layoutConstants.tsnew file mode 100644index 0000000000..d749adfda4--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/manager/layoutConstants.ts@@ -0,0 +1,5 @@+export const LIBRARY_WIDTH = '22rem';++// Both column headers share a min height so the library title bar lines up with+// the detail tab bar.+export const HEADER_MIN_HEIGHT = '2.75rem';diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/models/shared/ModelFilterMenu.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/shared/ModelFilterMenu.tsxnew file mode 100644index 0000000000..791df4198b--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/shared/ModelFilterMenu.tsx@@ -0,0 +1,156 @@+import type { ModelSortField } from '@workbench/models/library';+import type { ModelTaxonomyType } from '@workbench/models/types';+import type { ReactNode } from 'react';++import { Icon, Menu, Portal, Text } from '@chakra-ui/react';+import { IconButton, MenuContent } from '@workbench/components/ui';+import { getModelBaseLabel } from '@workbench/models/baseIdentity';+import { getModelTypeLabel } from '@workbench/models/taxonomy';+import { CheckIcon, SlidersHorizontalIcon } from 'lucide-react';++export interface ModelFilterSortOption {+ field: ModelSortField;+ label: string;+}++const DEFAULT_SORT_FIELDS: ModelFilterSortOption[] = [+ { field: 'default', label: 'Default' },+ { field: 'name', label: 'Name' },+ { field: 'base', label: 'Base' },+ { field: 'size', label: 'Size' },+ { field: 'format', label: 'Format' },+];++/** Shared taxonomy filter + sort menu for installed and starter model lists. */+export const ModelFilterMenu = ({+ ariaLabel,+ availableBases,+ availableTypes,+ baseFilter,+ extraTypeItems,+ isActive,+ onBaseFilterChange,+ onSortChange,+ onTypeFilterChange,+ sortDirection,+ sortField,+ sortFields = DEFAULT_SORT_FIELDS,+ typeAllChecked,+ typeAllLabel = 'All models',+ typeFilter,+}: {+ ariaLabel: string;+ availableBases: string[];+ availableTypes: ModelTaxonomyType[];+ baseFilter: string | null;+ extraTypeItems?: ReactNode;+ isActive: boolean;+ onBaseFilterChange: (base: string | null) => void;+ onSortChange: (field: ModelSortField, direction: 'asc' | 'desc') => void;+ onTypeFilterChange: (type: ModelTaxonomyType | null) => void;+ sortDirection: 'asc' | 'desc';+ sortField: ModelSortField;+ sortFields?: readonly ModelFilterSortOption[];+ typeAllChecked?: boolean;+ typeAllLabel?: string;+ typeFilter: ModelTaxonomyType | null;+}) => (+ <Menu.Root closeOnSelect={false} positioning={{ placement: 'bottom-end' }}>+ <Menu.Trigger asChild>+ <IconButton aria-label={ariaLabel} color={isActive ? 'accent.solid' : 'fg.muted'} size="xs" variant="outline">+ <Icon as={SlidersHorizontalIcon} boxSize="4" />+ </IconButton>+ </Menu.Trigger>+ <Portal>+ <Menu.Positioner>+ <MenuContent maxH="70vh" minW="13rem" overflowY="auto" py="1">+ <Menu.ItemGroup>+ <Menu.ItemGroupLabel color="fg.subtle" fontSize="2xs" textTransform="uppercase">+ Model Type+ </Menu.ItemGroupLabel>+ <FilterMenuItem+ isChecked={typeAllChecked ?? typeFilter === null}+ label={typeAllLabel}+ value="type-all"+ onSelect={() => onTypeFilterChange(null)}+ />+ {extraTypeItems}+ {availableTypes.map((type) => (+ <FilterMenuItem+ key={type}+ isChecked={typeFilter === type}+ label={getModelTypeLabel(type)}+ value={`type-${type}`}+ onSelect={() => onTypeFilterChange(typeFilter === type ? null : type)}+ />+ ))}+ </Menu.ItemGroup>+ <Menu.Separator />+ <Menu.ItemGroup>+ <Menu.ItemGroupLabel color="fg.subtle" fontSize="2xs" textTransform="uppercase">+ Base Architecture+ </Menu.ItemGroupLabel>+ <FilterMenuItem+ isChecked={baseFilter === null}+ label="All bases"+ value="base-all"+ onSelect={() => onBaseFilterChange(null)}+ />+ {availableBases.map((base) => (+ <FilterMenuItem+ key={base}+ isChecked={baseFilter === base}+ label={getModelBaseLabel(base)}+ value={`base-${base}`}+ onSelect={() => onBaseFilterChange(baseFilter === base ? null : base)}+ />+ ))}+ </Menu.ItemGroup>+ <Menu.Separator />+ <Menu.ItemGroup>+ <Menu.ItemGroupLabel color="fg.subtle" fontSize="2xs" textTransform="uppercase">+ Sort By+ </Menu.ItemGroupLabel>+ {sortFields.map(({ field, label }) => (+ <FilterMenuItem+ key={field}+ isChecked={sortField === field}+ label={label}+ value={`sort-${field}`}+ onSelect={() =>+ onSortChange(field, sortField === field ? (sortDirection === 'asc' ? 'desc' : 'asc') : 'asc')+ }+ trailing={sortField === field ? (sortDirection === 'asc' ? 'Asc' : 'Desc') : undefined}+ />+ ))}+ </Menu.ItemGroup>+ </MenuContent>+ </Menu.Positioner>+ </Portal>+ </Menu.Root>+);++/** Checkmark-style menu item shared by the model filter menus. */+export const FilterMenuItem = ({+ isChecked,+ label,+ onSelect,+ trailing,+ value,+}: {+ isChecked: boolean;+ label: string;+ onSelect: () => void;+ trailing?: string;+ value: string;+}) => (+ <Menu.Item aria-checked={isChecked} closeOnSelect={false} role="menuitemcheckbox" value={value} onClick={onSelect}>+ <Icon as={CheckIcon} boxSize="3" opacity={isChecked ? 1 : 0} />+ <Menu.ItemText fontSize="xs">{label}</Menu.ItemText>+ {trailing ? (+ <Text color="fg.subtle" fontSize="2xs" ms="auto">+ {trailing}+ </Text>+ ) : null}+ </Menu.Item>+);diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/models/shared/ResultsListHeader.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/shared/ResultsListHeader.tsxnew file mode 100644index 0000000000..37700cbdff--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/shared/ResultsListHeader.tsx@@ -0,0 +1,62 @@+import type { ReactNode } from 'react';++import { HStack, Icon, Input, InputGroup, Stack, Text } from '@chakra-ui/react';+import { Button, IconButton } from '@workbench/components/ui';+import { DownloadIcon, SearchIcon, XIcon } from 'lucide-react';++/**+ * Shared header for an installable-source results panel (HuggingFace files,+ * folder-scan results): a summary line with an optional extra control and a+ * dismiss, over a filter box and an Install All action. Presentational only —+ * each consumer owns its own filter state, Install All predicate, and rows.+ */+export const ResultsListHeader = ({+ extra,+ installAllDisabled,+ installAllLabel = 'Install all',+ onClear,+ onInstallAll,+ onSearchChange,+ searchPlaceholder = 'Filter results',+ searchValue,+ summary,+}: {+ extra?: ReactNode;+ installAllDisabled: boolean;+ installAllLabel?: string;+ onClear: () => void;+ onInstallAll: () => void;+ onSearchChange: (value: string) => void;+ searchPlaceholder?: string;+ searchValue: string;+ summary: ReactNode;+}) => (+ <Stack gap="1.5">+ <HStack gap="2" justify="space-between" wrap="wrap">+ <Text color="fg.muted" fontSize="2xs">+ {summary}+ </Text>+ <HStack gap="3">+ {extra}+ <IconButton aria-label="Dismiss results" size="2xs" variant="ghost" onClick={onClear}>+ <Icon as={XIcon} boxSize="3" />+ </IconButton>+ </HStack>+ </HStack>+ <HStack gap="2">+ <InputGroup flex="1" startElement={<Icon as={SearchIcon} boxSize="3" color="fg.subtle" />}>+ <Input+ aria-label={searchPlaceholder}+ placeholder={searchPlaceholder}+ size="xs"+ value={searchValue}+ onChange={(event) => onSearchChange(event.currentTarget.value)}+ />+ </InputGroup>+ <Button disabled={installAllDisabled} flexShrink={0} size="xs" variant="outline" onClick={onInstallAll}>+ <Icon as={DownloadIcon} boxSize="3" />+ {installAllLabel}+ </Button>+ </HStack>+ </Stack>+);diff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/SourceListItem.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/models/shared/SourceListItem.tsxsimilarity index 96%rename from invokeai/frontend/webv2/src/workbench/widgets/models/SourceListItem.tsxrename to invokeai/frontend/webv2/src/workbench/launchpad/models/shared/SourceListItem.tsxindex 78019d0c3a..b2b9a4139c 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/models/SourceListItem.tsx+++ b/invokeai/frontend/webv2/src/workbench/launchpad/models/shared/SourceListItem.tsx@@ -3,7 +3,7 @@ import type { ReactNode } from 'react';import { Badge, HStack, Icon, Spinner, Stack, Text } from '@chakra-ui/react';import { Button, Panel } from '@workbench/components/ui';import { useActiveInstallSources } from '@workbench/models/installsStore';-import { openModelsCenterTab } from '@workbench/models/uiStore';+import { openInstallQueue } from '@workbench/models/uiStore';import { DownloadIcon } from 'lucide-react';/**@@ -83,7 +83,7 @@ export const InstallSourceButton = ({variant="ghost"onClick={(event) => {event.stopPropagation();- openModelsCenterTab('queue');+ openInstallQueue();}}>View queuediff --git a/invokeai/frontend/webv2/src/workbench/launchpad/nodes/NodeManagerView.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/NodeManagerView.tsxnew file mode 100644index 0000000000..89e7afcb64--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/NodeManagerView.tsx@@ -0,0 +1,22 @@+import { Flex } from '@chakra-ui/react';+import { ensureCustomNodePacksLoaded } from '@workbench/customNodes/nodesStore';+import { useEffect } from 'react';++import { DetailPane } from './manager/DetailPane';+import { LibraryColumn } from './manager/LibraryColumn';++/** Full custom nodes manager: persistent pack library plus right-side detail pane. */+export const NodeManagerView = () => {+ useEffect(() => {+ ensureCustomNodePacksLoaded();+ }, []);++ return (+ <Flex direction="column" h="full" minH="0" w="full">+ <Flex flex="1" minH="0" w="full">+ <LibraryColumn />+ <DetailPane />+ </Flex>+ </Flex>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/nodes/activity/NodeActivityBar.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/activity/NodeActivityBar.tsxnew file mode 100644index 0000000000..c2a6f78a7c--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/activity/NodeActivityBar.tsx@@ -0,0 +1,81 @@+import { Badge, Box, Collapsible, Flex, HStack, Icon, Spinner, Text } from '@chakra-ui/react';+import { Button } from '@workbench/components/ui';+import { clearCustomNodeInstallLog, useCustomNodeInstallLog } from '@workbench/customNodes/installLogStore';+import { setNodeActivityExpanded, useNodesUi } from '@workbench/customNodes/nodesUiStore';+import { ChevronUpIcon, ListOrderedIcon, Trash2Icon } from 'lucide-react';++import { NodeInstallLog } from './NodeInstallLog';++/** Persistent, collapsible install activity footer for the nodes manager detail pane. */+export const NodeActivityBar = () => {+ const { activityExpanded } = useNodesUi();+ const log = useCustomNodeInstallLog();+ const installingCount = log.filter((entry) => entry.status === 'installing').length;+ const summary =+ installingCount > 0+ ? `${log.find((entry) => entry.status === 'installing')?.name ?? 'Installing'}${+ installingCount > 1 ? ` +${installingCount - 1} more` : ''+ }`+ : log.length > 0+ ? `${log.length} recent activit${log.length === 1 ? 'y' : 'ies'}`+ : 'No recent activity';++ return (+ <Collapsible.Root+ bg="bg.subtle"+ borderTopWidth={1}+ flexShrink={0}+ open={activityExpanded}+ overflow="hidden"+ onOpenChange={(event) => setNodeActivityExpanded(event.open)}+ >+ <Collapsible.Content>+ <Flex direction="column" h="min(22rem, 45dvh)" minH="0" overflow="hidden">+ <HStack borderBottomWidth={1} gap="2" justify="space-between" px="3" py="1.5">+ <Text color="fg.subtle" fontSize="2xs" fontWeight="700" textTransform="uppercase">+ Install Activity+ </Text>+ <Button disabled={log.length === 0} size="2xs" variant="ghost" onClick={clearCustomNodeInstallLog}>+ <Icon as={Trash2Icon} boxSize="3" />+ Clear+ </Button>+ </HStack>+ <Box flex="1" minH="0" overflow="hidden" p="2">+ <NodeInstallLog />+ </Box>+ </Flex>+ </Collapsible.Content>++ <HStack gap="1" px="3" py="2">+ <Collapsible.Trigger+ alignItems="center"+ bg="transparent"+ color="inherit"+ display="flex"+ flex="1"+ gap="2"+ minW="0"+ textAlign="start"+ _hover={{ color: 'fg' }}+ >+ {installingCount > 0 ? (+ <Spinner borderWidth="1.5px" boxSize="3.5" color="accent.solid" flexShrink={0} />+ ) : (+ <Icon as={ListOrderedIcon} boxSize="3.5" color="fg.subtle" flexShrink={0} />+ )}+ <Text flex="1" fontSize="xs" fontWeight="600" minW="0" truncate>+ {summary}+ </Text>+ {installingCount > 0 ? (+ <Badge colorPalette="accent" flexShrink={0} fontSize="2xs" size="sm" variant="solid">+ {installingCount}+ </Badge>+ ) : null}+ <Collapsible.Indicator _open={{ transform: 'rotate(180deg)' }} transition="transform 0.2s">+ <Icon as={ChevronUpIcon} boxSize="4" color="fg.subtle" flexShrink={0} />+ </Collapsible.Indicator>+ </Collapsible.Trigger>+ </HStack>+ </Collapsible.Root>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/nodes/activity/NodeInstallLog.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/activity/NodeInstallLog.tsxnew file mode 100644index 0000000000..f736514ab0--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/activity/NodeInstallLog.tsx@@ -0,0 +1,85 @@+import type { SystemStyleObject } from '@chakra-ui/react';+import type { CustomNodeInstallLogEntry } from '@workbench/customNodes/installLogStore';++import { Badge, Icon, Table, Text } from '@chakra-ui/react';+import { Scrollable } from '@workbench/components/ui';+import { EmptyState } from '@workbench/components/ui/EmptyState';+import { useCustomNodeInstallLog } from '@workbench/customNodes/installLogStore';+import { InboxIcon } from 'lucide-react';++const INSTALL_LOG_TABLE_SX: SystemStyleObject = {+ '& tbody tr:nth-of-type(odd)': { bg: 'bg.muted' },+ '& th': { bg: 'bg.subtle', position: 'sticky', top: 0, zIndex: 1 },+};++const STATUS_BADGES: Record<CustomNodeInstallLogEntry['status'], { label: string; palette: string }> = {+ completed: { label: 'Completed', palette: 'green' },+ error: { label: 'Error', palette: 'red' },+ installing: { label: 'Installing', palette: 'blue' },+ uninstalled: { label: 'Uninstalled', palette: 'orange' },+};++/**+ * Session install activity for the nodes manager. Tracks install / uninstall+ * outcomes for the current session in a sticky-header table.+ */+export const NodeInstallLog = () => {+ const log = useCustomNodeInstallLog();++ if (log.length === 0) {+ return (+ <EmptyState+ description="Install or uninstall a node pack and the outcome shows up here."+ icon={<Icon as={InboxIcon} />}+ title="No recent activity"+ />+ );+ }++ return (+ <Scrollable h="full" label="Custom node install activity" minH="0">+ <Table.Root css={INSTALL_LOG_TABLE_SX} minW="36rem" size="sm">+ <Table.Header>+ <Table.Row>+ <Table.ColumnHeader borderColor="border.subtle" ps="3">+ Name+ </Table.ColumnHeader>+ <Table.ColumnHeader borderColor="border.subtle">Status</Table.ColumnHeader>+ <Table.ColumnHeader borderColor="border.subtle" pe="3">+ Message+ </Table.ColumnHeader>+ </Table.Row>+ </Table.Header>+ <Table.Body>+ {log.map((entry) => (+ <InstallLogRow key={entry.id} entry={entry} />+ ))}+ </Table.Body>+ </Table.Root>+ </Scrollable>+ );+};++const InstallLogRow = ({ entry }: { entry: CustomNodeInstallLogEntry }) => {+ const badge = STATUS_BADGES[entry.status];++ return (+ <Table.Row>+ <Table.Cell borderColor="border.subtle" ps="3">+ <Text fontSize="xs" title={entry.name} truncate>+ {entry.name}+ </Text>+ </Table.Cell>+ <Table.Cell borderColor="border.subtle">+ <Badge colorPalette={badge.palette} fontSize="2xs" variant="surface">+ {badge.label}+ </Badge>+ </Table.Cell>+ <Table.Cell borderColor="border.subtle" pe="3">+ <Text color="fg.subtle" fontSize="2xs" lineClamp={2} overflowWrap="anywhere">+ {entry.message ?? ''}+ </Text>+ </Table.Cell>+ </Table.Row>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/nodes/add-nodes/AddNodesView.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/add-nodes/AddNodesView.tsxnew file mode 100644index 0000000000..ce3cf9e681--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/add-nodes/AddNodesView.tsx@@ -0,0 +1,138 @@+import { Alert, Box, HStack, Icon, Input, Stack, Text } from '@chakra-ui/react';+import { getApiErrorMessage } from '@workbench/backend/http';+import { Button, Field, Scrollable, Tabs, toaster } from '@workbench/components/ui';+import { installCustomNodePack } from '@workbench/customNodes/api';+import { addCustomNodeInstallLogEntry } from '@workbench/customNodes/installLogStore';+import { refreshCustomNodePacks, useCustomNodesSnapshot } from '@workbench/customNodes/nodesStore';+import { updateNodesUi, useNodesUi, type AddNodesTab } from '@workbench/customNodes/nodesUiStore';+import { FolderOpenIcon, GitBranchIcon } from 'lucide-react';+import { useState } from 'react';++/**+ * Every way to add custom nodes, one sub-tab per source — Git URL install and+ * the scan-folder workflow. Mirrors the model manager's Add Models view; the+ * active sub-tab lives in the nodes UI store so it survives navigation.+ */+export const AddNodesView = () => {+ const { addTab } = useNodesUi();+ const { customNodesPath } = useCustomNodesSnapshot();++ return (+ <Stack gap="3" h="full" minH="0">+ <Tabs.Root+ size="sm"+ value={addTab}+ onValueChange={(event) => updateNodesUi({ addTab: event.value as AddNodesTab })}+ >+ <Tabs.List>+ <Tabs.Trigger fontSize="xs" value="git">+ <Icon as={GitBranchIcon} boxSize="3" />+ Git URL+ </Tabs.Trigger>+ <Tabs.Trigger fontSize="xs" value="scan">+ <Icon as={FolderOpenIcon} boxSize="3" />+ Scan Folder+ </Tabs.Trigger>+ </Tabs.List>+ </Tabs.Root>+ <Scrollable flex="1" label="Add custom nodes" minH="0" pr="1">+ {addTab === 'git' ? <InstallFromGitForm /> : <ScanFolderInfo customNodesPath={customNodesPath} />}+ </Scrollable>+ </Stack>+ );+};++const InstallFromGitForm = () => {+ const [source, setSource] = useState('');+ const [isInstalling, setIsInstalling] = useState(false);+ const trimmedSource = source.trim();++ const handleInstall = async () => {+ if (!trimmedSource) {+ return;+ }++ setIsInstalling(true);+ addCustomNodeInstallLogEntry({ name: trimmedSource, status: 'installing' });++ try {+ const result = await installCustomNodePack(trimmedSource);++ if (result.success) {+ addCustomNodeInstallLogEntry({ message: result.message, name: result.name, status: 'completed' });+ setSource('');+ await refreshCustomNodePacks();++ if (result.requires_dependencies) {+ toaster.create({+ description: `${result.name} requires dependencies from ${result.dependency_file ?? 'requirements.txt'}. Install them, then restart InvokeAI.`,+ title: 'Dependencies required',+ type: 'warning',+ });+ }+ } else {+ addCustomNodeInstallLogEntry({ message: result.message, name: result.name, status: 'error' });+ }+ } catch (error) {+ addCustomNodeInstallLogEntry({+ message: getApiErrorMessage(error, 'Install failed.'),+ name: trimmedSource,+ status: 'error',+ });+ } finally {+ setIsInstalling(false);+ }+ };++ return (+ <Stack gap="4" maxW="44rem">+ <Alert.Root borderRadius="md" size="sm" status="warning" variant="surface">+ <Alert.Indicator />+ <Alert.Title fontSize="xs">+ Custom nodes execute Python code. Only install packs from authors you trust.+ </Alert.Title>+ </Alert.Root>+ <Field+ helpText="Paste a public Git repository URL. InvokeAI clones it into your custom nodes directory."+ label="Git URL"+ >+ <HStack align="start" gap="2">+ <Input+ placeholder="https://github.com/owner/invokeai-node-pack.git"+ size="sm"+ value={source}+ onChange={(event) => setSource(event.currentTarget.value)}+ onKeyDown={(event) => {+ if (event.key === 'Enter') {+ event.preventDefault();+ void handleInstall();+ }+ }}+ />+ <Button disabled={!trimmedSource} loading={isInstalling} size="sm" onClick={() => void handleInstall()}>+ Install+ </Button>+ </HStack>+ </Field>+ </Stack>+ );+};++const ScanFolderInfo = ({ customNodesPath }: { customNodesPath: string | null }) => (+ <Stack gap="3" maxW="44rem">+ <Text color="fg.muted" fontSize="xs">+ Add node packs directly to the custom nodes directory, then reload nodes. InvokeAI scans this folder on startup+ and reload.+ </Text>+ {customNodesPath ? (+ <Box bg="bg.subtle" borderColor="border.subtle" borderWidth="1px" p="3" rounded="md">+ <Text color="fg.subtle" fontSize="2xs" fontWeight="600" textTransform="uppercase">+ Nodes Directory+ </Text>+ <Text fontFamily="mono" fontSize="xs" mt="1" overflowWrap="anywhere">+ {customNodesPath}+ </Text>+ </Box>+ ) : null}+ </Stack>+);diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/nodes/detail/NodePackDetail.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/detail/NodePackDetail.tsxnew file mode 100644index 0000000000..79d03d69aa--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/detail/NodePackDetail.tsx@@ -0,0 +1,122 @@+import type { NodePackInfo } from '@workbench/customNodes/api';++import { Badge, Box, Flex, HStack, Icon, Spinner, Stack, Text } from '@chakra-ui/react';+import { Button, ConfirmDialog } from '@workbench/components/ui';+import { EmptyState } from '@workbench/components/ui/EmptyState';+import { useNodePackActions } from '@workbench/launchpad/nodes/shared/useNodePackActions';+import { ensureInvocationTemplatesLoaded, useInvocationTemplatesSnapshot } from '@workbench/workflows/templates';+import { BlocksIcon, TriangleAlertIcon, Trash2Icon } from 'lucide-react';+import { useEffect, useMemo, useState } from 'react';++import { NodePreviewCard } from './NodePreviewCard';++/**+ * Detail pane for a selected pack: a metadata header with an uninstall action,+ * then a live preview of every node the pack contributes. Previews are built+ * from the invocation templates the backend parsed from its OpenAPI schema —+ * `pack.node_types` are the exact invocation type keys, and a pack's nodes all+ * share `template.nodePack === pack.name`.+ */+export const NodePackDetail = ({ onUninstalled, pack }: { onUninstalled: () => void; pack: NodePackInfo }) => {+ const { status, templates } = useInvocationTemplatesSnapshot();++ useEffect(() => {+ ensureInvocationTemplatesLoaded();+ }, []);++ const packTemplates = useMemo(+ () => pack.node_types.map((nodeType) => templates[nodeType]).filter((template) => template !== undefined),+ [pack.node_types, templates]+ );++ const isLoadingTemplates = (status === 'idle' || status === 'loading') && packTemplates.length === 0;++ return (+ <Stack gap="4" pb="4">+ <HStack align="start" gap="3" justify="space-between">+ <Stack flex="1" gap="1.5" minW="0">+ <HStack gap="2" minW="0">+ <Icon as={BlocksIcon} boxSize="4" color="fg.muted" flexShrink={0} />+ <Text fontSize="sm" fontWeight="700" minW="0" truncate>+ {pack.name}+ </Text>+ </HStack>+ <Text color="fg.subtle" fontFamily="mono" fontSize="2xs" overflowWrap="anywhere">+ {pack.path}+ </Text>+ <HStack gap="1.5" wrap="wrap">+ <Badge colorPalette="blue" fontSize="2xs" variant="surface">+ {pack.node_count} node{pack.node_count === 1 ? '' : 's'}+ </Badge>+ </HStack>+ </Stack>+ <UninstallButton onUninstalled={onUninstalled} pack={pack} />+ </HStack>++ <Stack gap="2">+ <Text color="fg.subtle" fontSize="2xs" fontWeight="600" textTransform="uppercase">+ Nodes in this pack+ </Text>+ {isLoadingTemplates ? (+ <Flex align="center" justify="center" py="10">+ <Spinner color="fg.subtle" size="sm" />+ </Flex>+ ) : packTemplates.length === 0 ? (+ <EmptyState+ description="The backend has no node definitions for this pack yet. Reload nodes or restart InvokeAI to load them."+ icon={<Icon as={TriangleAlertIcon} />}+ title="No node previews available"+ />+ ) : (+ <Flex gap="8" wrap="wrap" px="2">+ {packTemplates.map((template) => (+ <Box key={template.type} flexShrink={0} w="18rem">+ <NodePreviewCard template={template} />+ </Box>+ ))}+ </Flex>+ )}+ </Stack>+ </Stack>+ );+};++const UninstallButton = ({ onUninstalled, pack }: { onUninstalled: () => void; pack: NodePackInfo }) => {+ const { uninstall } = useNodePackActions();+ const [isConfirmOpen, setIsConfirmOpen] = useState(false);+ const [isUninstalling, setIsUninstalling] = useState(false);++ const handleUninstall = async () => {+ setIsUninstalling(true);++ try {+ await uninstall(pack, onUninstalled);+ } finally {+ setIsUninstalling(false);+ }+ };++ return (+ <>+ <Button+ colorPalette="red"+ flexShrink={0}+ loading={isUninstalling}+ size="xs"+ variant="outline"+ onClick={() => setIsConfirmOpen(true)}+ >+ <Icon as={Trash2Icon} boxSize="3" />+ Uninstall+ </Button>+ <ConfirmDialog+ body="Remove this pack from the custom nodes directory? A restart is required for removal to fully apply."+ confirmLabel="Uninstall Node Pack"+ isOpen={isConfirmOpen}+ title={`Uninstall ${pack.name}?`}+ onClose={() => setIsConfirmOpen(false)}+ onConfirm={handleUninstall}+ />+ </>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/nodes/detail/NodePreviewCard.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/detail/NodePreviewCard.tsxnew file mode 100644index 0000000000..75027aaf60--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/detail/NodePreviewCard.tsx@@ -0,0 +1,165 @@+import type {+ FieldInputTemplate,+ FieldOutputTemplate,+ FieldType,+ InvocationTemplate,+} from '@workbench/workflows/types';++import { Box, Flex, Icon, Stack, Text } from '@chakra-ui/react';+import { Tooltip } from '@workbench/components/ui';+import { getFieldTypeColor, getFieldTypeLabel, isModelFieldType } from '@workbench/workflows/fields';+import { InfoIcon } from 'lucide-react';++/**+ * A read-only, static rendering of a single node — the same visual language as+ * the editor's `InvocationFlowNode` (titled header, output rows above input+ * rows, colored field handles) but with none of its editor coupling. The real+ * node depends on ReactFlow context (`Handle`, `useStore`) and the workbench+ * dispatch; the Launchpad mounts neither, so this previews the node's shape+ * from just its `InvocationTemplate`. Handles are drawn as plain dots, fields+ * are labels only (no value controls), and nothing is interactive.+ */++const sortByUiOrder = <T extends { uiOrder?: number | null }>(templates: T[]): T[] =>+ [...templates].sort((a, b) => (a.uiOrder ?? Number.MAX_SAFE_INTEGER) - (b.uiOrder ?? Number.MAX_SAFE_INTEGER));++/** A static stand-in for a ReactFlow connection handle, tinted and shaped by field type. */+const HandleDot = ({ side, type }: { side: 'left' | 'right'; type: FieldType }) => {+ const color = getFieldTypeColor(type);+ const isFilled = type.cardinality === 'SINGLE';+ const isAngular = isModelFieldType(type) || type.batch;++ return (+ <Box+ bg={isFilled ? color : 'bg.muted'}+ borderColor={color}+ borderRadius={isAngular ? 'xs' : 'full'}+ borderWidth={isFilled ? '0' : '2px'}+ boxShadow="0 0 0 1.5px {colors.bg.muted}"+ boxSize="3"+ position="absolute"+ top="50%"+ transform={`translate(${side === 'left' ? '-50%' : '50%'}, -50%)${type.batch ? ' rotate(45deg)' : ''}`}+ {...(side === 'left' ? { left: '0' } : { right: '0' })}+ />+ );+};++const FieldTooltip = ({+ description,+ direction,+ template,+}: {+ description: string;+ direction: 'Input' | 'Output';+ template: { name: string; title: string; type: FieldType };+}) => (+ <Stack gap="0.5" maxW="18rem">+ <Text fontWeight="700">{template.title}</Text>+ <Text color="fg.subtle">Field: {template.name}</Text>+ <Text color="fg.subtle">Type: {getFieldTypeLabel(template.type)}</Text>+ <Text color="fg.subtle">{direction}</Text>+ {description ? <Text>{description}</Text> : null}+ </Stack>+);++const OutputRow = ({ template }: { template: FieldOutputTemplate }) => (+ <Box position="relative" px="3" py="1">+ <Tooltip+ content={<FieldTooltip description={template.description} direction="Output" template={template} />}+ positioning={{ placement: 'top-end' }}+ >+ <Flex justify="flex-end">+ <Text color="fg.muted" fontSize="2xs" lineHeight="1" maxW="full" textAlign="end" truncate>+ {template.title}+ </Text>+ </Flex>+ </Tooltip>+ <HandleDot side="right" type={template.type} />+ </Box>+);++const InputRow = ({ template }: { template: FieldInputTemplate }) => (+ <Box position="relative" px="3" py="1">+ <Tooltip+ content={<FieldTooltip description={template.description} direction="Input" template={template} />}+ positioning={{ placement: 'top-start' }}+ >+ <Text color="fg" fontSize="2xs" lineHeight="1" minW="0" truncate>+ {template.title}+ {template.required ? (+ <Text as="span" color="fg.error">+ {' *'}+ </Text>+ ) : null}+ </Text>+ </Tooltip>+ {template.input !== 'direct' ? <HandleDot side="left" type={template.type} /> : null}+ </Box>+);++const NodeInfoTooltip = ({ template }: { template: InvocationTemplate }) => (+ <Stack gap="1" maxW="20rem">+ <Text fontWeight="700">{template.title}</Text>+ <Text color="fg.subtle">Type: {template.type}</Text>+ <Text color="fg.subtle">Category: {template.category}</Text>+ <Text color="fg.subtle">Version: {template.version}</Text>+ {template.description ? <Text fontStyle="italic">{template.description}</Text> : null}+ </Stack>+);++export const NodePreviewCard = ({ template }: { template: InvocationTemplate }) => {+ const inputTemplates = sortByUiOrder(Object.values(template.inputs).filter((input) => !input.uiHidden));+ const outputTemplates = Object.values(template.outputs);+ const hasFields = inputTemplates.length > 0 || outputTemplates.length > 0;++ return (+ <Box+ bg="bg"+ borderColor="border.emphasized"+ borderWidth="1px"+ fontSize="xs"+ rounded="lg"+ shadow="sm"+ transition="border-color 0.12s ease, box-shadow 0.12s ease"+ w="full"+ _hover={{ borderColor: 'brand.solid', shadow: 'md' }}+ >+ <Flex+ align="center"+ bg="bg.subtle"+ borderBottomWidth="1px"+ borderColor="border.subtle"+ borderTopRadius="lg"+ gap="2"+ pe="2"+ ps="2.5"+ py="1.5"+ >+ <Text fontWeight="700" minW="0" title={template.title} truncate>+ {template.title}+ </Text>+ <Box flex="1" />+ <Tooltip content={<NodeInfoTooltip template={template} />} positioning={{ placement: 'top-end' }} showArrow>+ <Icon aria-label={`Details for ${template.title}`} as={InfoIcon} boxSize="3.5" color="fg.subtle" />+ </Tooltip>+ </Flex>+ <Stack bg="bg.muted" borderBottomRadius="lg" gap="0" py="1">+ {hasFields ? (+ <>+ {outputTemplates.map((output) => (+ <OutputRow key={output.name} template={output} />+ ))}+ {inputTemplates.map((input) => (+ <InputRow key={input.name} template={input} />+ ))}+ </>+ ) : (+ <Text color="fg.subtle" fontSize="2xs" px="3" py="1">+ No exposed fields.+ </Text>+ )}+ </Stack>+ </Box>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/nodes/library/NodePackContextMenu.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/library/NodePackContextMenu.tsxnew file mode 100644index 0000000000..eeba4d747f--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/library/NodePackContextMenu.tsx@@ -0,0 +1,82 @@+import type { NodePackInfo } from '@workbench/customNodes/api';++import { Icon, Menu, Portal } from '@chakra-ui/react';+import { ConfirmDialog, MenuContent } from '@workbench/components/ui';+import { useNodePackActions } from '@workbench/launchpad/nodes/shared/useNodePackActions';+import { Trash2Icon } from 'lucide-react';+import { useRef, useState } from 'react';++export interface NodePackContextMenuTarget {+ pack: NodePackInfo;+ x: number;+ y: number;+}++export const NodePackContextMenu = ({+ onClose,+ onUninstalled,+ target,+}: {+ onClose: () => void;+ onUninstalled: (packName: string) => void;+ target: NodePackContextMenuTarget | null;+}) => {+ const { uninstall } = useNodePackActions();+ const [pendingUninstall, setPendingUninstall] = useState<NodePackInfo | null>(null);+ const targetRef = useRef(target);++ targetRef.current = target;++ const pack = target?.pack ?? null;++ return (+ <>+ <Menu.Root+ key={target ? target.pack.name : 'closed'}+ lazyMount+ open={target !== null}+ positioning={{+ getAnchorRect: () => {+ const currentTarget = targetRef.current;++ return currentTarget ? { height: 1, width: 1, x: currentTarget.x, y: currentTarget.y } : null;+ },+ placement: 'bottom-start',+ }}+ unmountOnExit+ onOpenChange={(event) => {+ if (!event.open) {+ onClose();+ }+ }}+ >+ <Portal>+ <Menu.Positioner>+ {pack ? (+ <MenuContent minW="12rem">+ <Menu.Item color="fg.error" value="uninstall" onClick={() => setPendingUninstall(pack)}>+ <Icon as={Trash2Icon} boxSize="3.5" />+ <Menu.ItemText fontSize="xs">Uninstall</Menu.ItemText>+ </Menu.Item>+ </MenuContent>+ ) : null}+ </Menu.Positioner>+ </Portal>+ </Menu.Root>+ <ConfirmDialog+ body="Remove this pack from the custom nodes directory? A restart is required for removal to fully apply."+ confirmLabel="Uninstall Node Pack"+ isOpen={pendingUninstall !== null}+ title={`Uninstall ${pendingUninstall?.name ?? 'node pack'}?`}+ onClose={() => setPendingUninstall(null)}+ onConfirm={async () => {+ if (!pendingUninstall) {+ return;+ }++ await uninstall(pendingUninstall, onUninstalled);+ }}+ />+ </>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/nodes/library/NodePackList.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/library/NodePackList.tsxnew file mode 100644index 0000000000..bd0367aefe--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/library/NodePackList.tsx@@ -0,0 +1,160 @@+import type { NodePackInfo } from '@workbench/customNodes/api';++import { Badge, Flex, Icon, Input, InputGroup, Spinner, Stack, Text } from '@chakra-ui/react';+import { Button, Row, Scrollable } from '@workbench/components/ui';+import { EmptyState } from '@workbench/components/ui/EmptyState';+import { refreshCustomNodePacks } from '@workbench/customNodes/nodesStore';+import { BlocksIcon, PackageOpenIcon, SearchIcon, TriangleAlertIcon } from 'lucide-react';+import { useDeferredValue, useMemo, useState } from 'react';++import { NodePackContextMenu, type NodePackContextMenuTarget } from './NodePackContextMenu';++/**+ * Master list for the nodes manager: a search box over a scrollable column of+ * selectable pack rows. Mirrors the model library list — `Row` with the+ * `accent` active variant marks the open pack, and the search filters by name+ * or path.+ */+export const NodePackList = ({+ activePackName,+ error,+ onSearchChange,+ onSelect,+ onUninstalled,+ packs,+ searchTerm,+ status,+}: {+ activePackName: string | null;+ error: string | null;+ onSearchChange: (value: string) => void;+ onSelect: (packName: string) => void;+ onUninstalled: (packName: string) => void;+ packs: NodePackInfo[];+ searchTerm: string;+ status: 'idle' | 'loading' | 'loaded' | 'error';+}) => {+ const [contextMenuTarget, setContextMenuTarget] = useState<NodePackContextMenuTarget | null>(null);+ const deferredSearchTerm = useDeferredValue(searchTerm);+ const filtered = useMemo(() => {+ const query = deferredSearchTerm.trim().toLowerCase();++ if (!query) {+ return packs;+ }++ return packs.filter((pack) => pack.name.toLowerCase().includes(query) || pack.path.toLowerCase().includes(query));+ }, [deferredSearchTerm, packs]);++ if (status === 'error') {+ return (+ <Flex align="center" flex="1" justify="center" minH="0" p="3">+ <EmptyState+ danger+ description={error}+ icon={<Icon as={TriangleAlertIcon} />}+ title="Could not load custom node packs"+ >+ <Button size="sm" variant="outline" onClick={() => void refreshCustomNodePacks()}>+ Retry+ </Button>+ </EmptyState>+ </Flex>+ );+ }++ return (+ <Stack flex="1" gap="2" minH="0" pt="3">+ <InputGroup px="3" startElement={<Icon as={SearchIcon} boxSize="3.5" color="fg.subtle" />}>+ <Input+ aria-label="Search node packs"+ placeholder="Search packs…"+ size="xs"+ value={searchTerm}+ onChange={(event) => onSearchChange(event.currentTarget.value)}+ />+ </InputGroup>+ <Scrollable h="full" label="Installed custom node packs" minH="0">+ {status === 'idle' || status === 'loading' ? (+ <Flex align="center" justify="center" py="10">+ <Spinner color="fg.subtle" size="sm" />+ </Flex>+ ) : packs.length === 0 ? (+ <EmptyState+ description="Install from a Git URL or place packs in your custom nodes directory, then reload."+ icon={<Icon as={PackageOpenIcon} />}+ title="No custom node packs"+ />+ ) : filtered.length === 0 ? (+ <EmptyState description="Try a different search." icon={<Icon as={SearchIcon} />} title="No packs match" />+ ) : (+ <Stack gap="1" minW="0" p="1" px="3" w="full">+ {filtered.map((pack) => (+ <PackRow+ key={pack.name}+ isActive={pack.name === activePackName}+ pack={pack}+ onContextMenu={(targetPack, x, y) => setContextMenuTarget({ pack: targetPack, x, y })}+ onSelect={() => onSelect(pack.name)}+ />+ ))}+ </Stack>+ )}+ </Scrollable>+ <NodePackContextMenu+ target={contextMenuTarget}+ onClose={() => setContextMenuTarget(null)}+ onUninstalled={onUninstalled}+ />+ </Stack>+ );+};++const PackRow = ({+ isActive,+ onContextMenu,+ onSelect,+ pack,+}: {+ isActive: boolean;+ onContextMenu: (pack: NodePackInfo, x: number, y: number) => void;+ onSelect: () => void;+ pack: NodePackInfo;+}) => (+ <Row+ active={isActive ? 'accent' : 'none'}+ aria-current={isActive || undefined}+ px="2"+ py="1.5"+ minW="0"+ overflow="hidden"+ role="button"+ rounded="md"+ tabIndex={0}+ onClick={onSelect}+ onContextMenu={(event) => {+ event.preventDefault();+ onContextMenu(pack, event.clientX, event.clientY);+ }}+ onKeyDown={(event) => {+ if (event.key === 'Enter' || event.key === ' ') {+ event.preventDefault();+ onSelect();+ }+ }}+ >+ <Icon as={BlocksIcon} boxSize="4" color={isActive ? 'accent.contrast' : 'fg.subtle'} flexShrink={0} />+ <Text fontSize="xs" fontWeight="600" maxW="full" truncate>+ {pack.name}+ </Text>+ <Badge+ colorPalette={isActive ? undefined : 'gray'}+ flexShrink={0}+ fontSize="2xs"+ variant={isActive ? 'solid' : 'surface'}+ ms="auto"+ >+ {pack.node_count}+ </Badge>+ </Row>+);diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/nodes/manager/DetailPane.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/manager/DetailPane.tsxnew file mode 100644index 0000000000..005413cd23--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/manager/DetailPane.tsx@@ -0,0 +1,76 @@+import { Box, Flex, Icon, Text } from '@chakra-ui/react';+import { Scrollable, Tabs } from '@workbench/components/ui';+import { useCustomNodesSnapshot } from '@workbench/customNodes/nodesStore';+import { updateNodesUi, useNodesUi, type NodesManagerTab } from '@workbench/customNodes/nodesUiStore';+import { NodeActivityBar } from '@workbench/launchpad/nodes/activity/NodeActivityBar';+import { AddNodesView } from '@workbench/launchpad/nodes/add-nodes/AddNodesView';+import { NodePackDetail } from '@workbench/launchpad/nodes/detail/NodePackDetail';+import { BlocksIcon, PlusIcon } from 'lucide-react';++import { HEADER_MIN_HEIGHT } from './layoutConstants';++/** Right side of the nodes manager: selected pack details, Add Nodes, and activity footer. */+export const DetailPane = () => {+ const { activePackName, activeTab } = useNodesUi();+ const { nodePacks } = useCustomNodesSnapshot();+ const activePack = nodePacks.find((pack) => pack.name === activePackName) ?? null;+ const detailLabel = activePack?.name ?? 'Node Pack Details';++ return (+ <Flex direction="column" flex="1" minH="0" minW="0">+ <Flex align="flex-end" borderBottomWidth={1} flexShrink={0} minH={HEADER_MIN_HEIGHT} px="2">+ <Tabs.Root+ size="sm"+ mb="-1px"+ value={activeTab}+ onValueChange={(event) => updateNodesUi({ activeTab: event.value as NodesManagerTab })}+ >+ <Tabs.List h="full">+ <Tabs.Trigger fontSize="xs" value="details">+ <Icon as={BlocksIcon} boxSize="3" />+ <Text maxW="14rem" truncate>+ {detailLabel}+ </Text>+ </Tabs.Trigger>+ <Tabs.Trigger fontSize="xs" value="add">+ <Icon as={PlusIcon} boxSize="3" />+ Add Nodes+ </Tabs.Trigger>+ </Tabs.List>+ </Tabs.Root>+ </Flex>++ <Box flex="1" minH="0">+ {activeTab === 'details' ? <DetailTab packName={activePackName} /> : null}+ {activeTab === 'add' ? <AddNodesView /> : null}+ </Box>++ <NodeActivityBar />+ </Flex>+ );+};++const DetailTab = ({ packName }: { packName: string | null }) => {+ const { nodePacks } = useCustomNodesSnapshot();+ const activePack = nodePacks.find((pack) => pack.name === packName) ?? null;++ if (!activePack) {+ return (+ <Flex align="center" direction="column" gap="2" h="full" justify="center" p="6">+ <Icon as={BlocksIcon} boxSize="8" color="fg.subtle" />+ <Text color="fg.muted" fontSize="sm" fontWeight="600">+ Select a node pack+ </Text>+ <Text color="fg.subtle" fontSize="xs" maxW="22rem" textAlign="center">+ Choose a pack from the library to see its path, manage it, and preview every node it adds.+ </Text>+ </Flex>+ );+ }++ return (+ <Scrollable h="full" label="Node pack details" minH="0" p="3">+ <NodePackDetail pack={activePack} onUninstalled={() => updateNodesUi({ activePackName: null })} />+ </Scrollable>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/nodes/manager/LibraryColumn.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/manager/LibraryColumn.tsxnew file mode 100644index 0000000000..36d0eee3e3--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/manager/LibraryColumn.tsx@@ -0,0 +1,52 @@+import { Box, Flex, HStack, Text } from '@chakra-ui/react';+import { useCustomNodesSnapshot } from '@workbench/customNodes/nodesStore';+import { openNodePackDetail, updateNodesUi, useNodesUi } from '@workbench/customNodes/nodesUiStore';+import { NodePackList } from '@workbench/launchpad/nodes/library/NodePackList';++import { HEADER_MIN_HEIGHT, PACK_LIBRARY_WIDTH } from './layoutConstants';+import { ReloadNodesButton } from './ReloadNodesButton';++/** Persistent custom-node pack list, matching the model manager's library column. */+export const LibraryColumn = () => {+ const { activePackName, searchTerm } = useNodesUi();+ const { error, nodePacks, status } = useCustomNodesSnapshot();++ return (+ <Flex+ borderEndWidth={1}+ direction="column"+ flexShrink={0}+ h="full"+ minH="0"+ position="relative"+ w={PACK_LIBRARY_WIDTH}+ >+ <HStack align="center" borderBottomWidth={1} flexShrink={0} gap="2" minH={HEADER_MIN_HEIGHT} px="3">+ <Text fontSize="sm" fontWeight="700">+ Node Packs+ </Text>+ <Text color="fg.subtle" fontSize="xs">+ {nodePacks.length}+ </Text>+ <Box ms="auto">+ <ReloadNodesButton />+ </Box>+ </HStack>++ <NodePackList+ activePackName={activePackName}+ error={error}+ packs={nodePacks}+ searchTerm={searchTerm}+ status={status}+ onSearchChange={(value) => updateNodesUi({ searchTerm: value })}+ onSelect={openNodePackDetail}+ onUninstalled={(packName) => {+ if (activePackName === packName) {+ updateNodesUi({ activePackName: null });+ }+ }}+ />+ </Flex>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/nodes/manager/ReloadNodesButton.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/manager/ReloadNodesButton.tsxnew file mode 100644index 0000000000..8414e06d37--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/manager/ReloadNodesButton.tsx@@ -0,0 +1,34 @@+import { Icon } from '@chakra-ui/react';+import { getApiErrorMessage } from '@workbench/backend/http';+import { Button } from '@workbench/components/ui';+import { reloadCustomNodes } from '@workbench/customNodes/api';+import { refreshCustomNodePacks } from '@workbench/customNodes/nodesStore';+import { useNotify } from '@workbench/useNotify';+import { RefreshCwIcon } from 'lucide-react';+import { useState } from 'react';++export const ReloadNodesButton = () => {+ const notify = useNotify();+ const [isReloading, setIsReloading] = useState(false);++ const handleReload = async () => {+ setIsReloading(true);++ try {+ await reloadCustomNodes();+ await refreshCustomNodePacks();+ notify.success('Custom nodes reloaded');+ } catch (error) {+ notify.error('Reload failed', getApiErrorMessage(error, 'Could not reload custom nodes.'));+ } finally {+ setIsReloading(false);+ }+ };++ return (+ <Button loading={isReloading} size="2xs" variant="ghost" onClick={() => void handleReload()}>+ <Icon as={RefreshCwIcon} boxSize="3.5" />+ {isReloading ? 'Reloading' : 'Reload'}+ </Button>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/nodes/manager/layoutConstants.ts b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/manager/layoutConstants.tsnew file mode 100644index 0000000000..b2df20068d--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/manager/layoutConstants.ts@@ -0,0 +1,2 @@+export const PACK_LIBRARY_WIDTH = '22rem';+export const HEADER_MIN_HEIGHT = '2.75rem';diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/nodes/shared/useNodePackActions.ts b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/shared/useNodePackActions.tsnew file mode 100644index 0000000000..a87af50c85--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/nodes/shared/useNodePackActions.ts@@ -0,0 +1,27 @@+import type { NodePackInfo } from '@workbench/customNodes/api';++import { getApiErrorMessage } from '@workbench/backend/http';+import { uninstallCustomNodePack } from '@workbench/customNodes/api';+import { addCustomNodeInstallLogEntry } from '@workbench/customNodes/installLogStore';+import { refreshCustomNodePacks, removeCustomNodePackFromStore } from '@workbench/customNodes/nodesStore';+import { useNotify } from '@workbench/useNotify';++export const useNodePackActions = () => {+ const notify = useNotify();++ const uninstall = async (pack: NodePackInfo, onUninstalled?: (packName: string) => void) => {+ try {+ const result = await uninstallCustomNodePack(pack.name);++ removeCustomNodePackFromStore(pack.name);+ addCustomNodeInstallLogEntry({ message: result.message, name: result.name, status: 'uninstalled' });+ notify.success('Node pack uninstalled', 'Restart InvokeAI for node removal to take full effect.');+ onUninstalled?.(pack.name);+ } catch (error) {+ notify.error('Uninstall failed', getApiErrorMessage(error, 'Could not uninstall the node pack.'));+ await refreshCustomNodePacks();+ }+ };++ return { uninstall };+};diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/pages/ModelsPage.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/pages/ModelsPage.tsxnew file mode 100644index 0000000000..39eef10828--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/pages/ModelsPage.tsx@@ -0,0 +1,29 @@+import { Center, Spinner } from '@chakra-ui/react';+import { lazy, Suspense } from 'react';++/**+ * The Launchpad's model manager: full library, add-models flow, credentials,+ * and install queue. It is the widest page, so it runs full-bleed (the view owns+ * its own padding and internal master-detail scroll).+ *+ * The manager pulls in ~6k lines of model UI and stores, none of which the+ * Launchpad needs at first paint, so it is code-split: the chunk loads the+ * first time this tab is opened (the shell's `lazyMount` keeps it off the+ * critical path until then) and stays warm afterwards. All model state lives in+ * external stores, so the view needs no workbench providers here.+ */+const ModelManagerView = lazy(() =>+ import('@workbench/launchpad/models/ModelManagerView').then((module) => ({ default: module.ModelManagerView }))+);++export const ModelsPage = () => (+ <Suspense+ fallback={+ <Center h="full">+ <Spinner color="fg.muted" size="sm" />+ </Center>+ }+ >+ <ModelManagerView />+ </Suspense>+);diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/pages/NodesPage.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/pages/NodesPage.tsxnew file mode 100644index 0000000000..946fde43e7--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/pages/NodesPage.tsx@@ -0,0 +1,18 @@+import { Center, Spinner } from '@chakra-ui/react';+import { lazy, Suspense } from 'react';++const NodeManagerView = lazy(() =>+ import('@workbench/launchpad/nodes/NodeManagerView').then((module) => ({ default: module.NodeManagerView }))+);++export const NodesPage = () => (+ <Suspense+ fallback={+ <Center h="full">+ <Spinner color="fg.muted" size="sm" />+ </Center>+ }+ >+ <NodeManagerView />+ </Suspense>+);diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/pages/ProjectsPage.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/pages/ProjectsPage.tsxnew file mode 100644index 0000000000..d2121ef090--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/pages/ProjectsPage.tsx@@ -0,0 +1,85 @@+import type { SystemStyleObject } from '@chakra-ui/react';++import { Flex, Heading, HStack, Stack, Text } from '@chakra-ui/react';+import { Link, useNavigate } from '@tanstack/react-router';+import { useAuthSession } from '@workbench/auth/session';+import { Button, Scrollable, toaster } from '@workbench/components/ui';+import { ProjectsGrid } from '@workbench/launchpad/ProjectsGrid';+import { refreshProjectLibrary } from '@workbench/projects/library';+import { importProjectFile, pickProjectFile } from '@workbench/projects/projectFile';+import { FileUpIcon, PlusIcon } from 'lucide-react';+import { useEffect } from 'react';++/**+ * The Launchpad's home section: your project library. It keeps a comfortable+ * centered measure (the grid reads better than full-bleed) and owns its own+ * scroll so the rail and header stay fixed.+ */+const PROJECTS_PAGE_MEASURE_SX: SystemStyleObject = {+ maxW: '6xl',+ mx: 'auto',+ p: { base: 4, md: 8 },+ w: 'full',+};++export const ProjectsPage = () => {+ const session = useAuthSession();+ const navigate = useNavigate();++ useEffect(() => {+ void refreshProjectLibrary();+ }, []);++ const displayName = session.user?.display_name?.trim();+ const greeting = displayName ? `Welcome back, ${displayName}` : 'Welcome to Invoke';++ const handleImport = async () => {+ const file = await pickProjectFile();++ if (!file) {+ return;+ }++ try {+ const record = await importProjectFile(file);++ await navigate({ search: { project: record.project_id }, to: '/app' });+ } catch (error) {+ toaster.create({+ description: error instanceof Error ? error.message : undefined,+ title: 'Import failed',+ type: 'error',+ });+ }+ };++ return (+ <Scrollable h="full" label="Projects" minH="0">+ <Stack css={PROJECTS_PAGE_MEASURE_SX} gap="5">+ <Flex align="center" gap="3" justify="space-between" wrap="wrap">+ <Stack gap="0.5">+ <Heading fontSize="xl" fontWeight="700">+ {greeting}+ </Heading>+ <Text color="fg.muted" fontSize="xs">+ Pick up where you left off, or start something new.+ </Text>+ </Stack>+ <HStack gap="2" wrap="wrap">+ <Button size="xs" variant="outline" onClick={() => void handleImport()}>+ <FileUpIcon />+ Import…+ </Button>+ <Button asChild size="xs" variant="solid">+ <Link search={{ new: true }} to="/app">+ <PlusIcon />+ New project+ </Link>+ </Button>+ </HStack>+ </Flex>+ <ProjectsGrid />+ </Stack>+ </Scrollable>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/pages/UsersPage.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/pages/UsersPage.tsxnew file mode 100644index 0000000000..45297bbbf4--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/launchpad/pages/UsersPage.tsx@@ -0,0 +1,24 @@+import type { SystemStyleObject } from '@chakra-ui/react';++import { Box } from '@chakra-ui/react';+import { Scrollable } from '@workbench/components/ui';+import { UsersManagementPanel } from '@workbench/users';++/**+ * Admin-only section: create, edit, and remove users. Mirrors the Projects+ * page's centered measure and self-scroll so the chrome stays put.+ */+const USERS_PAGE_MEASURE_SX: SystemStyleObject = {+ maxW: '6xl',+ mx: 'auto',+ p: { base: 4, md: 8 },+ w: 'full',+};++export const UsersPage = () => (+ <Scrollable h="full" label="User management" minH="0">+ <Box css={USERS_PAGE_MEASURE_SX}>+ <UsersManagementPanel />+ </Box>+ </Scrollable>+);diff --git a/invokeai/frontend/webv2/src/workbench/layoutPresets.ts b/invokeai/frontend/webv2/src/workbench/layoutPresets.tsindex f91b297d68..e157d58180 100644--- a/invokeai/frontend/webv2/src/workbench/layoutPresets.ts+++ b/invokeai/frontend/webv2/src/workbench/layoutPresets.ts@@ -43,16 +43,6 @@ export const layoutPresets: LayoutPreset[] = [label: 'Linear UI',leftRegionWidgetId: 'workflow',},- {- description: 'Full-width model library, installs, and download queue.',- id: 'model-manager',- initialLayout: {- centerViewId: 'models',- panels: { isBottomOpen: true, isLeftOpen: false, isRightOpen: false },- presetId: 'model-manager',- },- label: 'Model Manager',- },];export const defaultLayoutPreset = layoutPresets[0];diff --git a/invokeai/frontend/webv2/src/workbench/models/ModelInstallRuntime.tsx b/invokeai/frontend/webv2/src/workbench/models/ModelInstallRuntime.tsxnew file mode 100644index 0000000000..35e11d4008--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/models/ModelInstallRuntime.tsx@@ -0,0 +1,39 @@+import { getConnectionStatus, subscribeConnection } from '@workbench/backend/connectionStore';+import { socketHub } from '@workbench/backend/socketHub';+import { useEffect } from 'react';++import { handleModelInstallSocketEvent, MODEL_INSTALL_SOCKET_EVENTS, refreshInstalls } from './installsStore';+import { refreshModels } from './modelsStore';+import { useInstallOutcomeToasts } from './useInstallOutcomeToasts';++/** Admin model-manager runtime: install socket events, reconnect refresh, and outcome toasts. */+export const ModelInstallRuntime = () => {+ useEffect(() => {+ const detachers = MODEL_INSTALL_SOCKET_EVENTS.map((event) =>+ socketHub.on(event, (payload) => handleModelInstallSocketEvent(event, payload))+ );++ return () => {+ for (const detach of detachers) {+ detach();+ }+ };+ }, []);++ useEffect(() => {+ const refreshOnConnect = () => {+ if (getConnectionStatus().status === 'connected') {+ void refreshModels();+ void refreshInstalls();+ }+ };++ refreshOnConnect();++ return subscribeConnection(refreshOnConnect);+ }, []);++ useInstallOutcomeToasts();++ return null;+};diff --git a/invokeai/frontend/webv2/src/workbench/models/api.ts b/invokeai/frontend/webv2/src/workbench/models/api.tsindex e2062adafd..f3cb477066 100644--- a/invokeai/frontend/webv2/src/workbench/models/api.ts+++ b/invokeai/frontend/webv2/src/workbench/models/api.ts@@ -126,6 +126,13 @@ export const resumeModelInstall = (id: number): Promise<ModelInstallJob> =>export const restartFailedModelInstall = (id: number): Promise<ModelInstallJob> =>apiFetchJson<ModelInstallJob>(`${MODELS_BASE}/install/${id}/restart_failed`, { method: 'POST' });+/** Restart a single download part (by its file URL) of an install job. */+export const restartModelInstallFile = (id: number, fileSource: string): Promise<ModelInstallJob> =>+ apiFetchJson<ModelInstallJob>(`${MODELS_BASE}/install/${id}/restart_file`, {+ body: JSON.stringify(fileSource),+ method: 'POST',+ });+export const pruneCompletedModelInstalls = async (): Promise<void> => {await apiFetch(`${MODELS_BASE}/install`, { method: 'DELETE' });};diff --git a/invokeai/frontend/webv2/src/workbench/models/modelsStore.ts b/invokeai/frontend/webv2/src/workbench/models/modelsStore.tsindex e121022eaf..360bb2acaf 100644--- a/invokeai/frontend/webv2/src/workbench/models/modelsStore.ts+++ b/invokeai/frontend/webv2/src/workbench/models/modelsStore.ts@@ -7,7 +7,7 @@ import { getModelsDir, listMissingModels, listModels } from './api';/*** Shared library store for installed model configs. Lives outside the* workbench reducer because the list is backend-owned server state shared by- * every surface of the models widget (panel, center view, pickers); a single+ * every model surface (manager, detail views, pickers); a single* module store keeps them consistent and avoids re-fetch storms. Mutations go* through the API layer and then either patch the snapshot in place (fast* path) or trigger a refresh.diff --git a/invokeai/frontend/webv2/src/workbench/models/types.ts b/invokeai/frontend/webv2/src/workbench/models/types.tsindex ab8ca1231f..c0f3ac985d 100644--- a/invokeai/frontend/webv2/src/workbench/models/types.ts+++ b/invokeai/frontend/webv2/src/workbench/models/types.ts@@ -159,6 +159,12 @@ export interface ModelInstallDownloadPart {bytes: number;total_bytes: number;status?: string;+ /** Server refused to resume this part; it must be restarted from scratch. */+ resume_required?: boolean;+ /** Why a resume was refused, when known. */+ resume_message?: string | null;+ /** The part was silently restarted from the beginning after a failed resume. */+ resume_from_scratch?: boolean;}/** A model install job as returned by `/api/v2/models/install`. */diff --git a/invokeai/frontend/webv2/src/workbench/models/uiStore.ts b/invokeai/frontend/webv2/src/workbench/models/uiStore.tsindex 5e47d004c4..130fd871dd 100644--- a/invokeai/frontend/webv2/src/workbench/models/uiStore.ts+++ b/invokeai/frontend/webv2/src/workbench/models/uiStore.ts@@ -5,15 +5,20 @@ import type { FoundModel } from './types';import { DEFAULT_LIBRARY_FILTERS, type ModelLibraryFilters } from './library';/**- * Session-lived UI state for the model manager. Widget views unmount whenever- * the user switches tabs, regions, or center views; keeping selection,+ * Session-lived UI state for the model manager. Views unmount whenever the user+ * switches launchpad tabs or detail tabs; keeping selection,* filters, and in-progress source forms here means nothing is forgotten when* they come back. Deliberately not persisted to localStorage — it resets with* the page, like a scroll position.*/-export type ModelsCenterTab = 'library' | 'add' | 'queue';-export type AddModelsTab = 'starter' | 'url' | 'huggingface' | 'scan' | 'keys';+/**+ * The detail-pane tabs. The library list is now a persistent left column, so it+ * is no longer a tab; the install queue is a persistent detail-pane footer. What+ * remains is the selected model's detail, the unified Add Models search, and API+ * keys.+ */+export type ModelManagerTab = 'details' | 'add' | 'keys';/** A resolved HuggingFace checkpoint-repo lookup, kept across tab switches. */export interface HFLookupState {@@ -22,30 +27,28 @@ export interface HFLookupState {}export interface ModelsUiSnapshot {- centerTab: ModelsCenterTab;- addTab: AddModelsTab;- /** Model focused in the center library's detail pane. */+ activeTab: ModelManagerTab;+ /** Model focused in the manager library's detail pane. */activeModelKey: string | null;- /** Model drilled into from the side panel. */- panelModelKey: string | null;selectedKeys: ReadonlySet<string>;filters: ModelLibraryFilters;/** Last folder-scan query and its results, kept across tab switches. */scan: { path: string; results: FoundModel[] } | null;/** Last HuggingFace repo lookup, kept across tab switches. */hfLookup: HFLookupState | null;+ /** Whether the always-visible install queue footer is expanded. */+ queueExpanded: boolean;/** Scroll offsets per library-list instance, restored on remount. */libraryScrollOffsets: Record<string, number>;}const store = createExternalStore<ModelsUiSnapshot>({activeModelKey: null,- addTab: 'starter',- centerTab: 'library',+ activeTab: 'add',filters: DEFAULT_LIBRARY_FILTERS,hfLookup: null,libraryScrollOffsets: {},- panelModelKey: null,+ queueExpanded: false,scan: null,selectedKeys: new Set(),});@@ -68,19 +71,32 @@ export const toggleModelSelection = (key: string): void => {/** Drop deleted models from selection/active slots so stale keys never linger. */export const pruneModelsUiKeys = (deletedKeys: string[]): void => {- const { activeModelKey, panelModelKey, selectedKeys } = store.getSnapshot();+ const { activeModelKey, selectedKeys } = store.getSnapshot();const deleted = new Set(deletedKeys);updateModelsUi({activeModelKey: activeModelKey !== null && deleted.has(activeModelKey) ? null : activeModelKey,- panelModelKey: panelModelKey !== null && deleted.has(panelModelKey) ? null : panelModelKey,selectedKeys: new Set([...selectedKeys].filter((key) => !deleted.has(key))),});};-/** Jump the center view to a specific model manager tab (used by the panel). */-export const openModelsCenterTab = (centerTab: ModelsCenterTab, addTab?: AddModelsTab): void => {- updateModelsUi({ centerTab, ...(addTab ? { addTab } : {}) });+/** Jump the model manager's detail pane to a specific tab. */+export const openModelManagerTab = (activeTab: ModelManagerTab): void => {+ updateModelsUi({ activeTab });+};++/** Focus a model and reveal it in the detail tab (e.g. from a library row). */+export const openModelDetail = (modelKey: string): void => {+ updateModelsUi({ activeModelKey: modelKey, activeTab: 'details' });+};++/** Expand the always-visible install queue footer (e.g. from a "View queue" link). */+export const openInstallQueue = (): void => {+ updateModelsUi({ queueExpanded: true });+};++export const setQueueExpanded = (queueExpanded: boolean): void => {+ updateModelsUi({ queueExpanded });};export const saveLibraryScrollOffset = (instanceId: string, offset: number): void => {diff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/ModelsRuntime.tsx b/invokeai/frontend/webv2/src/workbench/models/useInstallOutcomeToasts.tssimilarity index 52%rename from invokeai/frontend/webv2/src/workbench/widgets/models/ModelsRuntime.tsxrename to invokeai/frontend/webv2/src/workbench/models/useInstallOutcomeToasts.tsindex 4f002bdc75..1279c2b00f 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/models/ModelsRuntime.tsx+++ b/invokeai/frontend/webv2/src/workbench/models/useInstallOutcomeToasts.ts@@ -1,29 +1,18 @@-import { refreshInstalls, useInstallOutcomes } from '@workbench/models/installsStore';-import { refreshModels } from '@workbench/models/modelsStore';import { useNotify } from '@workbench/useNotify';-import { useWorkbenchSelector } from '@workbench/WorkbenchContext';import { useEffect, useRef } from 'react';+import { useInstallOutcomes } from './installsStore';+/**- * Renders nothing. Keeps the model stores honest across the app lifecycle:- * refreshes them when the backend (re)connects, and turns install outcomes- * (completed/failed/cancelled) into notifications even when no model manager- * surface is mounted — a download that finishes 20 minutes later still toasts.+ * Turns settled install outcomes (completed/failed/cancelled) into notifications,+ * while the model manager is mounted. Provider-free: `useNotify` falls back to+ * global toasts off-workbench. Mounted by `ModelInstallRuntime`.*/-export const ModelsRuntime = () => {+export const useInstallOutcomeToasts = (): void => {const notify = useNotify();- const connectionStatus = useWorkbenchSelector((snapshot) => snapshot.state.backendConnection.status);const outcomes = useInstallOutcomes();const seenOutcomeIdsRef = useRef<Set<number> | null>(null);- useEffect(() => {- if (connectionStatus === 'connected') {- // Reconnects can miss socket events: re-sync both stores.- void refreshModels();- void refreshInstalls();- }- }, [connectionStatus]);-useEffect(() => {if (seenOutcomeIdsRef.current === null) {seenOutcomeIdsRef.current = new Set(outcomes.map((outcome) => outcome.id));@@ -47,6 +36,4 @@ export const ModelsRuntime = () => {}}}, [notify, outcomes]);-- return null;};diff --git a/invokeai/frontend/webv2/src/workbench/projects/components/OpenProjectDialog.tsx b/invokeai/frontend/webv2/src/workbench/projects/components/OpenProjectDialog.tsxindex cd379b8a0f..130c541b3a 100644--- a/invokeai/frontend/webv2/src/workbench/projects/components/OpenProjectDialog.tsx+++ b/invokeai/frontend/webv2/src/workbench/projects/components/OpenProjectDialog.tsx@@ -1,6 +1,6 @@import { Dialog, Icon, Portal, Spinner, Stack, Text } from '@chakra-ui/react';import { Button, CloseButton, Row, Scrollable } from '@workbench/components/ui';-import { formatRelativeTime } from '@workbench/home/formatRelativeTime';+import { formatRelativeTime } from '@workbench/launchpad/formatRelativeTime';import { refreshProjectLibrary, useProjectLibrary, type ProjectSummary } from '@workbench/projects/library';import { importProjectFile, pickProjectFile } from '@workbench/projects/projectFile';import { adoptProjectRecord, hydrateProjectFromServer } from '@workbench/projects/syncedPersistence';diff --git a/invokeai/frontend/webv2/src/workbench/settings/SettingsDialog.tsx b/invokeai/frontend/webv2/src/workbench/settings/SettingsDialog.tsxindex 98def419b8..cbd591a15a 100644--- a/invokeai/frontend/webv2/src/workbench/settings/SettingsDialog.tsx+++ b/invokeai/frontend/webv2/src/workbench/settings/SettingsDialog.tsx@@ -14,7 +14,6 @@ import {chakra,Checkbox,Dialog,- Field,Flex,HStack,Icon,@@ -23,13 +22,13 @@ import {SimpleGrid,Stack,Switch,- Tabs,Text,+ Field,useSlotRecipe,} from '@chakra-ui/react';import { themeCardRecipe } from '@theme/recipes';import { previewSwatches, THEMES, type ThemeDefinition } from '@theme/system';-import { Button, CloseButton, IconButton, ConfirmDialog } from '@workbench/components/ui';+import { Button, CloseButton, IconButton, ConfirmDialog, Tabs, Tooltip } from '@workbench/components/ui';import { syncedWorkbenchPersistence } from '@workbench/projects/syncedPersistence';import {useOptionalWorkbenchDispatch,@@ -89,16 +88,11 @@ export const SettingsButton = () => {return (<>- <IconButton- aria-label="Settings"- color="fg.muted"- size="sm"- variant="ghost"- _hover={{ color: 'fg' }}- onClick={() => openWorkbenchSettings()}- >- <SettingsIcon />- </IconButton>+ <Tooltip content="Settings">+ <IconButton aria-label="Settings" size="sm" variant="ghost" onClick={() => openWorkbenchSettings()}>+ <SettingsIcon />+ </IconButton>+ </Tooltip><SettingsDialog isOpen={isOpen} onClose={closeWorkbenchSettings} /></>);@@ -131,27 +125,30 @@ const SettingsDialogContent = () => {<Dialog.Positioner><Dialog.Content h="min(46rem, calc(100dvh - 4rem))" maxW="4xl"><Dialog.Header borderBottomWidth="1px" borderColor="border.subtle">- <Stack gap="0.5">- <Dialog.Title fontSize="md" fontWeight="700">- Settings- </Dialog.Title>- <Text color="fg.subtle" fontSize="xs">- {scope === 'user'- ? 'Preferences for the signed-in user. Project settings apply only to the active project.'- : 'Global preferences for this single-user install. Project settings apply only to the active project.'}- </Text>- {status === 'error' && error ? (- <Text color="fg.error" fontSize="2xs">- {error}+ <Flex alignItems="start" gap="2">+ <Icon as={SettingsIcon} boxSize="5" />+ <Stack gap="1">+ <Dialog.Title fontSize="md" fontWeight="700" mt="0.5" lineHeight={1}>+ Settings+ </Dialog.Title>+ <Text color="fg.subtle" fontSize="xs">+ {scope === 'user'+ ? 'Preferences for the signed-in user. Project settings apply only to the active project.'+ : 'Global preferences for this single-user install. Project settings apply only to the active project.'}</Text>- ) : null}- </Stack>+ {status === 'error' && error ? (+ <Text color="fg.error" fontSize="2xs">+ {error}+ </Text>+ ) : null}+ </Stack>+ </Flex></Dialog.Header><Dialog.Body minH="0" p="0"><SettingsTabs /></Dialog.Body><Dialog.CloseTrigger asChild>- <CloseButton color="fg.muted" size="sm" />+ <CloseButton size="sm" /></Dialog.CloseTrigger></Dialog.Content></Dialog.Positioner>@@ -161,7 +158,7 @@ const SettingsDialogContent = () => {const SettingsTabs = () => {const hasWorkbench = useOptionalWorkbenchStore() !== null;- const allTabs: SettingsTabDefinition[] = [+ const SETTINGS_TABS: SettingsTabDefinition[] = [{children: <AppearanceSection />,icon: PaletteIcon,@@ -200,7 +197,7 @@ const SettingsTabs = () => {value: 'workspace',},];- const tabs = allTabs.filter((tab) => tab.condition !== false);+ const tabs = SETTINGS_TABS.filter((tab) => tab.condition !== false);const { sectionId } = settingsDialogStore.useSnapshot();const activeSectionId = tabs.some((tab) => tab.value === sectionId) ? sectionId : 'appearance';@@ -220,7 +217,6 @@ const SettingsTabs = () => {borderColor="border.subtle"borderRightWidth="1px"flexShrink={0}- gap="1"p="2"w={{ base: '40', md: '52' }}>@@ -240,20 +236,7 @@ const SettingsTabs = () => {};const SettingsTabTrigger = ({ icon, label, value }: { icon: LucideIcon; label: string; value: string }) => (- <Tabs.Trigger- color="fg.muted"- fontSize="xs"- fontWeight="600"- gap="2"- justifyContent="flex-start"- px="3"- py="2"- rounded="md"- textAlign="start"- value={value}- w="full"- _selected={{ bg: 'bg.muted', color: 'fg' }}- >+ <Tabs.Trigger justifyContent="flex-start" textAlign="start" value={value} w="full"><Icon as={icon} boxSize="3.5" flexShrink={0} /><Text truncate>{label}</Text></Tabs.Trigger>diff --git a/invokeai/frontend/webv2/src/workbench/shell/topbar/ModelManagerButton.tsx b/invokeai/frontend/webv2/src/workbench/shell/topbar/ModelManagerButton.tsxnew file mode 100644index 0000000000..e1acdc1ca3--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/shell/topbar/ModelManagerButton.tsx@@ -0,0 +1,13 @@+import { Link } from '@tanstack/react-router';+import { IconButton, Tooltip } from '@workbench/components/ui';+import { BoxIcon } from 'lucide-react';++export const ModelManagerButton = () => (+ <Tooltip content="Model Manager" showArrow>+ <IconButton aria-label="Model Manager" asChild size="sm" variant="ghost">+ <Link to="/models">+ <BoxIcon />+ </Link>+ </IconButton>+ </Tooltip>+);diff --git a/invokeai/frontend/webv2/src/workbench/shell/topbar/NodeManagerButton.tsx b/invokeai/frontend/webv2/src/workbench/shell/topbar/NodeManagerButton.tsxnew file mode 100644index 0000000000..2896a39001--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/shell/topbar/NodeManagerButton.tsx@@ -0,0 +1,14 @@+import { Icon } from '@chakra-ui/react';+import { Link } from '@tanstack/react-router';+import { IconButton, Tooltip } from '@workbench/components/ui';+import { BlocksIcon } from 'lucide-react';++export const NodesManagerButton = () => (+ <Tooltip content="Nodes Manager" showArrow>+ <IconButton aria-label="Nodes Manager" asChild size="sm" variant="ghost">+ <Link to="/nodes">+ <Icon as={BlocksIcon} />+ </Link>+ </IconButton>+ </Tooltip>+);diff --git a/invokeai/frontend/webv2/src/workbench/shell/topbar/TopBar.tsx b/invokeai/frontend/webv2/src/workbench/shell/topbar/TopBar.tsxindex 2111651dbe..de810bb157 100644--- a/invokeai/frontend/webv2/src/workbench/shell/topbar/TopBar.tsx+++ b/invokeai/frontend/webv2/src/workbench/shell/topbar/TopBar.tsx@@ -1,40 +1,54 @@-import { Box, Flex, Separator } from '@chakra-ui/react';+import { Box, Flex, HStack, Separator } from '@chakra-ui/react';+import { useCapabilities } from '@workbench/auth/capabilities';import { AccountMenu } from '@workbench/auth/components/AccountMenu';import { ProjectTabs } from '@workbench/projects/components';+import { SettingsButton } from '@/workbench/settings';+import { BatchCountField } from './BatchCountField';import { BrandMark } from './BrandMark';import { InvokeControl } from './InvokeControl';import { LayoutPresetMenu } from './LayoutPresetMenu';+import { ModelManagerButton } from './ModelManagerButton';+import { NodesManagerButton } from './NodeManagerButton';import { QueueActions } from './QueueActions';import { QueueInfo } from './QueueInfo';/** Workbench top bar: brand, global Invoke command cluster, project tabs, layout + account controls. */-export const TopBar = () => (- <Flex- align="center"- as="header"- bg="bg.subtle"- borderBottomWidth="1px"- borderColor="border.subtle"- flexShrink={0}- gap="2"- h="12"- ps="0.5"- pe="1.5"- w="full"- >- <Box h="12" w="12">- <BrandMark />- </Box>- <Separator orientation="vertical" h={5} ms="-2" />- <InvokeControl />- <BatchCountField />- <QueueInfo />- <QueueActions />- <Separator orientation="vertical" h={5} />- <ProjectTabs />- <LayoutPresetMenu />- <AccountMenu />- </Flex>-);+export const TopBar = () => {+ const { canManageModels, canManageNodes } = useCapabilities();++ return (+ <Flex+ align="center"+ as="header"+ bg="bg.subtle"+ borderBottomWidth="1px"+ borderColor="border.subtle"+ flexShrink={0}+ gap="2"+ h="12"+ ps="0.5"+ pe="1.5"+ w="full"+ >+ <Box h="12" w="12">+ <BrandMark />+ </Box>+ <Separator orientation="vertical" h={5} ms="-2" />+ <InvokeControl />+ <BatchCountField />+ <QueueInfo />+ <QueueActions />+ <Separator orientation="vertical" h={5} />+ <ProjectTabs />+ <LayoutPresetMenu />+ <HStack gap="0.5">+ {canManageNodes ? <NodesManagerButton /> : null}+ {canManageModels ? <ModelManagerButton /> : null}+ <SettingsButton />+ </HStack>+ <AccountMenu />+ </Flex>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/types.ts b/invokeai/frontend/webv2/src/workbench/types.tsindex 28aab4e921..4318f7a575 100644--- a/invokeai/frontend/webv2/src/workbench/types.ts+++ b/invokeai/frontend/webv2/src/workbench/types.ts@@ -2,9 +2,9 @@ import type { ComponentType, ExoticComponent, JSXElementConstructor, SVGProps }import type { ProjectGraphState } from './workflows/types';-export type LayoutPresetId = 'canvas-default' | 'gallery' | 'workflow' | 'linear' | 'model-manager';+export type LayoutPresetId = 'canvas-default' | 'gallery' | 'workflow' | 'linear';-export type CenterViewId = 'canvas' | 'gallery' | 'preview' | 'workflow' | 'models';+export type CenterViewId = 'canvas' | 'gallery' | 'preview' | 'workflow';export type GraphId = string;@@ -17,7 +17,6 @@ export type FirstPartyWidgetTypeId =| 'history-controls'| 'layout-actions'| 'layers'- | 'models'| 'notifications'| 'preview'| 'project'diff --git a/invokeai/frontend/webv2/src/workbench/widgetRegistry.test.ts b/invokeai/frontend/webv2/src/workbench/widgetRegistry.test.tsindex fa6de53f12..1971db5dfe 100644--- a/invokeai/frontend/webv2/src/workbench/widgetRegistry.test.ts+++ b/invokeai/frontend/webv2/src/workbench/widgetRegistry.test.ts@@ -24,7 +24,7 @@ describe('widget registry', () => {it('registers first-party widget manifests without icon validation failures', () => {const widgets = registerFirstPartyWidgets();- expect(widgets).toHaveLength(15);+ expect(widgets).toHaveLength(14);expect(widgets.flatMap((widget) => widget.failure ?? [])).toEqual([]);expect(widgets.every((widget) => widget.status === 'enabled')).toBe(true);});diff --git a/invokeai/frontend/webv2/src/workbench/widgetRegistry.ts b/invokeai/frontend/webv2/src/workbench/widgetRegistry.tsindex 6357f918e4..dc9224467d 100644--- a/invokeai/frontend/webv2/src/workbench/widgetRegistry.ts+++ b/invokeai/frontend/webv2/src/workbench/widgetRegistry.ts@@ -15,7 +15,6 @@ import { galleryWidgetManifest } from './widgets/gallery';import { generateWidgetManifest } from './widgets/generate';import { layersWidgetManifest } from './widgets/layers';import { layoutActionsWidgetManifest } from './widgets/layout-actions';-import { modelsWidgetManifest } from './widgets/models';import { notificationsWidgetManifest } from './widgets/notifications';import { previewWidgetManifest } from './widgets/preview';import { projectWidgetManifest } from './widgets/project';@@ -33,7 +32,6 @@ export const firstPartyWidgetManifests: WidgetManifest[] = [previewWidgetManifest,projectWidgetManifest,layersWidgetManifest,- modelsWidgetManifest,queueWidgetManifest,notificationsWidgetManifest,serverStatusWidgetManifest,diff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/AddModelsView.tsx b/invokeai/frontend/webv2/src/workbench/widgets/models/AddModelsView.tsxdeleted file mode 100644index 17a57d93c0..0000000000--- a/invokeai/frontend/webv2/src/workbench/widgets/models/AddModelsView.tsx+++ /dev/null@@ -1,65 +0,0 @@-import { Box, Icon, Stack } from '@chakra-ui/react';-import { Scrollable, Tabs } from '@workbench/components/ui';-import { updateModelsUi, useModelsUi, type AddModelsTab } from '@workbench/models/uiStore';-import { FolderSearchIcon, KeyIcon, LinkIcon, StarIcon } from 'lucide-react';-import { SiHuggingface } from 'react-icons/si';--import { ApiKeysSection } from './ApiKeysSection';-import { HuggingFaceTab } from './HuggingFaceTab';-import { ScanFolderTab } from './ScanFolderTab';-import { StarterModelsTab } from './StarterModelsTab';-import { UrlInstallTab } from './UrlInstallTab';--/**- * Every way to acquire a model, one tab per source kind, plus credentials.- * The active tab lives in the models UI store so it survives navigation.- */-export const AddModelsView = () => {- const { addTab } = useModelsUi();-- return (- <Stack gap="3" h="full" minH="0">- <Tabs.Root- size="sm"- value={addTab}- onValueChange={(event) => updateModelsUi({ addTab: event.value as AddModelsTab })}- >- <Tabs.List>- <Tabs.Trigger fontSize="xs" value="starter">- <Icon as={StarIcon} boxSize="3" />- Starter Models- </Tabs.Trigger>- <Tabs.Trigger fontSize="xs" value="url">- <Icon as={LinkIcon} boxSize="3" />- URL / Local Path- </Tabs.Trigger>- <Tabs.Trigger fontSize="xs" value="huggingface">- <Icon as={SiHuggingface} boxSize="3" />- HuggingFace- </Tabs.Trigger>- <Tabs.Trigger fontSize="xs" value="scan">- <Icon as={FolderSearchIcon} boxSize="3" />- Scan Folder- </Tabs.Trigger>- <Tabs.Trigger fontSize="xs" value="keys">- <Icon as={KeyIcon} boxSize="3" />- API Keys- </Tabs.Trigger>- </Tabs.List>- </Tabs.Root>- {addTab === 'starter' ? (- // Two-column layout (bundle sidebar + list) with its own scrolling.- <Box flex="1" minH="0">- <StarterModelsTab />- </Box>- ) : (- <Scrollable flex="1" label="Add models" minH="0" pr="1">- {addTab === 'url' ? <UrlInstallTab /> : null}- {addTab === 'huggingface' ? <HuggingFaceTab /> : null}- {addTab === 'scan' ? <ScanFolderTab /> : null}- {addTab === 'keys' ? <ApiKeysSection /> : null}- </Scrollable>- )}- </Stack>- );-};diff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/HuggingFaceTab.tsx b/invokeai/frontend/webv2/src/workbench/widgets/models/HuggingFaceTab.tsxdeleted file mode 100644index 909f59147e..0000000000--- a/invokeai/frontend/webv2/src/workbench/widgets/models/HuggingFaceTab.tsx+++ /dev/null@@ -1,118 +0,0 @@-import { HStack, Icon, Input, Stack, Text } from '@chakra-ui/react';-import { Button, Field } from '@workbench/components/ui';-import { getHuggingFaceModels } from '@workbench/models/api';-import { huggingFaceRepoSchema } from '@workbench/models/schemas';-import { updateModelsUi, useModelsUi } from '@workbench/models/uiStore';-import { useZodForm } from '@workbench/models/useZodForm';-import { DownloadIcon, KeyRoundIcon } from 'lucide-react';--import { InstallSourceButton, SourceListItem } from './SourceListItem';-import { useInstallActions } from './useInstallActions';--/**- * HuggingFace installs: diffusers repos install immediately; checkpoint repos- * list their files (kept across tab switches) so the right one can be picked.- */-export const HuggingFaceTab = () => {- const { install, pendingSources } = useInstallActions();- const { hfLookup } = useModelsUi();- const form = useZodForm(huggingFaceRepoSchema, { repo: hfLookup?.repo ?? '' });-- const handleInstall = () =>- form.handleSubmit(async ({ repo }) => {- const lookup = await getHuggingFaceModels(repo);-- if (lookup.is_diffusers) {- // A diffusers repo installs as one unit -- no file picking needed.- updateModelsUi({ hfLookup: null });-- const ok = await install({ source: repo });-- if (ok) {- form.reset();- }-- return;- }-- if (!lookup.urls || lookup.urls.length === 0) {- throw new Error('No installable model files were found in this repo.');- }-- updateModelsUi({ hfLookup: { repo, urls: lookup.urls } });- });-- return (- <Stack gap="4" maxW="40rem">- <Field- error={form.errors.repo ?? form.formError}- helpText="Diffusers repos install immediately; checkpoint repos list their files below to choose from."- label="HuggingFace Repo"- >- <HStack gap="1.5">- <Input- aria-invalid={form.errors.repo ? true : undefined}- placeholder="owner/repo, e.g. black-forest-labs/FLUX.1-dev"- size="sm"- value={form.values.repo}- onChange={(event) => form.setValue('repo', event.currentTarget.value)}- onKeyDown={(event) => {- if (event.key === 'Enter') {- event.preventDefault();- void handleInstall();- }- }}- />- <Button- disabled={form.values.repo.trim().length === 0}- loading={form.isSubmitting}- size="sm"- variant="solid"- onClick={() => void handleInstall()}- >- <Icon as={DownloadIcon} boxSize="3.5" />- Install- </Button>- </HStack>- </Field>-- {hfLookup ? (- <Stack gap="1.5">- <Text color="fg.muted" fontSize="2xs">- {hfLookup.urls.length} file{hfLookup.urls.length === 1 ? '' : 's'} in {hfLookup.repo}:- </Text>- {hfLookup.urls.map((url) => {- const fileName = url.split('/').at(-1) ?? url;-- return (- <SourceListItem- key={url}- title={fileName}- titleTooltip={url}- trailing={- <InstallSourceButton- isPending={pendingSources.has(url)}- source={url}- onInstall={() => {- void install({ source: url });- }}- />- }- />- );- })}- </Stack>- ) : null}-- <HStack gap="1.5">- <Icon as={KeyRoundIcon} boxSize="3.5" color="fg.subtle" />- <Text color="fg.subtle" fontSize="2xs">- Gated repos (like FLUX) need a HuggingFace token.- </Text>- <Button size="2xs" variant="ghost" onClick={() => updateModelsUi({ addTab: 'keys' })}>- Manage API keys →- </Button>- </HStack>- </Stack>- );-};diff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/InstallQueueSection.tsx b/invokeai/frontend/webv2/src/workbench/widgets/models/InstallQueueSection.tsxdeleted file mode 100644index 857b0aee50..0000000000--- a/invokeai/frontend/webv2/src/workbench/widgets/models/InstallQueueSection.tsx+++ /dev/null@@ -1,268 +0,0 @@-import type { ModelInstallJob, ModelInstallStatus } from '@workbench/models/types';--import { Badge, Box, Flex, HStack, Icon, Progress, Spinner, Stack, Text } from '@chakra-ui/react';-import { Button, IconButton, Scrollable, Tooltip } from '@workbench/components/ui';-import {- cancelModelInstall,- pauseModelInstall,- pruneCompletedModelInstalls,- restartFailedModelInstall,- resumeModelInstall,-} from '@workbench/models/api';-import {- ensureInstallsLoaded,- isActiveInstallStatus,- refreshInstalls,- replaceInstallJob,- useInstallProgress,- useInstallsSnapshot,-} from '@workbench/models/installsStore';-import { formatBytes, getInstallSourceLabel } from '@workbench/models/taxonomy';-import { useNotify } from '@workbench/useNotify';-import { PauseIcon, PlayIcon, RotateCcwIcon, Trash2Icon, XIcon } from 'lucide-react';-import { useEffect, useState } from 'react';--const STATUS_BADGES: Record<ModelInstallStatus, { label: string; palette: string }> = {- cancelled: { label: 'Cancelled', palette: 'gray' },- completed: { label: 'Installed', palette: 'green' },- downloading: { label: 'Downloading', palette: 'blue' },- downloads_done: { label: 'Downloaded', palette: 'blue' },- error: { label: 'Failed', palette: 'red' },- paused: { label: 'Paused', palette: 'orange' },- running: { label: 'Installing', palette: 'blue' },- waiting: { label: 'Waiting', palette: 'gray' },-};--/**- * The model install/download queue: live rows for every install job with- * pause/resume/cancel/retry per job and pruning of settled jobs. Download- * progress streams in over the socket and bypasses the job list re-render.- */-export const InstallQueueSection = () => {- const notify = useNotify();- const { error, jobs, status } = useInstallsSnapshot();- const [isPruning, setIsPruning] = useState(false);-- useEffect(() => {- ensureInstallsLoaded();- }, []);-- const settledCount = jobs.filter((job) => !isActiveInstallStatus(job.status) && job.status !== 'paused').length;-- const handlePrune = async () => {- setIsPruning(true);-- try {- await pruneCompletedModelInstalls();- await refreshInstalls();- } catch (pruneError) {- notify.error('Prune failed', pruneError instanceof Error ? pruneError.message : String(pruneError));- } finally {- setIsPruning(false);- }- };-- if (status === 'loading' || status === 'idle') {- return (- <Flex align="center" justify="center" py="6">- <Spinner color="fg.subtle" size="sm" />- </Flex>- );- }-- if (status === 'error') {- return (- <Stack align="center" gap="1" py="6">- <Text color="fg.error" fontSize="xs" fontWeight="600">- Could not load the install queue- </Text>- <Text color="fg.subtle" fontSize="2xs">- {error}- </Text>- <Button mt="1" size="xs" variant="outline" onClick={() => void refreshInstalls()}>- Retry- </Button>- </Stack>- );- }-- if (jobs.length === 0) {- return (- <Stack align="center" gap="1" py="6">- <Text color="fg.muted" fontSize="xs" fontWeight="600">- No installs yet- </Text>- <Text color="fg.subtle" fontSize="2xs">- Models you install will download here.- </Text>- </Stack>- );- }-- return (- <Stack gap="2" h="full" minH="0">- <HStack justify="space-between">- <Text color="fg.subtle" fontSize="2xs">- {jobs.length} job{jobs.length === 1 ? '' : 's'}- </Text>- <Button- disabled={settledCount === 0}- loading={isPruning}- size="2xs"- variant="ghost"- onClick={() => void handlePrune()}- >- <Icon as={Trash2Icon} boxSize="3" />- Clear finished- </Button>- </HStack>- <Scrollable flex="1" label="Install jobs" minH="0">- <Stack gap="1.5">- {jobs.map((job) => (- <InstallJobRow key={job.id} job={job} onError={notify.error} />- ))}- </Stack>- </Scrollable>- </Stack>- );-};--const InstallJobRow = ({- job,- onError,-}: {- job: ModelInstallJob;- onError: (title: string, message: string) => void;-}) => {- const [isActing, setIsActing] = useState(false);- const badge = STATUS_BADGES[job.status] ?? { label: job.status, palette: 'gray' };- const sourceLabel = getInstallSourceLabel(job.source);- const displayName = job.config_out?.name ?? sourceLabel;-- const runAction = async (action: () => Promise<unknown>, failureTitle: string) => {- setIsActing(true);-- try {- const result = await action();-- if (result && typeof result === 'object' && 'id' in (result as ModelInstallJob)) {- replaceInstallJob(result as ModelInstallJob);- } else {- await refreshInstalls();- }- } catch (actionError) {- onError(failureTitle, actionError instanceof Error ? actionError.message : String(actionError));- } finally {- setIsActing(false);- }- };-- return (- <Stack- bg="bg.subtle"- borderColor={job.status === 'error' ? 'border.error' : 'border.subtle'}- borderWidth="1px"- gap="1.5"- p="2"- rounded="md"- >- <HStack gap="2" justify="space-between">- <Text flex="1" fontSize="2xs" fontWeight="600" minW="0" truncate title={sourceLabel}>- {displayName}- </Text>- <Badge colorPalette={badge.palette} flexShrink={0} fontSize="2xs" size="sm" variant="surface">- {badge.label}- </Badge>- <HStack flexShrink={0} gap="0.5">- {job.status === 'downloading' ? (- <Tooltip content="Pause download">- <IconButton- aria-label="Pause install"- disabled={isActing}- size="2xs"- variant="ghost"- onClick={() => void runAction(() => pauseModelInstall(job.id), 'Pause failed')}- >- <Icon as={PauseIcon} boxSize="3" />- </IconButton>- </Tooltip>- ) : null}- {job.status === 'paused' ? (- <Tooltip content="Resume download">- <IconButton- aria-label="Resume install"- disabled={isActing}- size="2xs"- variant="ghost"- onClick={() => void runAction(() => resumeModelInstall(job.id), 'Resume failed')}- >- <Icon as={PlayIcon} boxSize="3" />- </IconButton>- </Tooltip>- ) : null}- {job.status === 'error' ? (- <Tooltip content="Retry failed download">- <IconButton- aria-label="Retry install"- disabled={isActing}- size="2xs"- variant="ghost"- onClick={() => void runAction(() => restartFailedModelInstall(job.id), 'Retry failed')}- >- <Icon as={RotateCcwIcon} boxSize="3" />- </IconButton>- </Tooltip>- ) : null}- {isActiveInstallStatus(job.status) || job.status === 'paused' ? (- <Tooltip content="Cancel install">- <IconButton- aria-label="Cancel install"- disabled={isActing}- size="2xs"- variant="ghost"- onClick={() => void runAction(() => cancelModelInstall(job.id), 'Cancel failed')}- >- <Icon as={XIcon} boxSize="3" />- </IconButton>- </Tooltip>- ) : null}- </HStack>- </HStack>- {displayName !== sourceLabel ? (- <Text color="fg.subtle" fontSize="2xs" truncate>- {sourceLabel}- </Text>- ) : null}- {job.status === 'downloading' || job.status === 'waiting' ? <InstallJobProgress job={job} /> : null}- {job.status === 'error' && job.error ? (- <Text color="fg.error" fontSize="2xs" overflowWrap="anywhere">- {job.error_reason ? `${job.error_reason}: ` : ''}- {job.error}- </Text>- ) : null}- </Stack>- );-};--const InstallJobProgress = ({ job }: { job: ModelInstallJob }) => {- const liveProgress = useInstallProgress(job.id);- const bytes = liveProgress?.bytes ?? job.bytes ?? 0;- const totalBytes = liveProgress?.totalBytes ?? job.total_bytes ?? 0;- const hasTotal = totalBytes > 0;- const ratio = hasTotal ? Math.min(1, bytes / totalBytes) : null;-- return (- <Box>- <Progress.Root aria-label="Download progress" max={1} size="xs" value={ratio}>- <Progress.Track>- <Progress.Range />- </Progress.Track>- </Progress.Root>- <Text color="fg.subtle" fontSize="2xs" mt="1">- {hasTotal- ? `${Math.round((ratio ?? 0) * 100)}% · ${formatBytes(bytes)} / ${formatBytes(totalBytes)}`- : 'Waiting for download to start…'}- </Text>- </Box>- );-};diff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/ModelFilterBar.tsx b/invokeai/frontend/webv2/src/workbench/widgets/models/ModelFilterBar.tsxdeleted file mode 100644index dc8f9a9369..0000000000--- a/invokeai/frontend/webv2/src/workbench/widgets/models/ModelFilterBar.tsx+++ /dev/null@@ -1,171 +0,0 @@-import type { ModelLibraryFilters, ModelSortField } from '@workbench/models/library';-import type { ModelTaxonomyType } from '@workbench/models/types';--import { HStack, Icon, Input, InputGroup, Menu, Portal, Text } from '@chakra-ui/react';-import { IconButton, MenuContent } from '@workbench/components/ui';-import { getModelBaseLabel } from '@workbench/models/baseIdentity';-import { getModelTypeLabel } from '@workbench/models/taxonomy';-import { CheckIcon, SearchIcon, SlidersHorizontalIcon } from 'lucide-react';--const SORT_FIELDS: { field: ModelSortField; label: string }[] = [- { field: 'default', label: 'Default' },- { field: 'name', label: 'Name' },- { field: 'base', label: 'Base' },- { field: 'size', label: 'Size' },- { field: 'format', label: 'Format' },-];--const isFiltering = (filters: ModelLibraryFilters): boolean =>- filters.typeFilter !== null || filters.baseFilter !== null || filters.missingOnly;--/**- * Search box plus a combined filter/sort menu. The menu reflects only values- * present in the current library so it never offers dead filters.- */-export const ModelFilterBar = ({- availableBases,- availableTypes,- filters,- missingCount,- onChange,-}: {- availableBases: string[];- availableTypes: ModelTaxonomyType[];- filters: ModelLibraryFilters;- missingCount: number;- onChange: (filters: ModelLibraryFilters) => void;-}) => (- <HStack gap="1.5" w="full">- <InputGroup startElement={<Icon as={SearchIcon} boxSize="3.5" color="fg.subtle" />}>- <Input- aria-label="Search models"- placeholder="Search models…"- size="sm"- value={filters.searchTerm}- onChange={(event) => onChange({ ...filters, searchTerm: event.currentTarget.value })}- />- </InputGroup>- <Menu.Root closeOnSelect={false} positioning={{ placement: 'bottom-end' }}>- <Menu.Trigger asChild>- <IconButton- aria-label="Filter and sort models"- color={isFiltering(filters) ? 'accent.solid' : 'fg.muted'}- size="sm"- variant="ghost"- >- <Icon as={SlidersHorizontalIcon} boxSize="4" />- </IconButton>- </Menu.Trigger>- <Portal>- <Menu.Positioner>- <MenuContent maxH="70vh" minW="13rem" overflowY="auto" py="1">- <Menu.ItemGroup>- <Menu.ItemGroupLabel color="fg.subtle" fontSize="2xs" textTransform="uppercase">- Model Type- </Menu.ItemGroupLabel>- <FilterMenuItem- isChecked={filters.typeFilter === null && !filters.missingOnly}- label="All models"- value="type-all"- onSelect={() => onChange({ ...filters, missingOnly: false, typeFilter: null })}- />- {missingCount > 0 ? (- <FilterMenuItem- isChecked={filters.missingOnly}- label={`Missing files (${missingCount})`}- value="type-missing"- onSelect={() => onChange({ ...filters, missingOnly: !filters.missingOnly, typeFilter: null })}- />- ) : null}- {availableTypes.map((type) => (- <FilterMenuItem- key={type}- isChecked={filters.typeFilter === type}- label={getModelTypeLabel(type)}- value={`type-${type}`}- onSelect={() =>- onChange({- ...filters,- missingOnly: false,- typeFilter: filters.typeFilter === type ? null : type,- })- }- />- ))}- </Menu.ItemGroup>- <Menu.Separator />- <Menu.ItemGroup>- <Menu.ItemGroupLabel color="fg.subtle" fontSize="2xs" textTransform="uppercase">- Base Architecture- </Menu.ItemGroupLabel>- <FilterMenuItem- isChecked={filters.baseFilter === null}- label="All bases"- value="base-all"- onSelect={() => onChange({ ...filters, baseFilter: null })}- />- {availableBases.map((base) => (- <FilterMenuItem- key={base}- isChecked={filters.baseFilter === base}- label={getModelBaseLabel(base)}- value={`base-${base}`}- onSelect={() => onChange({ ...filters, baseFilter: filters.baseFilter === base ? null : base })}- />- ))}- </Menu.ItemGroup>- <Menu.Separator />- <Menu.ItemGroup>- <Menu.ItemGroupLabel color="fg.subtle" fontSize="2xs" textTransform="uppercase">- Sort By- </Menu.ItemGroupLabel>- {SORT_FIELDS.map(({ field, label }) => (- <FilterMenuItem- key={field}- isChecked={filters.sortField === field}- label={label}- value={`sort-${field}`}- onSelect={() =>- onChange(- filters.sortField === field- ? { ...filters, sortDirection: filters.sortDirection === 'asc' ? 'desc' : 'asc' }- : { ...filters, sortDirection: 'asc', sortField: field }- )- }- trailing={- filters.sortField === field ? (filters.sortDirection === 'asc' ? 'Asc' : 'Desc') : undefined- }- />- ))}- </Menu.ItemGroup>- </MenuContent>- </Menu.Positioner>- </Portal>- </Menu.Root>- </HStack>-);--/** Checkmark-style menu item shared by the model filter menus. */-export const FilterMenuItem = ({- isChecked,- label,- onSelect,- trailing,- value,-}: {- isChecked: boolean;- label: string;- onSelect: () => void;- trailing?: string;- value: string;-}) => (- <Menu.Item aria-checked={isChecked} closeOnSelect={false} role="menuitemcheckbox" value={value} onClick={onSelect}>- <Icon as={CheckIcon} boxSize="3" opacity={isChecked ? 1 : 0} />- <Menu.ItemText fontSize="xs">{label}</Menu.ItemText>- {trailing ? (- <Text color="fg.subtle" fontSize="2xs" ms="auto">- {trailing}- </Text>- ) : null}- </Menu.Item>-);diff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/ModelsCenterView.tsx b/invokeai/frontend/webv2/src/workbench/widgets/models/ModelsCenterView.tsxdeleted file mode 100644index 3053e217c0..0000000000--- a/invokeai/frontend/webv2/src/workbench/widgets/models/ModelsCenterView.tsx+++ /dev/null@@ -1,216 +0,0 @@-import { Badge, Box, Flex, HStack, Icon, Separator, Stack, Text } from '@chakra-ui/react';-import { Button, IconButton, ConfirmDialog, Scrollable, Tabs } from '@workbench/components/ui';-import { bulkDeleteModels } from '@workbench/models/api';-import { ensureInstallsLoaded, isActiveInstallStatus, useInstallsSnapshot } from '@workbench/models/installsStore';-import { collectBases, collectTypes } from '@workbench/models/library';-import {- ensureModelsLoaded,- refreshModels,- removeModelsFromStore,- useModelsSnapshot,-} from '@workbench/models/modelsStore';-import {- pruneModelsUiKeys,- toggleModelSelection,- updateModelsUi,- useModelsUi,- type ModelsCenterTab,-} from '@workbench/models/uiStore';-import { useNotify } from '@workbench/useNotify';-import { BoxIcon, LibraryIcon, ListOrderedIcon, PlusIcon, Trash2Icon, XIcon } from 'lucide-react';-import { useEffect, useMemo, useState } from 'react';--import { AddModelsView } from './AddModelsView';-import { InstallQueueSection } from './InstallQueueSection';-import { ModelDetail } from './ModelDetail';-import { ModelFilterBar } from './ModelFilterBar';-import { ModelLibraryList } from './ModelLibraryList';--/**- * Full model manager: Library (master-detail with bulk actions), Add Models- * (every install source), and the install Queue with a live activity badge.- * Tab choice, selection, and filters live in the models UI store so nothing- * resets when the user moves between tabs or away from the center view.- */-export const ModelsCenterView = () => {- const { centerTab } = useModelsUi();- const { jobs } = useInstallsSnapshot();- const activeInstallCount = jobs.filter((job) => isActiveInstallStatus(job.status)).length;-- useEffect(() => {- ensureModelsLoaded();- ensureInstallsLoaded();- }, []);-- return (- <Flex direction="column" gap="3" h="full" minH="0" w="full" px="3">- <Tabs.Root- size="sm"- value={centerTab}- onValueChange={(event) => updateModelsUi({ centerTab: event.value as ModelsCenterTab })}- >- <Tabs.List>- <Tabs.Trigger fontSize="xs" value="library">- <Icon as={LibraryIcon} boxSize="3" />- Library- </Tabs.Trigger>- <Tabs.Trigger fontSize="xs" value="add">- <Icon as={PlusIcon} boxSize="3" />- Add Models- </Tabs.Trigger>- <Tabs.Trigger fontSize="xs" value="queue">- <Icon as={ListOrderedIcon} boxSize="3" />- Queue- {activeInstallCount > 0 ? (- <Badge fontSize="2xs" ms="1" size="sm" variant="solid">- {activeInstallCount}- </Badge>- ) : null}- </Tabs.Trigger>- </Tabs.List>- </Tabs.Root>- <Box flex="1" minH="0">- {centerTab === 'library' ? <LibraryMasterDetail /> : null}- {centerTab === 'add' ? <AddModelsView /> : null}- {centerTab === 'queue' ? (- <Box h="full" maxW="48rem" minH="0">- <InstallQueueSection />- </Box>- ) : null}- </Box>- </Flex>- );-};--const LibraryMasterDetail = () => {- const notify = useNotify();- const { missingModelKeys, models } = useModelsSnapshot();- const { activeModelKey, filters, selectedKeys } = useModelsUi();- const [isBulkDeleteOpen, setIsBulkDeleteOpen] = useState(false);-- const availableTypes = useMemo(() => collectTypes(models), [models]);- const availableBases = useMemo(() => collectBases(models), [models]);-- const handleBulkDelete = async () => {- const keys = [...selectedKeys];-- try {- const result = await bulkDeleteModels(keys);-- removeModelsFromStore(result.deleted);- pruneModelsUiKeys(result.deleted);- updateModelsUi({ selectedKeys: new Set(result.failed.map((failure) => failure.key)) });-- if (result.failed.length > 0) {- notify.error(- 'Some models could not be deleted',- `${result.deleted.length} deleted; ${result.failed.length} failed: ${result.failed[0]?.error ?? ''}`- );- } else {- notify.success(- 'Models deleted',- `${result.deleted.length} model${result.deleted.length === 1 ? '' : 's'} deleted.`- );- }- } catch (error) {- notify.error('Bulk delete failed', error instanceof Error ? error.message : String(error));- void refreshModels();- }- };-- return (- <Flex h="full" minH="0" w="full" gap="2">- <Stack flexShrink={0} gap="2" h="full" minH="0" position="relative" w="22rem">- <ModelFilterBar- availableBases={availableBases}- availableTypes={availableTypes}- filters={filters}- missingCount={missingModelKeys.size}- onChange={(nextFilters) => updateModelsUi({ filters: nextFilters })}- />- <ModelLibraryList- activeModelKey={activeModelKey}- filters={filters}- instanceId="center"- selectedKeys={selectedKeys}- onActivate={(model) => updateModelsUi({ activeModelKey: model.key })}- onToggleSelected={(model) => toggleModelSelection(model.key)}- />- {/* ActionBar-styled, but plain markup: dialog-based action bars- dismiss on outside interaction, which would clear the selection on- every additional click. Floats over the list, never shifts it. */}- {selectedKeys.size > 0 ? (- <HStack- bg="bg.muted"- borderColor="border.emphasized"- borderWidth="1px"- bottom="2"- gap="2"- insetX="2"- p="1.5"- position="absolute"- rounded="lg"- shadow="lg"- zIndex={2}- >- <Text- borderColor="border.subtle"- borderStyle="dashed"- borderWidth="1px"- color="fg.muted"- fontSize="2xs"- fontWeight="600"- px="2"- py="1"- rounded="md"- >- {selectedKeys.size} selected- </Text>- <Separator borderColor="border.subtle" h="5" orientation="vertical" />- <Button colorPalette="red" size="2xs" variant="solid" onClick={() => setIsBulkDeleteOpen(true)}>- <Icon as={Trash2Icon} boxSize="3" />- Delete- </Button>- <Box flex="1" />- <IconButton- aria-label="Clear selection"- size="2xs"- variant="ghost"- onClick={() => updateModelsUi({ selectedKeys: new Set() })}- >- <Icon as={XIcon} boxSize="3" />- </IconButton>- </HStack>- ) : null}- </Stack>- <Scrollable flex="1" h="full" label="Model details" minH="0" minW="0" ps="4" pe="1" borderStartWidth={1}>- {activeModelKey !== null ? (- <ModelDetail- key={activeModelKey}- density="full"- modelKey={activeModelKey}- onDeleted={() => updateModelsUi({ activeModelKey: null })}- />- ) : (- <Flex align="center" direction="column" gap="2" h="full" justify="center">- <Icon as={BoxIcon} boxSize="8" color="fg.subtle" />- <Text color="fg.muted" fontSize="sm" fontWeight="600">- Select a model- </Text>- <Text color="fg.subtle" fontSize="xs" maxW="22rem" textAlign="center">- View details, edit metadata, set per-model defaults, and manage trigger phrases.- </Text>- </Flex>- )}- </Scrollable>- <ConfirmDialog- body={`Delete ${selectedKeys.size} selected model${selectedKeys.size === 1 ? '' : 's'}? Database records are removed, and files inside the InvokeAI models directory are deleted.`}- confirmLabel={`Delete ${selectedKeys.size} Model${selectedKeys.size === 1 ? '' : 's'}`}- isOpen={isBulkDeleteOpen}- title="Delete selected models"- onClose={() => setIsBulkDeleteOpen(false)}- onConfirm={handleBulkDelete}- />- </Flex>- );-};diff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/ModelsPanelView.tsx b/invokeai/frontend/webv2/src/workbench/widgets/models/ModelsPanelView.tsxdeleted file mode 100644index f5fb9a7228..0000000000--- a/invokeai/frontend/webv2/src/workbench/widgets/models/ModelsPanelView.tsx+++ /dev/null@@ -1,161 +0,0 @@-import type { WidgetId } from '@workbench/types';--import { Box, HStack, Icon, Progress, Stack, Text } from '@chakra-ui/react';-import { Button, Scrollable, Tooltip } from '@workbench/components/ui';-import {- ensureInstallsLoaded,- isActiveInstallStatus,- useInstallProgress,- useInstallsSnapshot,-} from '@workbench/models/installsStore';-import { collectBases, collectTypes } from '@workbench/models/library';-import { ensureModelsLoaded, useModelsSnapshot } from '@workbench/models/modelsStore';-import { openModelsCenterTab, updateModelsUi, useModelsUi } from '@workbench/models/uiStore';-import { useOpenWorkbenchWidget } from '@workbench/useOpenWorkbenchWidget';-import { DownloadIcon, PlusIcon } from 'lucide-react';-import { useEffect, useMemo } from 'react';--import { ModelDetail } from './ModelDetail';-import { ModelFilterBar } from './ModelFilterBar';-import { ModelLibraryList } from './ModelLibraryList';--/**- * Side-panel presentation: a searchable library browser with in-panel- * drill-in for quick edits. Installing and bulk work live in the full center- * view; the Add button jumps straight to its Add Models tab, the install- * footer to its Queue tab. Filters and the drilled-in model persist in the- * models UI store across panel/tab switches.- */-export const ModelsPanelView = ({ widgetId }: { widgetId: WidgetId }) => {- const { missingModelKeys, models } = useModelsSnapshot();- const { filters, panelModelKey } = useModelsUi();- const openWorkbenchWidget = useOpenWorkbenchWidget();-- useEffect(() => {- ensureModelsLoaded();- ensureInstallsLoaded();- }, []);-- const availableTypes = useMemo(() => collectTypes(models), [models]);- const availableBases = useMemo(() => collectBases(models), [models]);-- return (- <Box h="full" minH="0" position="relative">- {/* Drill-in renders as an overlay so the list below keeps its layout —- and therefore its scroll position — for the trip back. */}- {panelModelKey !== null ? (- <Scrollable bg="bg" inset="0" label="Model details" position="absolute" px="3" zIndex={2}>- <ModelDetail- key={panelModelKey}- density="panel"- modelKey={panelModelKey}- onBack={() => updateModelsUi({ panelModelKey: null })}- onDeleted={() => updateModelsUi({ panelModelKey: null })}- />- </Scrollable>- ) : null}- {/* The list stays mounted under the overlay (preserving layout and- scroll position) but is inert so it cannot scroll or take focus. */}- <Stack gap="2" h="full" inert={panelModelKey !== null} minH="0" px="2">- <HStack gap="1.5">- <Box flex="1" minW="0">- <ModelFilterBar- availableBases={availableBases}- availableTypes={availableTypes}- filters={filters}- missingCount={missingModelKeys.size}- onChange={(nextFilters) => updateModelsUi({ filters: nextFilters })}- />- </Box>- <Tooltip content="Add models">- <Button- aria-label="Add models"- flexShrink={0}- size="sm"- variant="solid"- onClick={() => {- openModelsCenterTab('add');- openWorkbenchWidget(widgetId, { preferredRegions: ['center'], requireCenterView: true });- }}- >- <Icon as={PlusIcon} boxSize="3.5" />- Add- </Button>- </Tooltip>- </HStack>- <ModelLibraryList- activeModelKey={null}- filters={filters}- instanceId="panel"- onActivate={(model) => updateModelsUi({ panelModelKey: model.key })}- />- <InstallSummaryFooter- onOpen={() => {- openModelsCenterTab('queue');- openWorkbenchWidget(widgetId, { preferredRegions: ['center'], requireCenterView: true });- }}- />- </Stack>- </Box>- );-};--/** Compact live footer: how many installs are running, with progress. */-const InstallSummaryFooter = ({ onOpen }: { onOpen: () => void }) => {- const { jobs } = useInstallsSnapshot();- const activeJobs = jobs.filter((job) => isActiveInstallStatus(job.status));- const errorCount = jobs.filter((job) => job.status === 'error').length;- const firstDownloading = activeJobs.find((job) => job.status === 'downloading');-- if (activeJobs.length === 0 && errorCount === 0) {- return null;- }-- return (- <Stack- as="button"- bg="bg.subtle"- borderColor="border.subtle"- borderWidth="1px"- cursor="pointer"- flexShrink={0}- gap="1"- p="2"- rounded="md"- textAlign="start"- w="full"- _hover={{ bg: 'bg.muted' }}- onClick={onOpen}- >- <HStack gap="1.5" justify="space-between">- <HStack gap="1.5" minW="0">- <Icon as={DownloadIcon} boxSize="3" color="fg.muted" />- <Text color="fg.muted" fontSize="2xs" fontWeight="600" truncate>- {activeJobs.length > 0- ? `${activeJobs.length} install${activeJobs.length === 1 ? '' : 's'} in progress`- : 'Install queue'}- </Text>- </HStack>- {errorCount > 0 ? (- <Text color="fg.error" flexShrink={0} fontSize="2xs" fontWeight="600">- {errorCount} failed- </Text>- ) : null}- </HStack>- {firstDownloading ? <FooterDownloadProgress jobId={firstDownloading.id} /> : null}- </Stack>- );-};--const FooterDownloadProgress = ({ jobId }: { jobId: number }) => {- const progress = useInstallProgress(jobId);- const ratio = progress && progress.totalBytes > 0 ? Math.min(1, progress.bytes / progress.totalBytes) : null;-- return (- <Progress.Root aria-label="Install download progress" max={1} size="xs" value={ratio}>- <Progress.Track>- <Progress.Range />- </Progress.Track>- </Progress.Root>- );-};diff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/ModelsWidgetView.tsx b/invokeai/frontend/webv2/src/workbench/widgets/models/ModelsWidgetView.tsxdeleted file mode 100644index 0421e93d31..0000000000--- a/invokeai/frontend/webv2/src/workbench/widgets/models/ModelsWidgetView.tsx+++ /dev/null@@ -1,17 +0,0 @@-import type { WidgetViewProps } from '@workbench/types';--import { ModelsCenterView } from './ModelsCenterView';-import { ModelsPanelView } from './ModelsPanelView';--/**- * Region router for the models widget: the center region gets the full- * manager (library, add models, install queue); side panels get the compact- * browser with drill-in detail.- */-export const ModelsWidgetView = ({ manifest, region }: WidgetViewProps) => {- if (region === 'center') {- return <ModelsCenterView />;- }-- return <ModelsPanelView widgetId={manifest.id} />;-};diff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/ScanFolderTab.tsx b/invokeai/frontend/webv2/src/workbench/widgets/models/ScanFolderTab.tsxdeleted file mode 100644index 5a8cdc0667..0000000000--- a/invokeai/frontend/webv2/src/workbench/widgets/models/ScanFolderTab.tsx+++ /dev/null@@ -1,152 +0,0 @@-import { Checkbox, HStack, Icon, Input, Stack, Text } from '@chakra-ui/react';-import { Button, Field, Scrollable } from '@workbench/components/ui';-import { scanFolderForModels } from '@workbench/models/api';-import { scanFolderSchema } from '@workbench/models/schemas';-import { updateModelsUi, useModelsUi } from '@workbench/models/uiStore';-import { useZodForm } from '@workbench/models/useZodForm';-import { useNotify } from '@workbench/useNotify';-import { DownloadIcon, FolderSearchIcon } from 'lucide-react';-import { useState } from 'react';--import { InstallSourceButton, SourceListItem } from './SourceListItem';-import { useInstallActions } from './useInstallActions';--/**- * Recursively scan a server folder for model files and install them- * individually or all at once, optionally in place. The query and results- * live in the models UI store, so leaving and revisiting the tab keeps them.- */-export const ScanFolderTab = () => {- const notify = useNotify();- const { install, pendingSources } = useInstallActions();- const { scan } = useModelsUi();- const [inplace, setInplace] = useState(true);- const [isInstallingAll, setIsInstallingAll] = useState(false);- const form = useZodForm(scanFolderSchema, { path: scan?.path ?? '' });-- const handleScan = () =>- form.handleSubmit(async ({ path }) => {- updateModelsUi({ scan: { path, results: await scanFolderForModels(path) } });- });-- const notInstalled = scan?.results.filter((result) => !result.is_installed) ?? [];-- const handleInstallAll = async () => {- setIsInstallingAll(true);-- try {- let queued = 0;-- for (const result of notInstalled) {- // Sequential on purpose: each call returns fast (install is a- // background job) and ordering keeps the queue readable.- if (await install({ inplace, source: result.path }, { silent: true })) {- queued += 1;- }- }-- if (queued > 0) {- notify.success('Installs queued', `${queued} model${queued === 1 ? '' : 's'} queued from the scanned folder.`);- }- } finally {- setIsInstallingAll(false);- }- };-- return (- <Stack gap="4" maxW="40rem">- <Field- error={form.errors.path ?? form.formError}- helpText="An absolute folder path on the machine running InvokeAI. Subfolders are scanned too."- label="Folder to Scan"- >- <HStack gap="1.5">- <Input- aria-invalid={form.errors.path ? true : undefined}- placeholder="/path/to/models"- size="sm"- value={form.values.path}- onChange={(event) => form.setValue('path', event.currentTarget.value)}- onKeyDown={(event) => {- if (event.key === 'Enter') {- event.preventDefault();- void handleScan();- }- }}- />- <Button- disabled={form.values.path.trim().length === 0}- loading={form.isSubmitting}- size="sm"- variant="solid"- onClick={() => void handleScan()}- >- <Icon as={FolderSearchIcon} boxSize="3.5" />- Scan- </Button>- </HStack>- </Field>-- {scan ? (- <Stack gap="2">- <HStack justify="space-between" wrap="wrap">- <Text color="fg.muted" fontSize="2xs">- {scan.results.length} model file{scan.results.length === 1 ? '' : 's'} found · {notInstalled.length} not- installed- </Text>- <HStack gap="3">- <Checkbox.Root- checked={inplace}- colorPalette="accent"- size="sm"- onCheckedChange={(event) => setInplace(event.checked === true)}- >- <Checkbox.HiddenInput />- <Checkbox.Control />- <Checkbox.Label fontSize="2xs">Install in place</Checkbox.Label>- </Checkbox.Root>- <Button- disabled={notInstalled.length === 0}- loading={isInstallingAll}- size="2xs"- variant="solid"- onClick={() => void handleInstallAll()}- >- <Icon as={DownloadIcon} boxSize="3" />- Install All ({notInstalled.length})- </Button>- </HStack>- </HStack>- {scan.results.length === 0 ? (- <Text color="fg.subtle" fontSize="2xs">- No model files found in {scan.path}.- </Text>- ) : (- <Scrollable label="Scan results" maxH="50vh">- <Stack gap="1.5">- {scan.results.map((result) => (- <SourceListItem- key={result.path}- description={result.path}- title={result.path.split('/').at(-1) ?? result.path}- titleTooltip={result.path}- trailing={- <InstallSourceButton- isInstalled={result.is_installed}- isPending={pendingSources.has(result.path)}- source={result.path}- onInstall={() => {- void install({ inplace, source: result.path });- }}- />- }- />- ))}- </Stack>- </Scrollable>- )}- </Stack>- ) : null}- </Stack>- );-};diff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/StarterModelsTab.tsx b/invokeai/frontend/webv2/src/workbench/widgets/models/StarterModelsTab.tsxdeleted file mode 100644index 0957a390ae..0000000000--- a/invokeai/frontend/webv2/src/workbench/widgets/models/StarterModelsTab.tsx+++ /dev/null@@ -1,427 +0,0 @@-import type { ModelTaxonomyType, StarterModel, StarterModelBundle } from '@workbench/models/types';--import {- Badge,- Box,- Flex,- HStack,- Icon,- Input,- InputGroup,- Menu,- Portal,- Spinner,- Stack,- Text,-} from '@chakra-ui/react';-import { IconButton, MenuContent, Row, Scrollable, Tooltip } from '@workbench/components/ui';-import { getModelBaseColorPalette, getModelBaseLabel } from '@workbench/models/baseIdentity';-import { collectBases, collectTypes } from '@workbench/models/library';-import { ensureStartersLoaded, useStartersSnapshot } from '@workbench/models/startersStore';-import { getModelTypeLabel } from '@workbench/models/taxonomy';-import { useNotify } from '@workbench/useNotify';-import { CheckIcon, DownloadIcon, PackageIcon, SearchIcon, SlidersHorizontalIcon, StarIcon } from 'lucide-react';-import { useEffect, useMemo, useState, type ReactNode } from 'react';--import { FilterMenuItem } from './ModelFilterBar';-import { InstallSourceButton, SourceListItem } from './SourceListItem';-import { getStarterBundleInstallSources, getStarterModelInstallSources } from './starterModelInstallSources';-import { useInstallActions } from './useInstallActions';--/**- * Curated starter models, served from the cached starters store (no refetch- * on revisit; installs revalidate in background). Bundles sit in a sidebar- * like playlists: clicking one filters the list to its models, and each has- * a download action that queues every missing model in the pack.- */-export const StarterModelsTab = () => {- const notify = useNotify();- const { install, pendingSources } = useInstallActions();- const { error: loadError, response, status } = useStartersSnapshot();- const [searchTerm, setSearchTerm] = useState('');- const [typeFilter, setTypeFilter] = useState<ModelTaxonomyType | null>(null);- const [baseFilter, setBaseFilter] = useState<string | null>(null);- const [installingBundle, setInstallingBundle] = useState<string | null>(null);- const [selectedBundleName, setSelectedBundleName] = useState<string | null>(null);-- useEffect(() => {- ensureStartersLoaded();- }, []);-- const bundles = useMemo(() => (response ? Object.values(response.starter_bundles) : []), [response]);- // Falls back to the full catalog if the selected bundle disappears on refresh.- const selectedBundle = useMemo(- () => bundles.find((bundle) => bundle.name === selectedBundleName) ?? null,- [bundles, selectedBundleName]- );- const sourceModels = useMemo(- () => selectedBundle?.models ?? response?.starter_models ?? [],- [response, selectedBundle]- );- const selectedBundleSources = useMemo(- () => (selectedBundle ? new Set(selectedBundle.models.map((model) => model.source)) : undefined),- [selectedBundle]- );-- const availableTypes = useMemo(() => collectTypes(sourceModels), [sourceModels]);- const availableBases = useMemo(() => collectBases(sourceModels), [sourceModels]);-- const filteredModels = useMemo(() => {- const terms = searchTerm.trim().toLowerCase().split(/\s+/).filter(Boolean);-- return sourceModels.filter((model) => {- if (typeFilter !== null && model.type !== typeFilter) {- return false;- }-- if (baseFilter !== null && String(model.base) !== baseFilter) {- return false;- }-- if (terms.length === 0) {- return true;- }-- const haystack = `${model.name} ${model.description} ${model.base} ${model.type}`.toLowerCase();-- return terms.every((term) => haystack.includes(term));- });- }, [baseFilter, searchTerm, sourceModels, typeFilter]);-- /** Queue a starter source list; returns how many jobs were queued. */- const queueSources = async (sources: string[]): Promise<number> => {- let queued = 0;-- for (const source of sources) {- if (await install({ source }, { silent: true })) {- queued += 1;- }- }-- return queued;- };-- /** Queue a starter model plus its uninstalled dependencies; returns how many jobs were queued. */- const queueStarter = (model: StarterModel): Promise<number> =>- queueSources(getStarterModelInstallSources(model, { dependencySourcesToSkip: selectedBundleSources }));-- const installStarter = async (model: StarterModel) => {- const queued = await queueStarter(model);-- if (queued > 0) {- notify.success(- 'Model install queued',- queued > 1 ? `${model.name} and ${queued - 1} dependenc${queued === 2 ? 'y' : 'ies'}` : model.name- );- }- };-- const installBundle = async (bundle: StarterModelBundle) => {- setInstallingBundle(bundle.name);-- try {- const queued = await queueSources(getStarterBundleInstallSources(bundle));-- if (queued > 0) {- notify.success('Bundle install queued', `${bundle.name}: ${queued} install${queued === 1 ? '' : 's'} queued.`);- }- } finally {- setInstallingBundle(null);- }- };-- if (status === 'error' && loadError) {- return (- <Stack align="center" gap="1" py="8">- <Text color="fg.error" fontSize="xs" fontWeight="600">- Could not load starter models- </Text>- <Text color="fg.subtle" fontSize="2xs">- {loadError}- </Text>- </Stack>- );- }-- if (!response) {- return (- <Flex align="center" justify="center" py="10">- <Spinner color="fg.subtle" size="sm" />- </Flex>- );- }-- return (- <HStack align="stretch" gap="4" h="full" minH="0">- {bundles.length > 0 ? (- <Stack flexShrink={0} gap="2" minH="0" w="16rem">- <Text color="fg.subtle" fontSize="2xs" fontWeight="700" textTransform="uppercase">- Bundles- </Text>- <Scrollable flex="1" label="Starter bundles" minH="0">- <Stack gap="1">- <SidebarRow- icon={StarIcon}- isSelected={selectedBundle === null}- subtitle={`${response.starter_models.length} models`}- title="All starter models"- onSelect={() => setSelectedBundleName(null)}- />- {bundles.map((bundle) => (- <BundleRow- key={bundle.name}- bundle={bundle}- isInstalling={installingBundle === bundle.name}- isSelected={selectedBundle?.name === bundle.name}- onInstall={() => void installBundle(bundle)}- onSelect={() => setSelectedBundleName(bundle.name)}- />- ))}- </Stack>- </Scrollable>- </Stack>- ) : null}-- <Stack flex="1" gap="2" minH="0" minW="0">- <HStack justify="space-between" wrap="wrap">- <Text color="fg.subtle" fontSize="2xs" fontWeight="700" textTransform="uppercase" truncate>- {selectedBundle?.name ?? 'Starter Models'}- </Text>- <HStack gap="1.5">- <Box maxW="18rem" w="full">- <InputGroup startElement={<Icon as={SearchIcon} boxSize="3.5" color="fg.subtle" />}>- <Input- aria-label="Search starter models"- placeholder="Search starter models…"- size="xs"- value={searchTerm}- onChange={(event) => setSearchTerm(event.currentTarget.value)}- />- </InputGroup>- </Box>- <Menu.Root closeOnSelect={false} positioning={{ placement: 'bottom-end' }}>- <Menu.Trigger asChild>- <IconButton- aria-label="Filter starter models"- color={typeFilter !== null || baseFilter !== null ? 'accent.solid' : 'fg.muted'}- size="xs"- variant="ghost"- >- <Icon as={SlidersHorizontalIcon} boxSize="4" />- </IconButton>- </Menu.Trigger>- <Portal>- <Menu.Positioner>- <MenuContent minW="13rem">- <Menu.ItemGroup>- <Menu.ItemGroupLabel color="fg.subtle" fontSize="2xs" textTransform="uppercase">- Model Type- </Menu.ItemGroupLabel>- <FilterMenuItem- isChecked={typeFilter === null}- label="All types"- value="type-all"- onSelect={() => setTypeFilter(null)}- />- {availableTypes.map((type) => (- <FilterMenuItem- key={type}- isChecked={typeFilter === type}- label={getModelTypeLabel(type)}- value={`type-${type}`}- onSelect={() => setTypeFilter((current) => (current === type ? null : type))}- />- ))}- </Menu.ItemGroup>- <Menu.Separator />- <Menu.ItemGroup>- <Menu.ItemGroupLabel color="fg.subtle" fontSize="2xs" textTransform="uppercase">- Base Architecture- </Menu.ItemGroupLabel>- <FilterMenuItem- isChecked={baseFilter === null}- label="All bases"- value="base-all"- onSelect={() => setBaseFilter(null)}- />- {availableBases.map((base) => (- <FilterMenuItem- key={base}- isChecked={baseFilter === base}- label={getModelBaseLabel(base)}- value={`base-${base}`}- onSelect={() => setBaseFilter((current) => (current === base ? null : base))}- />- ))}- </Menu.ItemGroup>- </MenuContent>- </Menu.Positioner>- </Portal>- </Menu.Root>- </HStack>- </HStack>- {filteredModels.length === 0 ? (- <Text color="fg.subtle" fontSize="2xs" py="4" textAlign="center">- {selectedBundle- ? 'No models in this bundle match your search or filters.'- : 'No starter models match your search or filters.'}- </Text>- ) : (- <Scrollable flex="1" label="Starter models" minH="0" pr="1">- <Stack gap="1.5">- {filteredModels.map((model) => {- const dependencyCount = (model.dependencies ?? []).filter(- (dependency) => !dependency.is_installed && !selectedBundleSources?.has(dependency.source)- ).length;-- return (- <SourceListItem- key={`${model.source}-${model.name}`}- badges={- <>- <Badge- colorPalette={getModelBaseColorPalette(model.base)}- flexShrink={0}- fontSize="2xs"- size="sm"- variant="surface"- >- {getModelBaseLabel(model.base)}- </Badge>- <Badge colorPalette="gray" flexShrink={0} fontSize="2xs" size="sm" variant="outline">- {getModelTypeLabel(model.type)}- </Badge>- </>- }- description={`${model.description}${- dependencyCount > 0- ? ` (installs ${dependencyCount} dependenc${dependencyCount === 1 ? 'y' : 'ies'})`- : ''- }`}- title={model.name}- trailing={- <InstallSourceButton- isInstalled={model.is_installed}- isPending={pendingSources.has(model.source)}- source={model.source}- onInstall={() => void installStarter(model)}- />- }- />- );- })}- </Stack>- </Scrollable>- )}- </Stack>- </HStack>- );-};--/** Playlist-style sidebar row: icon, two-line label, optional trailing action. */-const SidebarRow = ({- icon,- isSelected,- onSelect,- subtitle,- title,- trailing,-}: {- icon: typeof StarIcon;- isSelected: boolean;- onSelect: () => void;- subtitle: string;- title: string;- trailing?: ReactNode;-}) => (- <Row- active={isSelected ? 'accent' : 'none'}- aria-current={isSelected || undefined}- alignItems="start"- minW="0"- p="2"- role="button"- rounded="md"- tabIndex={0}- _focusVisible={{ boxShadow: 'inset 0 0 0 2px {colors.accent.solid}', outline: 'none' }}- onClick={onSelect}- onKeyDown={(event) => {- if (event.key === 'Enter' || event.key === ' ') {- event.preventDefault();- onSelect();- }- }}- >- <Icon as={icon} boxSize="3.5" flexShrink={0} />- <Stack flex="1" gap="0" minW="0">- <Text fontSize="xs" fontWeight="600" truncate>- {title}- </Text>- <Text- color={isSelected ? 'accent.contrast' : 'fg.subtle'}- opacity={isSelected ? 0.72 : undefined}- fontSize="2xs"- truncate- >- {subtitle}- </Text>- </Stack>- {trailing}- </Row>-);--/** A bundle in the sidebar: select to browse its models, download to queue the pack. */-const BundleRow = ({- bundle,- isInstalling,- isSelected,- onInstall,- onSelect,-}: {- bundle: StarterModelBundle;- isInstalling: boolean;- isSelected: boolean;- onInstall: () => void;- onSelect: () => void;-}) => {- const missingCount = bundle.models.filter((model) => !model.is_installed).length;-- return (- <SidebarRow- icon={PackageIcon}- isSelected={isSelected}- subtitle={`${bundle.models.length} models · ${missingCount === 0 ? 'all installed' : `${missingCount} to install`}`}- title={bundle.name}- trailing={- missingCount === 0 ? (- <Tooltip content="All models in this bundle are installed">- <Icon as={CheckIcon} boxSize="3.5" color={isSelected ? 'accent.contrast' : 'fg.success'} flexShrink={0} />- </Tooltip>- ) : (- <Tooltip content={`Install ${missingCount} model${missingCount === 1 ? '' : 's'}`}>- <IconButton- aria-label={`Install bundle ${bundle.name}`}- flexShrink={0}- loading={isInstalling}- size="2xs"- variant="ghost"- color={isSelected ? 'accent.contrast' : undefined}- // On the accent row, rest at the row's own solid color so the hover- // transition has an opaque endpoint — animating background to- // `transparent` interpolates through black and flashes dark on leave.- bg={isSelected ? 'accent.solid' : undefined}- _hover={isSelected ? { bg: 'accent.contrast/20' } : undefined}- onClick={(event) => {- event.stopPropagation();- onInstall();- }}- >- <Icon as={DownloadIcon} boxSize="3.5" />- </IconButton>- </Tooltip>- )- }- onSelect={onSelect}- />- );-};diff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/UrlInstallTab.tsx b/invokeai/frontend/webv2/src/workbench/widgets/models/UrlInstallTab.tsxdeleted file mode 100644index 235bf3b20f..0000000000--- a/invokeai/frontend/webv2/src/workbench/widgets/models/UrlInstallTab.tsx+++ /dev/null@@ -1,103 +0,0 @@-import { Checkbox, HStack, Icon, Input, Stack, Text } from '@chakra-ui/react';-import { Button, Field } from '@workbench/components/ui';-import { isCivitaiUrl } from '@workbench/models/apiKeys';-import { installSourceSchema } from '@workbench/models/schemas';-import { useZodForm } from '@workbench/models/useZodForm';-import { DownloadIcon } from 'lucide-react';--import { useInstallActions } from './useInstallActions';--/**- * Install from a direct URL (Civitai, arbitrary hosts), a HuggingFace repo id,- * or a path on the server's filesystem. Local paths can be installed in place- * (left where they are) instead of copied into the models directory.- */-export const UrlInstallTab = () => {- const { install } = useInstallActions();- const form = useZodForm(installSourceSchema, { accessToken: '', inplace: true, source: '' });-- const looksLocal = form.values.source.startsWith('/') || /^[A-Za-z]:[\\/]/.test(form.values.source);- const looksCivitai = isCivitaiUrl(form.values.source);-- const handleInstall = () =>- form.handleSubmit(async (values) => {- const ok = await install({- accessToken: values.accessToken === '' ? undefined : values.accessToken,- inplace: looksLocal ? values.inplace : undefined,- source: values.source,- });-- if (ok) {- form.reset();- }- });-- return (- <Stack gap="4" maxW="40rem">- <Field- error={form.errors.source ?? form.formError}- helpText="A model file URL, civitai.com model URL, HuggingFace repo id, or a path on the InvokeAI server."- label="Model Source"- >- <Input- aria-invalid={form.errors.source ? true : undefined}- placeholder="https://civitai.com/… · owner/repo · /path/on/server/model.safetensors"- size="sm"- value={form.values.source}- onChange={(event) => form.setValue('source', event.currentTarget.value)}- onKeyDown={(event) => {- if (event.key === 'Enter') {- event.preventDefault();- void handleInstall();- }- }}- />- </Field>- {looksLocal ? (- <Checkbox.Root- checked={form.values.inplace}- colorPalette="accent"- size="sm"- onCheckedChange={(event) => form.setValue('inplace', event.checked === true)}- >- <Checkbox.HiddenInput />- <Checkbox.Control />- <Checkbox.Label fontSize="xs">Install in place (leave the file where it is)</Checkbox.Label>- </Checkbox.Root>- ) : null}- {looksCivitai ? (- <Text color="fg.subtle" fontSize="2xs">- Your saved Civitai API key is attached automatically if this download requires login.- </Text>- ) : null}- <Field- error={form.errors.accessToken}- helpText="Optional. Overrides saved keys for this one download."- label="Access Token"- >- <Input- placeholder="Only needed for protected URLs"- size="sm"- type="password"- value={form.values.accessToken ?? ''}- onChange={(event) => form.setValue('accessToken', event.currentTarget.value)}- />- </Field>- <HStack>- <Button- disabled={form.values.source.trim().length === 0}- loading={form.isSubmitting}- size="sm"- variant="solid"- onClick={() => void handleInstall()}- >- <Icon as={DownloadIcon} boxSize="3.5" />- Install Model- </Button>- </HStack>- <Text color="fg.subtle" fontSize="2xs">- Manage HuggingFace, Civitai, and external provider keys in the API Keys tab.- </Text>- </Stack>- );-};diff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/index.ts b/invokeai/frontend/webv2/src/workbench/widgets/models/index.tsdeleted file mode 100644index 442475d70c..0000000000--- a/invokeai/frontend/webv2/src/workbench/widgets/models/index.ts+++ /dev/null@@ -1,19 +0,0 @@-import type { WidgetManifest } from '@workbench/types';--import { BoxIcon } from 'lucide-react';--import { MaintenanceMenu } from './MaintenanceMenu';-import { ModelsWidgetView } from './ModelsWidgetView';--export const modelsWidgetManifest: WidgetManifest = {- allowMultiple: false,- allowedRegions: ['left', 'right', 'center'],- failurePolicy: { isolateRenderFailure: true, onRegistrationFailure: 'disable' },- headerActions: MaintenanceMenu,- icon: BoxIcon,- id: 'models',- label: 'Models',- labelText: 'Models',- version: 1,- view: ModelsWidgetView,-};diff --git a/invokeai/frontend/webv2/src/workbench/widgets/models/starterModelInstallSources.ts b/invokeai/frontend/webv2/src/workbench/widgets/models/starterModelInstallSources.tsdeleted file mode 100644index c05e429c8f..0000000000--- a/invokeai/frontend/webv2/src/workbench/widgets/models/starterModelInstallSources.ts+++ /dev/null@@ -1,54 +0,0 @@-import type { StarterModel, StarterModelBundle } from '@workbench/models/types';--export interface StarterModelInstallSourceOptions {- /** Dependencies visible as their own rows in the active bundle should not be auto-installed by a row action. */- dependencySourcesToSkip?: ReadonlySet<string>;-}--const appendSource = (sources: string[], seen: Set<string>, source: string): void => {- if (seen.has(source)) {- return;- }-- seen.add(source);- sources.push(source);-};--export const getStarterModelInstallSources = (- model: StarterModel,- options: StarterModelInstallSourceOptions = {}-): string[] => {- const sources: string[] = [];- const seen = new Set<string>();-- for (const dependency of model.dependencies ?? []) {- if (dependency.is_installed || options.dependencySourcesToSkip?.has(dependency.source)) {- continue;- }-- appendSource(sources, seen, dependency.source);- }-- if (!model.is_installed) {- appendSource(sources, seen, model.source);- }-- return sources;-};--export const getStarterBundleInstallSources = (bundle: StarterModelBundle): string[] => {- const sources: string[] = [];- const seen = new Set<string>();-- for (const model of bundle.models) {- if (model.is_installed) {- continue;- }-- for (const source of getStarterModelInstallSources(model)) {- appendSource(sources, seen, source);- }- }-- return sources;-};diff --git a/invokeai/frontend/webv2/src/workbench/workbenchState.test.ts b/invokeai/frontend/webv2/src/workbench/workbenchState.test.tsindex 616ad0683f..20498498f6 100644--- a/invokeai/frontend/webv2/src/workbench/workbenchState.test.ts+++ b/invokeai/frontend/webv2/src/workbench/workbenchState.test.ts@@ -110,7 +110,6 @@ describe('workbench widget region defaults', () => {'queue','gallery','layers',- 'models','diagnostics','project',]);@@ -143,15 +142,15 @@ describe('workbench widget region opening', () => {),};- state = workbenchReducer(state, { region: 'center', type: 'openRegionWidget', widgetId: 'models' });+ state = workbenchReducer(state, { region: 'center', type: 'openRegionWidget', widgetId: 'preview' });- expect(getActiveProject(state).widgetRegions.center.activeInstanceId).toBe('models');- expect(getActiveProject(state).widgetRegions.center.instanceIds).toEqual(['canvas', 'models']);+ expect(getActiveProject(state).widgetRegions.center.activeInstanceId).toBe('preview');+ expect(getActiveProject(state).widgetRegions.center.instanceIds).toEqual(['canvas', 'preview']);- state = workbenchReducer(state, { region: 'center', type: 'openRegionWidget', widgetId: 'models' });+ state = workbenchReducer(state, { region: 'center', type: 'openRegionWidget', widgetId: 'preview' });- expect(getActiveProject(state).widgetRegions.center.activeInstanceId).toBe('models');- expect(getActiveProject(state).widgetRegions.center.instanceIds).toEqual(['canvas', 'models']);+ expect(getActiveProject(state).widgetRegions.center.activeInstanceId).toBe('preview');+ expect(getActiveProject(state).widgetRegions.center.instanceIds).toEqual(['canvas', 'preview']);expect(getActiveProject(state).widgetRegions.center.isCollapsed).toBe(false);});diff --git a/invokeai/frontend/webv2/src/workbench/workbenchState.ts b/invokeai/frontend/webv2/src/workbench/workbenchState.tsindex 35b50ccb60..6ce1ccbb25 100644--- a/invokeai/frontend/webv2/src/workbench/workbenchState.ts+++ b/invokeai/frontend/webv2/src/workbench/workbenchState.ts@@ -520,7 +520,6 @@ const createWidgetStates = (): WidgetStateMap => ({generate: { graphId: 'generate-graph', id: 'generate', label: 'Generate', values: {}, version: 1 },'layout-actions': { id: 'layout-actions', label: 'Layout Actions', values: {}, version: 1 },layers: { id: 'layers', label: 'Layers', values: {}, version: 1 },- models: { id: 'models', label: 'Models', values: {}, version: 1 },notifications: { id: 'notifications', label: 'Notifications', values: {}, version: 1 },preview: { id: 'preview', label: 'Preview', values: {}, version: 1 },project: { id: 'project', label: 'Project', values: {}, version: 1 },@@ -563,8 +562,6 @@ const defaultWidgetInstanceTypes: Record<WidgetInstanceId, WidgetTypeId> = {generate: 'generate','layout-actions': 'layout-actions',layers: 'layers',- models: 'models',- 'models:center': 'models',notifications: 'notifications',preview: 'preview',project: 'project',@@ -594,7 +591,7 @@ const createWidgetRegions = (): Record<WidgetRegion, WidgetRegionState> => ({},right: {activeInstanceId: 'layers',- instanceIds: ['queue', 'gallery', 'layers', 'models', 'diagnostics', 'project'],+ instanceIds: ['queue', 'gallery', 'layers', 'diagnostics', 'project'],isCollapsed: false,sizePx: 240,},@@ -616,7 +613,7 @@ const createWidgetRegions = (): Record<WidgetRegion, WidgetRegionState> => ({},center: {activeInstanceId: 'canvas',- instanceIds: ['canvas', 'gallery:center', 'preview', 'workflow:center', 'models:center'],+ instanceIds: ['canvas', 'gallery:center', 'preview', 'workflow:center'],isCollapsed: false,sizePx: 0,},@@ -647,10 +644,6 @@ const getCenterWidgetIdFromViewId = (centerViewId: CenterViewId): WidgetInstancereturn 'gallery:center';}- if (centerViewId === 'models') {- return 'models:center';- }-if (centerViewId === 'workflow') {return 'workflow:center';}