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(ui): open starter bundles in the model manager from home
joshistoastf35d7276513a
diff --git a/invokeai/frontend/webv2/public/locales/en.json b/invokeai/frontend/webv2/public/locales/en.jsonindex d594da5120..97819c2d52 100644--- a/invokeai/frontend/webv2/public/locales/en.json+++ b/invokeai/frontend/webv2/public/locales/en.json@@ -957,7 +957,7 @@"launchpad": {"installing_one": "{{count}} model installing…","installing_other": "{{count}} models installing…",- "noModelsDescription": "Invoke needs at least one model before it can generate. Install a starter bundle to get going.",+ "noModelsDescription": "Invoke needs at least one model before it can generate. Pick a starter bundle to see what's inside and install it from the model manager.","noModelsTitle": "No models installed","starterBundles": "Starter bundles"},diff --git a/invokeai/frontend/webv2/src/features/models/ui/add-models/AddModelsView.tsx b/invokeai/frontend/webv2/src/features/models/ui/add-models/AddModelsView.tsxindex 4e768244e1..e383bc8431 100644--- a/invokeai/frontend/webv2/src/features/models/ui/add-models/AddModelsView.tsx+++ b/invokeai/frontend/webv2/src/features/models/ui/add-models/AddModelsView.tsx@@ -56,15 +56,21 @@ export const AddModelsView = () => {const loadError = useStartersSelector((snapshot) => snapshot.error);const response = useStartersSelector((snapshot) => snapshot.response);const status = useStartersSelector((snapshot) => snapshot.status);- const { hfLookup, scan } = useModelsUiSelector(- (snapshot) => ({ hfLookup: snapshot.hfLookup, scan: snapshot.scan }),- (left, right) => left.hfLookup === right.hfLookup && left.scan === right.scan+ const { hfLookup, scan, selectedBundleName } = useModelsUiSelector(+ (snapshot) => ({+ hfLookup: snapshot.hfLookup,+ scan: snapshot.scan,+ selectedBundleName: snapshot.selectedBundleName,+ }),+ (left, right) =>+ left.hfLookup === right.hfLookup &&+ left.scan === right.scan &&+ left.selectedBundleName === right.selectedBundleName);const [query, setQuery] = useState('');const [accessToken, setAccessToken] = useState('');const [inplace, setInplace] = useState(true);- const [selectedBundleName, setSelectedBundleName] = useState<string | null>(null);const { isBusy: isPulling, run: runPull } = useScopedAction();const { isBusy: isScanning, run: runScan } = useScopedAction();const [installingBundle, setInstallingBundle] = useState<string | null>(null);@@ -368,7 +374,7 @@ export const AddModelsView = () => {/>) : undefined}- onSelect={setSelectedBundleName}+ onSelect={(name) => updateModelsUi({ selectedBundleName: name })}/>{selectedBundle ? (diff --git a/invokeai/frontend/webv2/src/features/models/ui/launchpad/ModelsNotice.tsx b/invokeai/frontend/webv2/src/features/models/ui/launchpad/ModelsNotice.tsxindex a177f2b5f2..41f6902cae 100644--- a/invokeai/frontend/webv2/src/features/models/ui/launchpad/ModelsNotice.tsx+++ b/invokeai/frontend/webv2/src/features/models/ui/launchpad/ModelsNotice.tsx@@ -4,11 +4,11 @@ import { Flex, Icon, Spinner, Stack, Text, Wrap } from '@chakra-ui/react';import { ensureInstallsLoaded, isActiveInstallStatus, useInstallsSelector } from '@features/models/data/installsStore';import { ensureModelsLoaded, useModelsSelector } from '@features/models/data/modelsStore';import { ensureStartersLoaded, useStartersSelector } from '@features/models/data/startersStore';-import { getStarterBundleInstallSources } from '@features/models/ui/add-models/starterModelInstallSources';-import { useInstallActions } from '@features/models/ui/add-models/useInstallActions';+import { openAddModelsWithBundle } from '@features/models/ui/uiStore';import { useMountEffect } from '@platform/react/useMountEffect';import { Button } from '@platform/ui/Button';-import { BoxIcon } from 'lucide-react';+import { useNavigate } from '@tanstack/react-router';+import { ArrowRightIcon, BoxIcon } from 'lucide-react';import { useCallback, useMemo } from 'react';import { useTranslation } from 'react-i18next';@@ -106,17 +106,19 @@ const StarterBundles = ({ bundles }: { bundles: Record<string, StarterModelBundl};const StarterBundleButton = ({ bundle, bundleKey }: { bundle: StarterModelBundle; bundleKey: string }) => {- const { install } = useInstallActions();+ const navigate = useNavigate();- const handleInstall = useCallback(() => {- for (const source of getStarterBundleInstallSources(bundle)) {- void install({ config: source.config, source: source.source }, { silent: true });- }- }, [bundle, install]);+ // Opens the bundle in the model manager rather than installing blind — the+ // user sees what the pack contains and installs from there.+ const handleOpen = useCallback(() => {+ openAddModelsWithBundle(bundle.name || bundleKey);+ void navigate({ to: '/models' });+ }, [bundle.name, bundleKey, navigate]);return (- <Button size="xs" variant="outline" onClick={handleInstall}>+ <Button size="xs" variant="outline" onClick={handleOpen}>{bundle.name || bundleKey}+ <Icon as={ArrowRightIcon} boxSize="3" color="fg.muted" /></Button>);};diff --git a/invokeai/frontend/webv2/src/features/models/ui/uiStore.test.ts b/invokeai/frontend/webv2/src/features/models/ui/uiStore.test.tsnew file mode 100644index 0000000000..08128b9fa9--- /dev/null+++ b/invokeai/frontend/webv2/src/features/models/ui/uiStore.test.ts@@ -0,0 +1,47 @@+import { beforeEach, describe, expect, it, vi } from 'vitest';++describe('models ui store', () => {+ beforeEach(() => {+ vi.resetModules();+ });++ it('opens Add Models with a bundle preselected and clears stale results', async () => {+ const store = await import('./uiStore');++ store.updateModelsUi({+ activeTab: 'keys',+ hfLookup: { repo: 'owner/repo', urls: ['a'] },+ scan: { path: '/models', results: [] },+ });++ store.openAddModelsWithBundle('Essentials');++ const snapshot = store.getModelsUiSnapshotForTests();+ expect(snapshot.activeTab).toBe('add');+ expect(snapshot.selectedBundleName).toBe('Essentials');+ expect(snapshot.hfLookup).toBeNull();+ expect(snapshot.scan).toBeNull();+ });++ it('keeps the bundle selection until it is explicitly replaced', async () => {+ const store = await import('./uiStore');++ store.openAddModelsWithBundle('Essentials');+ store.openModelManagerTab('details');+ expect(store.getModelsUiSnapshotForTests().selectedBundleName).toBe('Essentials');++ store.updateModelsUi({ selectedBundleName: null });+ expect(store.getModelsUiSnapshotForTests().selectedBundleName).toBeNull();+ });++ it('prunes deleted keys from selection and the active slot', async () => {+ const store = await import('./uiStore');++ store.updateModelsUi({ activeModelKey: 'a', selectedKeys: new Set(['a', 'b']) });+ store.pruneModelsUiKeys(['a']);++ const snapshot = store.getModelsUiSnapshotForTests();+ expect(snapshot.activeModelKey).toBeNull();+ expect([...snapshot.selectedKeys]).toEqual(['b']);+ });+});diff --git a/invokeai/frontend/webv2/src/features/models/ui/uiStore.ts b/invokeai/frontend/webv2/src/features/models/ui/uiStore.tsindex f481d4d143..28628348a8 100644--- a/invokeai/frontend/webv2/src/features/models/ui/uiStore.ts+++ b/invokeai/frontend/webv2/src/features/models/ui/uiStore.ts@@ -36,6 +36,8 @@ export interface ModelsUiSnapshot {scan: { path: string; results: FoundModel[] } | null;/** Last HuggingFace repo lookup, kept across tab switches. */hfLookup: HFLookupState | null;+ /** Starter bundle selected in Add Models, kept across tab switches. */+ selectedBundleName: string | null;/** Whether the always-visible install queue footer is expanded. */queueExpanded: boolean;/** Scroll offsets per library-list instance, restored on remount. */@@ -53,6 +55,7 @@ const createInitialModelsUiSnapshot = (): ModelsUiSnapshot => ({pickerCompactViews: {},queueExpanded: false,scan: null,+ selectedBundleName: null,selectedKeys: new Set(),});@@ -100,6 +103,16 @@ export const openModelDetail = (modelKey: string): void => {updateModelsUi({ activeModelKey: modelKey, activeTab: 'details' });};+/**+ * Jump to Add Models with a starter bundle preselected (e.g. from the+ * Launchpad notice). Scan and HF lookup results are cleared because Add+ * Models hides the bundle strip whenever either has results — the user asked+ * to look at the bundle.+ */+export const openAddModelsWithBundle = (bundleName: string): void => {+ updateModelsUi({ activeTab: 'add', hfLookup: null, scan: null, selectedBundleName: bundleName });+};+/** Expand the always-visible install queue footer (e.g. from a "View queue" link). */export const openInstallQueue = (): void => {updateModelsUi({ queueExpanded: true });@@ -132,6 +145,8 @@ export const setPickerCompactView = (pickerId: string, isCompact: boolean): voidexport const getPickerCompactView = (pickerId: string): boolean =>store.getSnapshot().pickerCompactViews[pickerId] ?? false;+export const getModelsUiSnapshotForTests = (): ModelsUiSnapshot => store.getSnapshot();+export const useModelsUiSelector = store.useSelector;export const useModelsUi = (): ModelsUiSnapshot => store.useSnapshot();