The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.
TypeScript agentai-chatai-studioall-in-onecoding-agentdesktop-appfluximage-generationlinuxllmlocal-ailocal-llmopen-sourceprivacyself-hostedstable-diffusionuncensoreduncensored-aivideo-generationwindows
fix(create): the model picker names a catalogue model as the catalogue does
purplef1508920f0c9
diff --git a/src/components/create/experimental/ModelChip.tsx b/src/components/create/experimental/ModelChip.tsxindex 6fbdabbe..861b90e2 100644--- a/src/components/create/experimental/ModelChip.tsx+++ b/src/components/create/experimental/ModelChip.tsx@@ -18,6 +18,7 @@ import { TYPE_BADGE } from './badges'import { useLocalPick } from './localPick'import { useLocalModelFits } from '../../../hooks/useLocalModelFit'import { vramFitLabel } from '../../../lib/vram-fit'+import { localModelLabel } from '../../../lib/local-model-name'// Portplan P7: lipsync/music/extend/motion reach the Studio track through the// SAME picker as their classic op-specialized twins, one list, matching what@@ -230,7 +231,9 @@ function LocalModelChip() {// zeigt, welches Modell ein Lauf wirklich nimmt.const options: SelectOption[] = sortByTier(list.map((m) => ({ m, tier: localTier(m) }))).map(({ m, tier }) => ({value: m.name,- label: prettyName(m.name),+ // The catalogue's name for a file it knows, the file name as the tooltip+ // (lib/local-model-name); any other file as before.+ ...localModelLabel(m.name),badge: TYPE_BADGE[m.type],group: tierGroup({ tier }),tags: [...tierMarks({ tier }), ...fitMarks(m.name)],@@ -277,7 +280,3 @@ function LocalModelChip() {/>)}--function prettyName(filename: string): string {- return filename.replace(/\.(safetensors|ckpt|pt|gguf)$/i, '').replace(/[_]+/g, ' ')-}diff --git a/src/components/create/experimental/__tests__/local-model-chip-names.test.tsx b/src/components/create/experimental/__tests__/local-model-chip-names.test.tsxnew file mode 100644index 00000000..5fa8bcf0--- /dev/null+++ b/src/components/create/experimental/__tests__/local-model-chip-names.test.tsx@@ -0,0 +1,88 @@+// @vitest-environment jsdom+/**+ * The box, 03.10.2026: the card in the Model Manager read "Noct Q (Qwen-Image+ * 2.1, Unfiltered)", the model picker read "NoctQ V4 int8 convrot". A file the+ * catalogue knows carries the catalogue's name in the picker, the file name as+ * its tooltip; any other file reads as before.+ */+import { describe, it, expect, beforeEach, afterEach } from 'vitest'+import { render, cleanup, screen, fireEvent } from '@testing-library/react'+import { ModelChip } from '../ModelChip'+import { useCreateStore } from '../../../../stores/createStore'+import { useSettingsStore } from '../../../../stores/settingsStore'+import { catalogModelName, localModelLabel } from '../../../../lib/local-model-name'+import { getImageBundles, getVideoBundles } from '../../../../api/model-bundles'++const NOCT = 'NoctQ_V4_int8_convrot.safetensors'+const OWN = 'my_own_merge_v3.safetensors'++beforeEach(() => {+ useSettingsStore.getState().updateSettings({ cloudTeasersEnabled: false })+ useCreateStore.setState({+ backend: 'local',+ imageModel: NOCT,+ imageModelList: [+ { name: NOCT, type: 'qwenimage' },+ { name: 'qwen_image_2.1_int8_convrot.safetensors', type: 'qwenimage' },+ { name: OWN, type: 'sdxl' },+ ],+ } as never)+ useCreateStore.getState().setIntent('image')+ render(<ModelChip />)+})+afterEach(() => cleanup())++const rows = () => {+ fireEvent.click(screen.getByRole('button'))+ return Array.from(document.querySelectorAll('[role="option"]')) as HTMLElement[]+}+const rowOf = (text: string) => rows().find((r) => r.textContent?.includes(text))++describe('the local model picker', () => {+ it('shows a catalogue file under the catalogue name, the file name as tooltip', () => {+ const row = rowOf('Noct Q V4 (INT8)')+ expect(row, 'no row named after the catalogue file').toBeTruthy()+ expect(row!.getAttribute('title')).toBe(NOCT)+ expect(document.body.textContent).not.toContain('NoctQ V4 int8 convrot')+ })++ it('names the picked model the same way on the closed field', () => {+ const closed = screen.getByRole('button')+ expect(closed.textContent).toContain('Noct Q V4 (INT8)')+ expect(closed.querySelector('[title]')?.getAttribute('title')).toBe(NOCT)+ })++ it('keeps the file name for a file the catalogue does not know', () => {+ const row = rowOf('my own merge v3')+ expect(row).toBeTruthy()+ expect(row!.getAttribute('title')).toBeNull()+ })++ it('still finds a catalogue model by its file name in the search', () => {+ rows()+ fireEvent.change(document.querySelector('input') as HTMLInputElement, { target: { value: 'noctq_v4' } })+ const left = Array.from(document.querySelectorAll('[role="option"]'))+ expect(left).toHaveLength(1)+ expect(left[0].textContent).toContain('Noct Q V4 (INT8)')+ })+})++describe('catalogModelName', () => {+ it('knows the file through a folder prefix and in any case', () => {+ expect(catalogModelName(NOCT)).toBe('Noct Q V4 (INT8)')+ expect(catalogModelName(`unfiltered\\${NOCT.toUpperCase()}`)).toBe('Noct Q V4 (INT8)')+ expect(catalogModelName('z_image_bf16.safetensors')).toBe('Z-Image Base BF16')+ expect(catalogModelName(OWN)).toBeNull()+ expect(localModelLabel(OWN)).toEqual({ label: 'my own merge v3' })+ })++ it('gives every main model of the catalogue a name of its own', () => {+ const main = [...getImageBundles(), ...getVideoBundles()].flatMap((b) => b.files)+ .filter((f) => f.subfolder === 'checkpoints' || f.subfolder === 'diffusion_models')+ const labels = new Map<string, string>()+ for (const f of main) labels.set(f.filename!, catalogModelName(f.filename!)!)+ expect([...labels.values()].every(Boolean)).toBe(true)+ // Two files never share a label, or the picker would show two rows alike.+ expect(new Set(labels.values()).size).toBe(labels.size)+ })+})diff --git a/src/components/create/ui/Select.tsx b/src/components/create/ui/Select.tsxindex 7dba6948..55f507dd 100644--- a/src/components/create/ui/Select.tsx+++ b/src/components/create/ui/Select.tsx@@ -9,6 +9,9 @@ export interface SelectOption {value: stringlabel: stringsublabel?: string+ /** Tooltip der Zeile und des geschlossenen Feldes, etwa der Dateiname hinter+ * einem Anzeigenamen. Die Suche findet den Eintrag auch darueber. */+ title?: string/** Ueberschrift ueber diesem und den folgenden Eintraegen derselben Gruppe. */group?: stringbadge?: { label: string; color: string }@@ -69,7 +72,8 @@ export function Select({return options.filter((option) =>option.label.toLowerCase().includes(normalizedQuery) ||- option.sublabel?.toLowerCase().includes(normalizedQuery),+ option.sublabel?.toLowerCase().includes(normalizedQuery) ||+ option.title?.toLowerCase().includes(normalizedQuery),)}, [options, query])@@ -148,7 +152,7 @@ export function Select({/>)}- <span className="truncate">+ <span className="truncate" title={current?.title}>{current?.label ?? placeholder}</span></span>@@ -244,6 +248,7 @@ export function Select({type="button"role="option"aria-selected={selected}+ title={option.title}onClick={() => {onChange(option.value)closeMenu()diff --git a/src/lib/local-model-name.ts b/src/lib/local-model-name.tsnew file mode 100644index 00000000..78d2d161--- /dev/null+++ b/src/lib/local-model-name.ts@@ -0,0 +1,45 @@+/**+ * The name a local model carries in the model picker.+ *+ * A local model is a file, and the picker showed the file name with its+ * underscores taken out. For a model that came from the Model Manager that is+ * a second name for the same thing: the box, 03.10.2026, installed the card+ * "Noct Q (Qwen-Image 2.1, Unfiltered)" and then had to recognise it in the+ * picker as "NoctQ V4 int8 convrot". A file the catalogue lists is shown+ * under the name the catalogue gives that file ("Noct Q V4 (INT8)"), which is+ * short and still tells two quants of one model apart. The file name stays+ * reachable as the row's tooltip and in the search. A file the catalogue does+ * not know (a CivitAI download, the user's own) keeps its file name.+ */+import { getImageBundles, getVideoBundles, getAudioBundles, getLipsyncBundles, getMotionBundles } from '../api/model-bundles'++let names: Map<string, string> | null = null++function baseName(filename: string): string {+ return (filename.split(/[\\/]/).pop() ?? filename).toLowerCase()+}++/** The catalogue's name for a file, or null when no bundle lists it. */+export function catalogModelName(filename: string): string | null {+ if (!names) {+ names = new Map()+ const bundles = [...getImageBundles(), ...getVideoBundles(), ...getAudioBundles(), ...getLipsyncBundles(), ...getMotionBundles()]+ for (const b of bundles) {+ for (const f of b.files) {+ if (f.filename && f.name && !names.has(baseName(f.filename))) names.set(baseName(f.filename), f.name)+ }+ }+ }+ return names.get(baseName(filename)) ?? null+}++/** The file name as the picker always showed it: no extension, no underscores. */+export function prettyFileName(filename: string): string {+ return filename.replace(/\.(safetensors|ckpt|pt|gguf)$/i, '').replace(/[_]+/g, ' ')+}++/** What a picker row says for a local model, and its tooltip. */+export function localModelLabel(filename: string): { label: string; title?: string } {+ const known = catalogModelName(filename)+ return known ? { label: known, title: filename } : { label: prettyFileName(filename) }+}