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
feat(models): eigener LoRA-Reiter mit CivitAI-Suche und Loeschweg
purple43452572a7ba
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 1f46a390..5617aaae 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -25,6 +25,11 @@ installs stop losing environment variables to it.pair for every model.- **A cloud render without a prompt (a presenter reading a script, forexample) still gets a real name in the gallery**, instead of an empty tile.+- **Models now has a LoRAs tab of its own.** Get new searches CivitAI for+ LoRAs and downloads what you pick into ComfyUI's `models/loras` folder;+ Installed lists what is there with its size, marks a character you trained+ yourself with its trigger word, and deletes a file you no longer want. LoRAs+ no longer sit unnamed among the checkpoints in the Image tab.- **Character LoRAs in Create now only offer the models actually trained forthat character's family**, so the picker cannot suggest a combination thatwould fail to generate.diff --git a/docs/guide/create/index.html b/docs/guide/create/index.htmlindex a50798e5..ae8f6df3 100644--- a/docs/guide/create/index.html+++ b/docs/guide/create/index.html@@ -189,7 +189,7 @@<p>"Advanced settings" under the composer opens the controls the Quality preset hides: Steps, CFG scale (or Guidance), Width and Height, Seed (-1 = random; the gallery shows the seed a picture used, so you can repeat it), Batch size, and for video Frames and FPS. An Expert group has Sampler, Scheduler, Denoise, Mask edge feather, VAE and Skip CLIP layers. Leave those alone until you know what they do; the presets are tuned.</p>-<p>The LoRA stack lists the add-on files in ComfyUI's <code>models/loras</code> folder, each with a strength. Empty, it reads "No LoRAs found yet. Drop .safetensors files into ComfyUI's models/loras folder and hit Rescan. Characters trained in Character Studio land there automatically." A LoRA from CivitAI or Hugging Face goes into that folder by hand. The CivitAI API key and the Hugging Face token under Settings, AI Backends unlock downloads those sites gate behind a login.</p>+<p>The LoRA stack lists the add-on files in ComfyUI's <code>models/loras</code> folder, each with a strength. Empty, it reads "No LoRAs found yet. Drop .safetensors files into ComfyUI's models/loras folder and hit Rescan. Characters trained in Character Studio land there automatically." Models has a LoRAs tab of its own: "Get new" searches CivitAI for LoRAs and downloads what you pick straight into that folder, "Installed" lists what is there with its size and deletes a file you no longer want. A LoRA from Hugging Face still goes into the folder by hand. The CivitAI API key and the Hugging Face token under Settings, AI Backends unlock downloads those sites gate behind a login.</p><h2 id="gallery">The gallery</h2>diff --git a/src/api/__tests__/ein-lora-landet-im-lora-ordner.test.ts b/src/api/__tests__/ein-lora-landet-im-lora-ordner.test.tsnew file mode 100644index 00000000..47a062f0--- /dev/null+++ b/src/api/__tests__/ein-lora-landet-im-lora-ordner.test.ts@@ -0,0 +1,80 @@+/**+ * Ein LoRA-Treffer aus der CivitAI-Suche gehoert in `loras` und nirgendwo+ * sonst.+ *+ * `searchCivitaiModels` bestimmt den Zielordner zweimal: einmal aus dem+ * gesuchten Typ, danach noch einmal aus dem NAMEN des Treffers ("flux", "wan",+ * "hunyuan" heissen `diffusion_models`). Die zweite Regel ist fuer+ * Checkpoints richtig und fuer alles andere falsch: der Name eines LoRA sagt,+ * gegen welches Basismodell es trainiert wurde, nicht welche Art Datei es ist.+ * "Flux Realism LoRA" waere damit nach `diffusion_models` geschrieben worden,+ * wo der LoraLoader nicht hinsieht. Der LoRA-Reiter in Models haette also+ * heruntergeladen, was der LoRA-Stapel in Create nie anbieten kann.+ *+ * Run: npx vitest run src/api/__tests__/ein-lora-landet-im-lora-ordner.test.ts+ */+import { describe, it, expect, vi, beforeEach } from 'vitest'++const fetchExternal = vi.fn()++vi.mock('../backend', () => ({+ backendCall: vi.fn(),+ fetchExternal: (...args: unknown[]) => fetchExternal(...args),+}))++import { searchCivitaiModels } from '../discover'++/** Eine CivitAI-Antwort mit genau einem Treffer des gegebenen Namens. */+function antwortMit(name: string): string {+ return JSON.stringify({+ items: [{+ id: 1,+ name,+ stats: { downloadCount: 10 },+ creator: { username: 'someone' },+ modelVersions: [{+ downloadUrl: 'https://civitai.com/api/download/models/1',+ files: [{ name: 'x.safetensors', sizeKB: 1024 }],+ images: [],+ }],+ }],+ })+}++beforeEach(() => { fetchExternal.mockReset() })++describe('der Zielordner eines CivitAI-Treffers', () => {+ it('THE FIX: ein LoRA geht nach loras, auch wenn "Flux" im Namen steht', async () => {+ fetchExternal.mockResolvedValue(antwortMit('Flux Realism LoRA'))+ const hits = await searchCivitaiModels('realism', 'LORA')+ expect(hits).toHaveLength(1)+ expect(hits[0].subfolder).toBe('loras')+ })++ it('und ein LoRA ohne solchen Namen genauso', async () => {+ fetchExternal.mockResolvedValue(antwortMit('Detail Enhancer'))+ const hits = await searchCivitaiModels('detail', 'LORA')+ expect(hits[0].subfolder).toBe('loras')+ })++ it('die Typfrage geht auch so an CivitAI', async () => {+ fetchExternal.mockResolvedValue(antwortMit('Detail Enhancer'))+ await searchCivitaiModels('detail', 'LORA')+ expect(fetchExternal).toHaveBeenCalledTimes(1)+ expect(String(fetchExternal.mock.calls[0][0])).toContain('types=LORA')+ })++ // GEGENPROBE: die Namensregel lebt weiter, sie gilt nur fuer Checkpoints.+ // Faellt sie ganz weg, faellt dieser Fall auf.+ it('GEGENPROBE: ein Checkpoint mit "Flux" im Namen geht weiter nach diffusion_models', async () => {+ fetchExternal.mockResolvedValue(antwortMit('Flux Dev'))+ const hits = await searchCivitaiModels('flux', 'Checkpoint')+ expect(hits[0].subfolder).toBe('diffusion_models')+ })++ it('GEGENPROBE: ein Checkpoint ohne solchen Namen bleibt bei checkpoints', async () => {+ fetchExternal.mockResolvedValue(antwortMit('Some SDXL Mix'))+ const hits = await searchCivitaiModels('sdxl', 'Checkpoint')+ expect(hits[0].subfolder).toBe('checkpoints')+ })+})diff --git a/src/api/comfyui.ts b/src/api/comfyui.tsindex 38569e15..d33b650c 100644--- a/src/api/comfyui.ts+++ b/src/api/comfyui.ts@@ -10,6 +10,7 @@ import { resolveRunSeed } from '../lib/run-seed'// comfyui-graph.ts, das nichts importiert.import { videoDecodeNode, promptFilenamePrefix } from './comfyui-graph'import type { ComfyApiGraph, ComfyApiNode, ComfyHistoryEntry } from '../types/comfy-graph'+import type { ComfyModelSource } from '../types/models'import { isRecord, asString, asRecordArray } from '../types/json-guards'// Audit W-T2: der Katalog kam bis eben per `await import('./discover')` in// getKnownFileSizes() herein, „to break the cycle at runtime". Die@@ -164,15 +165,19 @@ export interface ClassifiedModel {* take up real disk, and used to appear in no list and no counter at all* (counter-check 2026-08-29, and five more folders in the R5 re-measure* the day after). */- source: 'checkpoint' | 'diffusion_model' | 'motion_module' | AddonSource+ source: ComfyModelSource}/** The ComfyUI\models folders that hold files a user installs, none of which* is a main model. One name per folder, and INSTALLED_ADDON_LANES below is- * the single place that says which loader enumerates it. */+ * the single place that says which loader enumerates it.+ *+ * Carved out of `ComfyModelSource` (types/models.ts) rather than spelled out+ * a second time: the inventory rows carry that field into the views, and two+ * hand-written copies of one folder list is exactly the drift+ * COMFY_MODEL_FOLDERS below exists to stop. */export type AddonSource =- | 'lora' | 'vae' | 'text_encoder'- | 'clip_vision' | 'controlnet' | 'upscale_model' | 'embedding' | 'style_model'+ Exclude<ComfyModelSource, 'checkpoint' | 'diffusion_model' | 'motion_module'>/** Where a listed file actually sits, by the enum that listed it. The disk* probe needs the folder, and the delete command resolves the same set.diff --git a/src/api/discover.ts b/src/api/discover.tsindex 9445724d..86c318ec 100644--- a/src/api/discover.ts+++ b/src/api/discover.ts@@ -1791,9 +1791,14 @@ export async function searchCivitaiModels(if (type === 'LORA') subfolder = 'loras'else if (type === 'VAE') subfolder = 'vae'else if (type === 'TextualInversion') subfolder = 'embeddings'- // Check if it's a diffusion model (FLUX, Wan, etc.)+ // Check if it's a diffusion model (FLUX, Wan, etc.). Only for a+ // checkpoint search: the name of a LORA, a VAE or an embedding says+ // which base model it was trained against, not what kind of file it is,+ // so "Flux Realism LoRA" used to be written into diffusion_models, where+ // the LoRA loader does not look and the LoRA stack in Create could never+ // offer it.const name = (itemName ?? '').toLowerCase()- if (name.includes('flux') || name.includes('wan') || name.includes('hunyuan')) {+ if (type === 'Checkpoint' && (name.includes('flux') || name.includes('wan') || name.includes('hunyuan'))) {subfolder = 'diffusion_models'}diff --git a/src/components/__tests__/der-steckplatzname-steht-nirgends.test.ts b/src/components/__tests__/der-steckplatzname-steht-nirgends.test.tsindex 526ed63d..95686ae1 100644--- a/src/components/__tests__/der-steckplatzname-steht-nirgends.test.ts+++ b/src/components/__tests__/der-steckplatzname-steht-nirgends.test.ts@@ -69,6 +69,11 @@ const OHNE_STECKPLATZ = new Set(['settings/MlxMediaSettings.tsx',// Der Katalog: CivitAI- und HuggingFace-Eintraege, noch nichts Installiertes.'models/DiscoverModels.tsx',+ // Die CivitAI-Suche selbst, aus DiscoverModels herausgeloest, damit der+ // LoRA-Reiter dieselbe Karte benutzen kann statt einer Kopie. Dieselbe+ // Begruendung wie eine Zeile hoeher: ein CivitAI-Treffer ist ein Dateiname+ // auf civitai.com, kein Chat-Modell mit Steckplatz davor.+ 'models/CivitaiSearchPanel.tsx',])const portableComponentPath = (path: string) => path.replace(/\\/g, '/')diff --git a/src/components/layout/__tests__/listen-ladezustaende.test.ts b/src/components/layout/__tests__/listen-ladezustaende.test.tsindex 1df2f2e9..b64d1689 100644--- a/src/components/layout/__tests__/listen-ladezustaende.test.ts+++ b/src/components/layout/__tests__/listen-ladezustaende.test.ts@@ -41,6 +41,10 @@ const codeOnly = (src: string) =>const SKELETONS = codeOnly(read('components', 'layout', 'ViewSkeletons.tsx'))const DISCOVER = codeOnly(read('components', 'models', 'DiscoverModels.tsx'))+// Die CivitAI-Karte ist seit dem LoRA-Reiter eine eigene Komponente: dieselbe+// Karte wird zweimal benutzt (Checkpoints hier, LoRAs unter Models > LoRAs),+// und ihr Ladezustand ist deshalb auch nur noch einmal da.+const CIVITAI = codeOnly(read('components', 'models', 'CivitaiSearchPanel.tsx'))const SELECTOR = codeOnly(read('components', 'models', 'ModelSelector.tsx'))const SETTINGS = codeOnly(read('components', 'settings', 'SettingsPage.tsx'))const CSS = read('index.css')@@ -60,8 +64,8 @@ describe('an allen vier Stellen steht ein Skelett', () => {})it('2/4 — die CivitAI-Trefferliste', () => {- expect(DISCOVER).toContain('{civitaiSearching && <CivitaiResultsSkeleton />}')- expect(DISCOVER).not.toContain('Searching CivitAI...')+ expect(CIVITAI).toContain('{searching && <CivitaiResultsSkeleton />}')+ expect(CIVITAI).not.toContain('Searching CivitAI...')})it('3/4 — die Liste im Modellwaehler', () => {@@ -109,8 +113,8 @@ describe('die Skelette tragen die Geometrie der Liste, die kommt', () => {})it('die CivitAI-Zeile stimmt in Polsterung, Radius und Thumbnail-Mass', () => {- expect(DISCOVER).toContain('flex gap-3 p-3 rounded-lg')- expect(DISCOVER).toContain('w-14 h-14 rounded-lg')+ expect(CIVITAI).toContain('flex gap-3 p-3 rounded-lg')+ expect(CIVITAI).toContain('w-14 h-14 rounded-lg')const s = skeleton('CivitaiResultsSkeleton')expect(s).toContain('flex gap-3 p-3 rounded-lg')expect(s).toContain('w-14 h-14 rounded-lg')diff --git a/src/components/models/CivitaiSearchPanel.tsx b/src/components/models/CivitaiSearchPanel.tsxnew file mode 100644index 00000000..b2785b00--- /dev/null+++ b/src/components/models/CivitaiSearchPanel.tsx@@ -0,0 +1,169 @@+/**+ * The CivitAI search, as one panel that is told WHAT it searches for.+ *+ * It used to sit inline in DiscoverModels with `'Checkpoint'` typed into the+ * call, which made a second kind of search (LoRAs, for the Models > LoRAs rail)+ * a copy of ninety lines of markup. The type is a prop instead: one panel, one+ * mirror toggle, one key hint, one download path, and the folder a hit lands in+ * is decided once, in `searchCivitaiModels`, from that same type.+ */+import { useState } from 'react'+import { Search, Loader2, ExternalLink, Download, CheckCircle } from 'lucide-react'+import { searchCivitaiModels, startModelDownload, type CivitAIModelResult } from '../../api/discover'+import { openExternal } from '../../api/backend'+import { useDownloadStore } from '../../stores/downloadStore'+import { useWorkflowStore } from '../../stores/workflowStore'+import { CivitaiResultsSkeleton } from '../layout/ViewSkeletons'+import { GlassCard } from '../ui/GlassCard'+import { ProgressBar } from '../ui/ProgressBar'+import { formatBytes } from '../../lib/formatters'+import { proxyImageUrl } from '../../lib/privacy'++interface Props {+ /** What CivitAI is asked for, which is also what decides the target folder. */+ modelType: 'Checkpoint' | 'LORA'+ /** The heading on the card. */+ title: string+ /** Placeholder for the query field, so each lane can show its own examples. */+ placeholder: string+}++export function CivitaiSearchPanel({ modelType, title, placeholder }: Props) {+ const [results, setResults] = useState<CivitAIModelResult[]>([])+ const [searching, setSearching] = useState(false)+ const [query, setQuery] = useState('')+ // Track whether the *latest* CivitAI search has been issued at least once,+ // so an empty-state hint can render between "before-first-search" and+ // "search returned 0 hits". Without this we fall through to the silent gap+ // diimmortalis described: empty list, no console output, looks like the+ // button did nothing.+ const [searched, setSearched] = useState(false)+ // CivitAI mirror host (#53), civitai.red for regions where .com is blocked.+ const civitaiHost = useWorkflowStore((s) => s.civitaiHost)+ const setCivitaiHost = useWorkflowStore((s) => s.setCivitaiHost)+ const downloads = useDownloadStore((s) => s.downloads)+ const dlStore = useDownloadStore++ const runSearch = async () => {+ if (!query.trim()) return+ setSearching(true)+ setSearched(true)+ // The CivitAI API key the user configured in Settings, AI Backends,+ // CivitAI API key. The search and the download path share that one+ // credential, so there is no second input here.+ const apiKey = useWorkflowStore.getState().civitaiApiKey || undefined+ const host = useWorkflowStore.getState().civitaiHost+ const hits = await searchCivitaiModels(query, modelType, apiKey, host)+ setResults(hits)+ setSearching(false)+ }++ const download = async (model: CivitAIModelResult) => {+ if (!model.downloadUrl || !model.filename || !model.subfolder) return+ dlStore.getState().setMeta(model.filename, model.downloadUrl, model.subfolder)+ await startModelDownload(model.downloadUrl, model.subfolder, model.filename)+ dlStore.getState().startPolling()+ }++ return (+ <GlassCard className="p-4 space-y-3">+ <div className="flex items-center justify-between gap-2">+ <h3 className="text-sm font-semibold text-gray-900 dark:text-white">{title}</h3>+ {/* Mirror toggle (#53), civitai.red for regions where .com is blocked. */}+ <div className="flex items-center gap-1 t-micro">+ <span className="text-gray-400 dark:text-gray-500 mr-0.5">mirror</span>+ {(['civitai.com', 'civitai.red'] as const).map((h) => (+ <button+ key={h}+ onClick={() => setCivitaiHost(h)}+ title={h === 'civitai.red'+ ? 'Use the civitai.red mirror for regions where civitai.com is blocked'+ : 'Use civitai.com (default)'}+ className={+ 'px-1.5 py-0.5 rounded font-mono transition-colors ' ++ (civitaiHost === h+ ? 'bg-gray-200 dark:bg-white/15 text-gray-900 dark:text-white'+ : 'text-gray-400 hover:text-gray-700 dark:hover:text-gray-200')+ }+ >+ {h.replace('civitai', '')}+ </button>+ ))}+ </div>+ </div>+ <div className="flex gap-2 w-full sm:w-2/3 lg:w-1/2 mx-auto">+ <input+ value={query}+ onChange={(e) => setQuery(e.target.value)}+ onKeyDown={(e) => e.key === 'Enter' && runSearch()}+ placeholder={placeholder}+ aria-label={title}+ className="flex-1 px-3 py-2 rounded-lg bg-gray-100 dark:bg-white/5 border border-gray-200 dark:border-white/10 text-sm text-gray-900 dark:text-white placeholder-gray-500 focus:outline-none focus:border-gray-400 dark:focus:border-white/20"+ />+ <button+ onClick={runSearch}+ disabled={searching || !query.trim()}+ aria-label="Search CivitAI"+ className="px-3 py-2 rounded-lg bg-gray-100 dark:bg-white/10 hover:bg-gray-200 dark:hover:bg-white/15 disabled:opacity-50 text-gray-700 dark:text-white transition-colors"+ >+ {searching ? <Loader2 size={16} className="animate-spin" /> : <Search size={16} />}+ </button>+ </div>++ {results.length > 0 && (+ <div className="space-y-2 max-h-[50vh] overflow-y-auto">+ {results.map((model) => {+ const dlState = model.filename ? downloads[model.filename] : null+ const isDl = dlState?.status === 'downloading' || dlState?.status === 'connecting'+ const isDone = dlState?.status === 'complete'++ return (+ <div key={model.id} className="flex gap-3 p-3 rounded-lg bg-gray-50 dark:bg-white/5 border border-gray-200 dark:border-white/10">+ {model.thumbnailUrl && (+ <img src={proxyImageUrl(model.thumbnailUrl)} alt="" className="w-14 h-14 rounded-lg object-cover flex-shrink-0" loading="lazy" />+ )}+ <div className="flex-1 min-w-0">+ <div className="flex items-center gap-2">+ <span className="text-sm font-medium text-gray-900 dark:text-white truncate">{model.name}</span>+ {model.sizeGB && <span className="t-micro text-gray-400 flex-shrink-0">{model.sizeGB} GB</span>}+ </div>+ {model.description && <p className="t-micro text-gray-500 line-clamp-1 mt-0.5">{model.description}</p>}+ {isDl && dlState && dlState.total > 0 && (+ <div className="mt-1.5">+ <ProgressBar progress={(dlState.progress / dlState.total) * 100} />+ <span className="t-micro text-gray-400">{formatBytes(dlState.progress)} / {formatBytes(dlState.total)}</span>+ </div>+ )}+ </div>+ <div className="flex items-center gap-1 shrink-0">+ {isDone ? (+ <CheckCircle size={16} className="text-green-500" />+ ) : isDl ? (+ <Loader2 size={16} className="animate-spin text-gray-400" />+ ) : model.downloadUrl ? (+ <button onClick={() => download(model)} className="p-2 rounded-lg bg-green-100 dark:bg-green-500/15 hover:bg-green-200 dark:hover:bg-green-500/25 text-green-700 dark:text-green-400 transition-colors" title="Download" aria-label="Download">+ <Download size={14} />+ </button>+ ) : null}+ <button onClick={() => openExternal(model.sourceUrl)} className="p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-white/10 text-gray-500 transition-colors" title="View on CivitAI" aria-label="View on CivitAI">+ <ExternalLink size={14} />+ </button>+ </div>+ </div>+ )+ })}+ </div>+ )}++ {/* Listen-Ladezustand 2 von 4: dieselbe Begruendung eine Karte weiter+ oben, nur mit der Zeilengeometrie der Trefferliste. */}+ {searching && <CivitaiResultsSkeleton />}+ {!searching && searched && results.length === 0 && (+ <div className="text-center py-4 t-micro text-gray-500 leading-relaxed">+ No matches for "{query}". Try a broader query. The full catalog needs your key,+ which you set under Settings > AI Backends > CivitAI API key.+ </div>+ )}+ </GlassCard>+ )+}diff --git a/src/components/models/DiscoverModels.tsx b/src/components/models/DiscoverModels.tsxindex c9cc9edc..dc5b6898 100644--- a/src/components/models/DiscoverModels.tsx+++ b/src/components/models/DiscoverModels.tsx@@ -2,27 +2,26 @@ import { useCallback, useState, useEffect, useRef } from 'react'import { chatRecommendationGroups, isBelowChatMinimum, SMALL_CHAT_MODEL_WARNING } from '../../lib/chat-model-minimum'import { bundleIsComplete, bundleIsDownloading, bundleHasErrors } from '../../lib/bundle-state'import { motion } from 'framer-motion'-import { Search, XCircle, Loader2, Sparkles, Unlock, ShieldCheck, ExternalLink, Download, CheckCircle, Info } from 'lucide-react'+import { Search, XCircle, Sparkles, Unlock, ShieldCheck, ExternalLink, Info } from 'lucide-react'import { X } from 'lucide-react'import {searchHuggingFaceModels,getImageBundles, getVideoBundles,getUncensoredTextModels, getMainstreamTextModels,detectProviderModelPath, startModelDownloadToPath, luEngineDownloadDir,- startModelDownload, searchCivitaiModels,+ startModelDownload,installBundleComplete, checkBundlesInstalled, resolveHfGgufFiles, planModelDownload,- type DiscoverModel, type DownloadProgress, type ModelBundle, type CivitAIModelResult, type HfGgufFile,+ type DiscoverModel, type DownloadProgress, type ModelBundle, type HfGgufFile,} from '../../api/discover'import { getSystemVRAM } from '../../api/comfyui'import { getMaxVramGb, getTotalRamGb, bundleVramNeedGb } from '../../lib/hardware'import { openExternal } from '../../api/backend'import { useModels } from '../../hooks/useModels'import { useDownloadStore } from '../../stores/downloadStore'-import { CivitaiResultsSkeleton, ModelGridSkeleton } from '../layout/ViewSkeletons'+import { ModelGridSkeleton } from '../layout/ViewSkeletons'import { useProviderStore } from '../../stores/providerStore'import { useSettingsStore } from '../../stores/settingsStore'import { useModelStore } from '../../stores/modelStore'-import { useWorkflowStore } from '../../stores/workflowStore'import { getProviderIdFromModel } from '../../api/providers'import { activateDownloadedBundledModel } from '../../lib/bundled-download-activation'import { diagnoseBuiltinEngine } from '../../api/builtin-ensure'@@ -34,19 +33,17 @@ import { LuEngineSwitchBar } from '../chat/LuEngineSwitchBar'import { resolveTextDownloadTarget } from '../../lib/text-download-target'import { hfUrlToOllamaRef, hfUrlToLmStudioSubdir, parseHfUrl, extractGgufQuant, isShardedOrIncompatibleGguf } from '../../lib/hf-to-provider'import { HINWEIS_TEXT } from '../../lib/hinweis'-import { GlassCard } from '../ui/GlassCard'import { GlowButton } from '../ui/GlowButton'-import { ProgressBar } from '../ui/ProgressBar'import { Modal } from '../ui/Modal'-import { formatBytes, countLabel } from '../../lib/formatters'+import { countLabel } from '../../lib/formatters'import type { ModelCategory } from '../../types/models'-import { proxyImageUrl } from '../../lib/privacy'import { log } from '../../lib/logger'import {ModelTile, BundleTile, HardwareChip, groupModels, pickDefaultVariant, computeFit,CapLegend,} from './ModelTiles'import { ICON_SM } from '../ui/icon-size'+import { CivitaiSearchPanel } from './CivitaiSearchPanel'interface Props {category: ModelCategory@@ -221,18 +218,6 @@ export function awaitDownloadedFile(}export function DiscoverModels({ category, search = '', searchSubmitToken = 0 }: Props) {- const [civitaiResults, setCivitaiResults] = useState<CivitAIModelResult[]>([])- const [civitaiSearching, setCivitaiSearching] = useState(false)- const [civitaiQuery, setCivitaiQuery] = useState('')- // Track whether the *latest* CivitAI search has been issued at least once,- // so an empty-state hint can render between "before-first-search" and- // "search returned 0 hits". Without this we fall through to the silent gap- // diimmortalis described — empty list, no console output, looks like the- // button did nothing.- const [civitaiSearched, setCivitaiSearched] = useState(false)- // CivitAI mirror host (#53) — civitai.red for regions where .com is blocked.- const civitaiHost = useWorkflowStore((s) => s.civitaiHost)- const setCivitaiHost = useWorkflowStore((s) => s.setCivitaiHost)const [loading, setLoading] = useState(false)const [systemVRAM, setSystemVRAM] = useState<number | null>(null)const [ramGb, setRamGb] = useState<number | null>(null)@@ -498,27 +483,6 @@ export function DiscoverModels({ category, search = '', searchSubmitToken = 0 }:setTimeout(waitForDownloads, 1000)}- const handleCivitaiSearch = async () => {- if (!civitaiQuery.trim()) return- setCivitaiSearching(true)- setCivitaiSearched(true)- // Reuse the CivitAI API key the user already configured for the Workflow- // finder. The model search and the workflow finder share the same backend- // credential, so plumbing a separate input here would just confuse users.- const apiKey = useWorkflowStore.getState().civitaiApiKey || undefined- const host = useWorkflowStore.getState().civitaiHost- const results = await searchCivitaiModels(civitaiQuery, 'Checkpoint', apiKey, host)- setCivitaiResults(results)- setCivitaiSearching(false)- }-- const handleCivitaiDownload = async (model: CivitAIModelResult) => {- if (!model.downloadUrl || !model.filename || !model.subfolder) return- dlStore.getState().setMeta(model.filename, model.downloadUrl, model.subfolder)- await startModelDownload(model.downloadUrl, model.subfolder, model.filename)- dlStore.getState().startPolling()- }-// The three card states live in lib/bundle-state.ts, pure, because bundles// share files and the reasoning about whose row is whose is the whole of// GH #113. See that file for what one shared row used to do to this list.@@ -1018,105 +982,14 @@ export function DiscoverModels({ category, search = '', searchSubmitToken = 0 }:<p className="text-center text-gray-500 py-4 text-sm">No models match this size filter. Try a different one.</p>)}- {/* CivitAI Search (Image & Video) */}+ {/* CivitAI Search (Image & Video). Checkpoints here; the LoRA rail+ renders the same panel with type LORA. */}{(isImage || isVideo) && (- <GlassCard className="p-4 space-y-3">- <div className="flex items-center justify-between gap-2">- <h3 className="text-sm font-semibold text-gray-900 dark:text-white">Search CivitAI</h3>- {/* Mirror toggle (#53) — civitai.red for regions where .com is blocked. */}- <div className="flex items-center gap-1 t-micro">- <span className="text-gray-400 dark:text-gray-500 mr-0.5">mirror</span>- {(['civitai.com', 'civitai.red'] as const).map((h) => (- <button- key={h}- onClick={() => setCivitaiHost(h)}- title={h === 'civitai.red'- ? 'Use the civitai.red mirror for regions where civitai.com is blocked'- : 'Use civitai.com (default)'}- className={- 'px-1.5 py-0.5 rounded font-mono transition-colors ' +- (civitaiHost === h- ? 'bg-gray-200 dark:bg-white/15 text-gray-900 dark:text-white'- : 'text-gray-400 hover:text-gray-700 dark:hover:text-gray-200')- }- >- {h.replace('civitai', '')}- </button>- ))}- </div>- </div>- <div className="flex gap-2 w-full sm:w-2/3 lg:w-1/2 mx-auto">- <input- value={civitaiQuery}- onChange={(e) => setCivitaiQuery(e.target.value)}- onKeyDown={(e) => e.key === 'Enter' && handleCivitaiSearch()}- placeholder="e.g. flux, sdxl realistic, anime..."- className="flex-1 px-3 py-2 rounded-lg bg-gray-100 dark:bg-white/5 border border-gray-200 dark:border-white/10 text-sm text-gray-900 dark:text-white placeholder-gray-500 focus:outline-none focus:border-gray-400 dark:focus:border-white/20"- />- <button- onClick={handleCivitaiSearch}- disabled={civitaiSearching || !civitaiQuery.trim()}- className="px-3 py-2 rounded-lg bg-gray-100 dark:bg-white/10 hover:bg-gray-200 dark:hover:bg-white/15 disabled:opacity-50 text-gray-700 dark:text-white transition-colors"- >- {civitaiSearching ? <Loader2 size={16} className="animate-spin" /> : <Search size={16} />}- </button>- </div>-- {civitaiResults.length > 0 && (- <div className="space-y-2 max-h-[50vh] overflow-y-auto">- {civitaiResults.map((model) => {- const dlState = model.filename ? downloads[model.filename] : null- const isDl = dlState?.status === 'downloading' || dlState?.status === 'connecting'- const isDone = dlState?.status === 'complete'-- return (- <div key={model.id} className="flex gap-3 p-3 rounded-lg bg-gray-50 dark:bg-white/5 border border-gray-200 dark:border-white/10">- {model.thumbnailUrl && (- <img src={proxyImageUrl(model.thumbnailUrl)} alt="" className="w-14 h-14 rounded-lg object-cover flex-shrink-0" loading="lazy" />- )}- <div className="flex-1 min-w-0">- <div className="flex items-center gap-2">- <span className="text-sm font-medium text-gray-900 dark:text-white truncate">{model.name}</span>- {model.sizeGB && <span className="t-micro text-gray-400 flex-shrink-0">{model.sizeGB} GB</span>}- </div>- {model.description && <p className="t-micro text-gray-500 line-clamp-1 mt-0.5">{model.description}</p>}- {isDl && dlState && dlState.total > 0 && (- <div className="mt-1.5">- <ProgressBar progress={(dlState.progress / dlState.total) * 100} />- <span className="t-micro text-gray-400">{formatBytes(dlState.progress)} / {formatBytes(dlState.total)}</span>- </div>- )}- </div>- <div className="flex items-center gap-1 shrink-0">- {isDone ? (- <CheckCircle size={16} className="text-green-500" />- ) : isDl ? (- <Loader2 size={16} className="animate-spin text-gray-400" />- ) : model.downloadUrl ? (- <button onClick={() => handleCivitaiDownload(model)} className="p-2 rounded-lg bg-green-100 dark:bg-green-500/15 hover:bg-green-200 dark:hover:bg-green-500/25 text-green-700 dark:text-green-400 transition-colors" title="Download" aria-label="Download">- <Download size={14} />- </button>- ) : null}- <button onClick={() => openExternal(model.sourceUrl)} className="p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-white/10 text-gray-500 transition-colors" title="View on CivitAI" aria-label="View on CivitAI">- <ExternalLink size={14} />- </button>- </div>- </div>- )- })}- </div>- )}-- {/* Listen-Ladezustand 2 von 4 — dieselbe Begruendung eine Karte- weiter oben, nur mit der Zeilengeometrie der Trefferliste. */}- {civitaiSearching && <CivitaiResultsSkeleton />}- {!civitaiSearching && civitaiSearched && civitaiResults.length === 0 && (- <div className="text-center py-4 t-micro text-gray-500 leading-relaxed">- No matches for "{civitaiQuery}". Try a broader query, or add your CivitAI API key- in the Workflow finder for the full catalog.- </div>- )}- </GlassCard>+ <CivitaiSearchPanel+ modelType="Checkpoint"+ title="Search CivitAI"+ placeholder="e.g. flux, sdxl realistic, anime..."+ />)}{/* ── D-S26 · „Keine Virtualisierung: 53 Karten = 1610 DOM-Knoten,diff --git a/src/components/models/LoraManager.tsx b/src/components/models/LoraManager.tsxnew file mode 100644index 00000000..07cb2796--- /dev/null+++ b/src/components/models/LoraManager.tsx@@ -0,0 +1,106 @@+/**+ * The Installed half of Models > LoRAs.+ *+ * A LoRA is not a model you switch to, it is a file the LoRA stack in Create+ * layers on top of one, so this list carries no Use button and nothing here+ * can be made the active model. What it does carry is the two things the user+ * came for: what each file weighs, and a way to take one off the disk again.+ *+ * The rows come from the same ComfyUI inventory the Image tab reads (they are+ * the `source: 'lora'` half of it), so there is no second reader and no second+ * answer about what is installed.+ */+import { Layers, Trash2 } from 'lucide-react'+import { parseLocalCharacterLora } from '../../api/trainer'+import { formatBytes } from '../../lib/formatters'++export interface LoraRow {+ name: string+ /** Bytes on disk, 0 when the size probe could not answer. */+ size: number+}++interface Props {+ rows: LoraRow[]+ /** Opens the shared delete confirmation of the Models view. */+ onDelete: (name: string) => void+ /** Sends the user to the Get new segment of this same rail. */+ onGetNew: () => void+}++/** The one sentence that says where a downloaded LoRA is actually used. The+ * three names are the labels Create really shows: the drawer is titled+ * "Advanced settings" (AdvancedDrawer.tsx), the group inside it "Expert" and+ * the list "LoRA stack" (ParamGroups.tsx). */+export const LORA_USE_HINT = 'Use them in Create, Advanced settings, Expert, LoRA stack.'++export function LoraManager({ rows, onDelete, onGetNew }: Props) {+ if (rows.length === 0) {+ return (+ <div className="flex flex-col items-center justify-center text-center py-16 px-6 gap-3">+ <div className="w-14 h-14 rounded-full bg-gray-100 dark:bg-white/[0.04] border border-gray-200 dark:border-white/[0.06] flex items-center justify-center">+ <Layers size={28} className="text-gray-400 dark:text-gray-500" />+ </div>+ <div className="space-y-1">+ <p className="text-[12px] font-medium text-gray-800 dark:text-gray-200">No LoRAs installed yet</p>+ <p className="t-micro text-gray-500 max-w-[300px] leading-relaxed">+ Get new searches CivitAI and puts what you pick into ComfyUI's models/loras folder. {LORA_USE_HINT}+ </p>+ </div>+ <button+ onClick={onGetNew}+ className="flex items-center gap-1.5 mt-1 px-3 py-1.5 rounded-md bg-gray-900 dark:bg-white/10 hover:bg-gray-800 dark:hover:bg-white/15 text-white t-micro font-medium transition-colors"+ >+ <Layers size={11} /> Get new LoRAs+ </button>+ </div>+ )+ }++ return (+ <section className="space-y-1.5">+ <div className="flex items-center gap-2 px-1">+ <Layers size={11} />+ <h2 className="t-micro font-semibold uppercase tracking-[0.12em] text-gray-700 dark:text-gray-300">LoRAs</h2>+ <span className="text-[0.55rem] text-gray-400 dark:text-gray-500 tabular-nums">{rows.length}</span>+ <div className="flex-1 h-px bg-gray-200 dark:bg-white/[0.06]" />+ </div>+ <p className="px-1 text-[0.55rem] text-gray-500 dark:text-gray-500">{LORA_USE_HINT}</p>+ <div className="space-y-1.5">+ {rows.map((row) => {+ const character = parseLocalCharacterLora(row.name)+ return (+ <div+ key={row.name}+ data-testid="lora-row"+ className="flex items-center gap-3 px-3 py-2 rounded-lg border border-gray-200 dark:border-white/[0.06] bg-white dark:bg-white/[0.02]"+ >+ <div className="min-w-0 flex-1">+ <div className="flex items-center gap-2">+ <span className="truncate text-[0.72rem] text-gray-900 dark:text-gray-100">{row.name}</span>+ {character && (+ <span className="shrink-0 px-1.5 py-0.5 rounded t-micro border border-lu-accent/30 bg-lu-accent-soft text-lu-accent-edge dark:text-lu-accent">+ Character+ </span>+ )}+ </div>+ <div className="flex items-center gap-2 mt-0.5 t-micro text-gray-500 dark:text-gray-500">+ {row.size > 0 && <span className="tabular-nums">{formatBytes(row.size)}</span>}+ {character && <span className="font-mono">Trigger word: {character.trigger}</span>}+ </div>+ </div>+ <button+ onClick={() => onDelete(row.name)}+ title="Delete"+ aria-label={`Delete ${row.name}`}+ className="shrink-0 p-1.5 rounded-lg text-gray-400 hover:text-red-500 hover:bg-gray-100 dark:hover:bg-white/10 transition-colors"+ >+ <Trash2 size={13} />+ </button>+ </div>+ )+ })}+ </div>+ </section>+ )+}diff --git a/src/components/models/ModelManager.tsx b/src/components/models/ModelManager.tsxindex 5c2ee851..0cc22165 100644--- a/src/components/models/ModelManager.tsx+++ b/src/components/models/ModelManager.tsx@@ -3,7 +3,7 @@ import { motion } from 'framer-motion'import {Download, ArrowLeft, RefreshCw, Search, MessagesSquare, Images, Clapperboard,X as XIcon, HardDrive, Sparkles, PackageOpen, Video as VideoIcon, Image as ImageIcon,- Settings as SettingsIcon,+ Settings as SettingsIcon, Layers,} from 'lucide-react'import { useModels } from '../../hooks/useModels'import { useModelStore } from '../../stores/modelStore'@@ -12,6 +12,8 @@ import { useProviderStore } from '../../stores/providerStore'import { ModelCard } from './ModelCard'import { PullModelDialog } from './PullModelDialog'import { DiscoverModels } from './DiscoverModels'+import { CivitaiSearchPanel } from './CivitaiSearchPanel'+import { LoraManager, LORA_USE_HINT, type LoraRow } from './LoraManager'import { Modal } from '../ui/Modal'import { GlowButton } from '../ui/GlowButton'import { showModel } from '../../api/ollama'@@ -33,6 +35,12 @@ import type { ModelCategory, AIModel } from '../../types/models'// discoverMode/categoryFilter pair collapsed into the persisted store value.type Mode = Extract<ModelCategory, 'text' | 'image' | 'video'>+/** The rail has one entry the store's `categoryFilter` cannot hold: LoRAs are+ * not a fourth model category, they are the add-on files that sit beside the+ * image models. So the rail selection is Mode PLUS that one lane, and only+ * the three real categories are written back into the store. */+type Rail = Mode | 'lora'+// Monochrome on purpose — the active state is carried by the pill background,// not by per-category accent colors (David 2026-07-17 design pass).const RAIL_ITEMS: { key: Mode; label: string; icon: typeof MessagesSquare }[] = [@@ -41,6 +49,18 @@ const RAIL_ITEMS: { key: Mode; label: string; icon: typeof MessagesSquare }[] ={ key: 'video', label: 'Video', icon: Clapperboard },]+/** The fourth rail entry, under Image and Video because that is what its files+ * attach to. Its own item rather than a member of RAIL_ITEMS above: that list+ * is typed on the store's category and this one is not a category. */+const LORA_RAIL = { key: 'lora' as const, label: 'LoRAs', icon: Layers }++/** A row of the ComfyUI inventory that came out of the loras folder. The field+ * is carried all the way from `api/comfyui`'s addon lanes (useModels keeps it+ * now); without it a LoRA and a checkpoint are the same shape. */+export function isLoraRow(m: AIModel): boolean {+ return 'source' in m && m.source === 'lora'+}+/** The mark a counter wears while it has nothing counted to show. Not a 0:* a 0 next to a card that reads Installed is a wrong answer, and this one* stood for five seconds on the real box (Befund 2, 2026-08-29). */@@ -117,7 +137,14 @@ export function ModelManager() {(categoryFilter === 'text' || categoryFilter === 'image' || categoryFilter === 'video')? categoryFilter: 'text'- const showMlxPanel = macMlxMedia && (mode === 'image' || mode === 'video')+ // The LoRA lane is ComfyUI's loras folder and nothing else. On the Mac local+ // media is MLX, which has no LoRA folder to list and no CivitAI target to+ // download into, so the rail is not offered there at all rather than offered+ // and dead. Windows and Linux both get it.+ const loraRailOffered = !macMlxMedia+ const [loraRail, setLoraRail] = useState(false)+ const rail: Rail = loraRail && loraRailOffered ? 'lora' : mode+ const showMlxPanel = macMlxMedia && (mode === 'image' || mode === 'video') && rail !== 'lora'useEffect(() => {fetchModels()@@ -187,8 +214,18 @@ export function ModelManager() {}}- const filteredModels = models.filter((m: AIModel) => m.type === mode)+ // LoRAs are ComfyUI files of type 'image' and used to sit in this list+ // between the checkpoints, with no word saying what they were and a click+ // that made one the ACTIVE image model. They have their own rail now, so+ // they leave this one. Only the LoRA lane is taken out: the VAEs, text+ // encoders and the rest of the addon folders stay exactly where they were,+ // since nothing else has a place to go to.+ const loraModels = models.filter((m: AIModel) => isLoraRow(m))+ const loraRows: LoraRow[] = loraModels.map((m) => ({ name: m.name, size: m.size ?? 0 }))+ const filteredModels = models.filter((m: AIModel) => m.type === mode && !isLoraRow(m))const modeMeta = RAIL_ITEMS.find(r => r.key === mode)!+ /** What the Installed counter and the Installed view are about right now. */+ const installedCount = rail === 'lora' ? loraRows.length : filteredModels.length// One rule for the rail badges and the Installed badge, so the two can// never again disagree about what an uncounted lane looks like.const inventoryState = { loaded: inventoryLoaded, refreshing: inventoryRefreshing }@@ -203,8 +240,11 @@ export function ModelManager() {// so we can show the real reason instead of a misleading "no models installed".const [comfyReachable, setComfyReachable] = useState<boolean | null>(null)const imageOrVideo = mode === 'image' || mode === 'video'+ // The LoRA lane is served by the same engine and empties for the same+ // reason, so it asks the same question and shows the same answer.+ const comfyBackedLane = rail === 'lora' || imageOrVideouseEffect(() => {- if (!(tab === 'installed' && imageOrVideo && filteredModels.length === 0)) return+ if (!(tab === 'installed' && comfyBackedLane && installedCount === 0)) returnlet alive = true// Reset to "probing" on every (re)check — e.g. switching image<->video, or// re-entering an empty mode after ComfyUI went down. Without this the prior@@ -215,7 +255,7 @@ export function ModelManager() {.then((ok) => { if (alive) setComfyReachable(ok) }).catch(() => { if (alive) setComfyReachable(false) })return () => { alive = false }- }, [tab, imageOrVideo, filteredModels.length])+ }, [tab, comfyBackedLane, installedCount])// ── Render ──────────────────────────────────────────────────────@@ -223,13 +263,22 @@ export function ModelManager() {<div className="h-full flex overflow-hidden">{/* Category rail — the big, labeled home of Chat / Image / Video */}<aside className="shrink-0 w-12 lg:w-36 border-r border-gray-200 dark:border-white/[0.06] bg-gray-50/60 dark:bg-white/[0.015] flex flex-col py-3 px-1.5 lg:px-2 gap-1">- {RAIL_ITEMS.map(({ key, label, icon: Icon }) => {- const active = mode === key- const badge = counterView(models.filter((m) => m.type === key).length, inventoryState)+ {[...RAIL_ITEMS, ...(loraRailOffered ? [LORA_RAIL] : [])].map(({ key, label, icon: Icon }) => {+ const active = rail === key+ const badge = counterView(+ key === 'lora'+ ? loraRows.length+ : models.filter((m) => m.type === key && !isLoraRow(m)).length,+ inventoryState,+ )return (<buttonkey={key}- onClick={() => setCategoryFilter(key)}+ onClick={() => {+ if (key === 'lora') { setLoraRail(true); return }+ setLoraRail(false)+ setCategoryFilter(key)+ }}title={label}aria-pressed={active}className={`flex items-center justify-center lg:justify-start gap-2 px-2 py-2 rounded-lg transition-colors ${@@ -244,7 +293,7 @@ export function ModelManager() {</span>{badge.kind === 'loading' ? (<span className="hidden lg:block ml-auto">- <CountingDots label={`Counting installed ${label.toLowerCase()} models`} />+ <CountingDots label={key === 'lora' ? 'Counting installed LoRAs' : `Counting installed ${label.toLowerCase()} models`} /></span>) : badge.value > 0 ? (<span className="hidden lg:block ml-auto text-[0.55rem] text-gray-400 dark:text-gray-500 tabular-nums">{badge.value}</span>@@ -298,7 +347,7 @@ export function ModelManager() {><HardDrive size={11} /> Installed{(() => {- const badge = counterView(filteredModels.length, inventoryState)+ const badge = counterView(installedCount, inventoryState)return badge.kind === 'loading' ? (<CountingDots label="Counting installed models" />) : (@@ -359,14 +408,14 @@ export function ModelManager() {{!showMlxPanel && tab === 'installed' && (<>- {counterView(filteredModels.length, inventoryState).kind === 'loading' ? (+ {counterView(installedCount, inventoryState).kind === 'loading' ? (// The empty state is the same claim the counter makes, in// words: you own none of these. It waits for the count for// the same reason (Befund 2, abnahme counter-check).<div className="text-center py-16 px-6"><p className="text-[0.7rem] text-gray-500">Reading your installed models…</p></div>- ) : imageOrVideo && filteredModels.length === 0 && comfyReachable !== true ? (+ ) : comfyBackedLane && installedCount === 0 && comfyReachable !== true ? (// comfyReachable: null = still probing, false = confirmed down.// Never show the misleading "no models installed" here while the// probe is pending — on desktop checkComfyConnection has to time@@ -379,12 +428,16 @@ export function ModelManager() {) : (<div className="flex flex-col items-center justify-center text-center py-16 px-6 gap-3"><div className="w-14 h-14 rounded-full bg-gray-100 dark:bg-white/[0.04] border border-gray-200 dark:border-white/[0.06] flex items-center justify-center">- {mode === 'video' ? <VideoIcon size={28} className="text-gray-400 dark:text-gray-500" /> : <ImageIcon size={28} className="text-gray-400 dark:text-gray-500" />}+ {rail === 'lora'+ ? <Layers size={28} className="text-gray-400 dark:text-gray-500" />+ : mode === 'video' ? <VideoIcon size={28} className="text-gray-400 dark:text-gray-500" /> : <ImageIcon size={28} className="text-gray-400 dark:text-gray-500" />}</div><div className="space-y-1">- <p className="text-[12px] font-medium text-gray-800 dark:text-gray-200">Start ComfyUI to see your {mode} models</p>+ {/* The LoRA lane hangs off the same engine, so it gets the+ same state and the same sentence, with its own noun. */}+ <p className="text-[12px] font-medium text-gray-800 dark:text-gray-200">Start ComfyUI to see your {rail === 'lora' ? 'LoRA' : mode} models</p><p className="t-micro text-gray-500 max-w-[300px] leading-relaxed">- {mode === 'image' ? 'Image' : 'Video'} models are served by ComfyUI, which isn't running right now, so the ones you've downloaded can't be listed yet. Open Settings, go to AI Backends, and press Start under ComfyUI (Image & Video), then come back.+ {rail === 'lora' ? 'LoRA' : mode === 'image' ? 'Image' : 'Video'} models are served by ComfyUI, which isn't running right now, so the ones you've downloaded can't be listed yet. Open Settings, go to AI Backends, and press Start under ComfyUI (Image & Video), then come back.</p></div>{/* Nebenbefund 3, R8 re-measure: the sentence above names a@@ -400,6 +453,12 @@ export function ModelManager() {</button></div>)+ ) : rail === 'lora' ? (+ <LoraManager+ rows={searchQuery ? loraRows.filter((r) => installedRowMatchesSearch(r.name, searchQuery)) : loraRows}+ onDelete={(name) => setConfirmDelete(name)}+ onGetNew={() => setTab('discover')}+ />) : models.length === 0 ? (<div className="flex flex-col items-center justify-center text-center py-16 px-6 gap-3"><div className="w-14 h-14 rounded-full bg-gray-100 dark:bg-white/[0.04] border border-gray-200 dark:border-white/[0.06] flex items-center justify-center">@@ -549,11 +608,28 @@ export function ModelManager() {)}{!showMlxPanel && tab === 'discover' && (- <DiscoverModels- category={mode}- search={searchQuery}- searchSubmitToken={searchSubmitToken}- />+ rail === 'lora' ? (+ // Same panel as the checkpoint search one rail up, asked for a+ // different type. The folder a hit lands in follows from that+ // type inside searchCivitaiModels, so there is no second place+ // that decides where a LoRA is written.+ <div className="space-y-2">+ <p className="px-1 t-micro text-gray-500 dark:text-gray-500">+ Downloads land in ComfyUI's models/loras folder. {LORA_USE_HINT}+ </p>+ <CivitaiSearchPanel+ modelType="LORA"+ title="Search CivitAI for LoRAs"+ placeholder="e.g. detail enhancer, pixel art, film grain..."+ />+ </div>+ ) : (+ <DiscoverModels+ category={mode}+ search={searchQuery}+ searchSubmitToken={searchSubmitToken}+ />+ ))}</div></div>diff --git a/src/components/models/__tests__/die-loras-haben-einen-eigenen-reiter.test.tsx b/src/components/models/__tests__/die-loras-haben-einen-eigenen-reiter.test.tsxnew file mode 100644index 00000000..4c6e80e4--- /dev/null+++ b/src/components/models/__tests__/die-loras-haben-einen-eigenen-reiter.test.tsx@@ -0,0 +1,329 @@+/**+ * @vitest-environment jsdom+ *+ * Models bekommt einen vierten Eintrag in der linken Leiste: LoRAs.+ *+ * Vorher war der Befund zweigeteilt. Die LoRAs waren im Bild-Reiter zwischen+ * den Checkpoints einsortiert, ohne ein Wort darueber, was sie sind, und ein+ * Klick darauf machte eine LoRA-Datei zum AKTIVEN Bildmodell, also zu etwas,+ * was sie nicht sein kann. Und die CivitAI-Suche daneben fragte hart nach+ * 'Checkpoint', obwohl die API und der Downloadweg LoRAs laengst konnten.+ *+ * Gemessen wird hier beides an der gerenderten Seite, nicht an der Quelle:+ * die Leiste, die Liste, der Groessentext, der Charakter-Chip samt+ * Triggerwort, der Loeschweg samt Abbruch ueber X und Escape, und die+ * Typfrage, die der Get-new-Reiter an CivitAI stellt.+ *+ * Run: npx vitest run src/components/models/__tests__/die-loras-haben-einen-eigenen-reiter.test.tsx+ */+import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'+import { createElement } from 'react'+import { render, screen, fireEvent, cleanup, waitFor, within } from '@testing-library/react'+import { readFileSync } from 'node:fs'+import { resolve } from 'node:path'+import type { AIModel } from '../../../types/models'++// ── Der Unterbau, den die Seite anfasst ────────────────────────────────++const backendCall = vi.fn(async () => ({ status: 'deleted' }))+const searchCivitaiModels = vi.fn(async () => [] as unknown[])+const startModelDownload = vi.fn(async () => ({ status: 'ok', id: '1' }))+const setActiveModel = vi.fn(async () => {})+const fetchModels = vi.fn(async () => {})+let macHost = false+let comfyLaeuft = true++vi.mock('../../../api/backend', () => ({+ backendCall: (...a: unknown[]) => backendCall(...(a as [])),+ openExternal: vi.fn(),+ isTauri: () => false,+ isMacOS: () => false,+}))+vi.mock('../../../api/discover', () => ({+ searchCivitaiModels: (...a: unknown[]) => searchCivitaiModels(...(a as [])),+ startModelDownload: (...a: unknown[]) => startModelDownload(...(a as [])),+}))+vi.mock('../../../api/comfyui', () => ({+ checkComfyConnection: vi.fn(async () => comfyLaeuft),+ refreshComfyModels: vi.fn(async () => {}),+}))+vi.mock('../../../api/mlx-image', () => ({ isMlxImageHost: () => macHost }))+vi.mock('../../../api/ollama', () => ({ showModel: vi.fn(async () => ({})) }))+vi.mock('../../../api/engine', () => ({+ customModelDirs: () => [],+ deleteBundledModel: vi.fn(),+ stopBundledEngine: vi.fn(),+}))+vi.mock('../../settings/MlxMediaSettings', () => ({ MlxMediaSettings: () => createElement('div', null, 'mlx-panel') }))+vi.mock('../DiscoverModels', () => ({ DiscoverModels: () => createElement('div', null, 'discover-panel') }))+vi.mock('../../chat/LuEngineSwitchBar', () => ({ LuEngineSwitchBar: () => null }))+vi.mock('../../../hooks/useBuiltinEngineStatus', () => ({+ useBuiltinEngineStatus: () => null,+ engineIsIdle: () => false,+}))++// Der Bestand, den die Seite zu sehen bekommt: ein Checkpoint, zwei LoRAs,+// eine davon ein selbst trainierter Charakter, dazu eine VAE als Zeuge fuer+// die anderen Addon-Bahnen.+const CHECKPOINT: AIModel = {+ name: 'sdxl_base.safetensors', model: 'sdxl_base.safetensors', size: 6_000_000_000,+ format: 'safetensors', architecture: 'sdxl', type: 'image', providerName: 'ComfyUI',+ source: 'checkpoint',+}+const LORA: AIModel = {+ name: 'pixel_art_xl.safetensors', model: 'pixel_art_xl.safetensors', size: 170_917_888,+ format: 'safetensors', architecture: 'sdxl', type: 'image', providerName: 'ComfyUI',+ source: 'lora',+}+const CHARACTER_LORA: AIModel = {+ name: 'char_marla_zimage.safetensors', model: 'char_marla_zimage.safetensors', size: 41_943_040,+ format: 'safetensors', architecture: 'zimage', type: 'image', providerName: 'ComfyUI',+ source: 'lora',+}+const VAE: AIModel = {+ name: 'sdxl_vae.safetensors', model: 'sdxl_vae.safetensors', size: 334_000_000,+ format: 'safetensors', architecture: 'sdxl', type: 'image', providerName: 'ComfyUI',+ source: 'vae',+}++let bestand: AIModel[] = []++vi.mock('../../../hooks/useModels', () => ({+ useModels: () => ({+ models: bestand,+ activeModel: null,+ setActiveModel,+ fetchModels,+ removeModel: vi.fn(),+ categoryFilter: 'image',+ setCategoryFilter: vi.fn(),+ inventoryLoaded: true,+ inventoryRefreshing: false,+ }),+}))++import { ModelManager } from '../ModelManager'++beforeEach(() => {+ macHost = false+ comfyLaeuft = true+ bestand = [CHECKPOINT, LORA, CHARACTER_LORA, VAE]+ backendCall.mockClear()+ searchCivitaiModels.mockClear()+ startModelDownload.mockClear()+ setActiveModel.mockClear()+})+afterEach(cleanup)++/** Die Leiste links, mit ihren vier moeglichen Eintraegen. */+const railButton = (name: string) => screen.queryByRole('button', { name: new RegExp(`^${name}`) })++function openLoraInstalled() {+ render(createElement(ModelManager))+ fireEvent.click(screen.getByRole('button', { name: /^LoRAs/ }))+ fireEvent.click(screen.getByRole('button', { name: /^Installed/ }))+}++describe('die Leiste kennt die LoRAs', () => {+ it('THE FIX: der Eintrag steht da', () => {+ render(createElement(ModelManager))+ expect(railButton('LoRAs')).not.toBeNull()+ })++ it('GEGENPROBE: auf einem MLX-Mac gibt es ihn nicht, dort gibt es keinen loras-Ordner', () => {+ macHost = true+ render(createElement(ModelManager))+ expect(railButton('LoRAs')).toBeNull()+ // Und die drei echten Kategorien stehen weiter da, es faellt also nicht+ // die ganze Leiste weg.+ expect(railButton('Chat')).not.toBeNull()+ expect(railButton('Image')).not.toBeNull()+ })+})++describe('Installed unter LoRAs', () => {+ it('listet GENAU die zwei LoRAs, mit ihrer Groesse', () => {+ openLoraInstalled()+ const zeilen = screen.getAllByTestId('lora-row')+ expect(zeilen).toHaveLength(2)+ const namen = zeilen.map((z) => z.textContent ?? '')+ expect(namen.some((t) => t.includes('pixel_art_xl.safetensors'))).toBe(true)+ expect(namen.some((t) => t.includes('char_marla_zimage.safetensors'))).toBe(true)+ // Die Groesse steht dran, sonst beantwortet die Liste nicht, was das kostet.+ expect(namen.some((t) => /\d/.test(t) && /(MB|GB)/.test(t))).toBe(true)+ })++ it('GEGENPROBE: weder der Checkpoint noch die VAE stehen hier', () => {+ openLoraInstalled()+ const text = screen.getAllByTestId('lora-row').map((z) => z.textContent).join(' ')+ expect(text).not.toContain('sdxl_base.safetensors')+ expect(text).not.toContain('sdxl_vae.safetensors')+ })++ it('ein selbst trainierter Charakter traegt Chip und Triggerwort', () => {+ openLoraInstalled()+ const zeile = screen.getAllByTestId('lora-row')+ .find((z) => (z.textContent ?? '').includes('char_marla_zimage'))!+ expect(within(zeile).getByText('Character')).toBeTruthy()+ expect(zeile.textContent).toContain('Trigger word: marla')+ })++ it('GEGENPROBE: die fremde LoRA traegt keinen Chip', () => {+ openLoraInstalled()+ const zeile = screen.getAllByTestId('lora-row')+ .find((z) => (z.textContent ?? '').includes('pixel_art_xl'))!+ expect(within(zeile).queryByText('Character')).toBeNull()+ expect(zeile.textContent).not.toContain('Trigger word')+ })++ it('kein Use, kein Aktivsetzen: ein Klick auf die Zeile waehlt nichts aus', () => {+ openLoraInstalled()+ const zeile = screen.getAllByTestId('lora-row')[0]+ expect(within(zeile).queryByRole('button', { name: /^Use$/ })).toBeNull()+ fireEvent.click(zeile)+ expect(setActiveModel).not.toHaveBeenCalled()+ })++ it('der Hinweis sagt, wo man sie benutzt', () => {+ openLoraInstalled()+ expect(screen.getAllByText(/Use them in Create, Advanced settings, Expert, LoRA stack\./).length)+ .toBeGreaterThan(0)+ })++ it('leer: ein Satz und der Weg zu Get new, sobald ComfyUI geantwortet hat', async () => {+ bestand = [CHECKPOINT]+ openLoraInstalled()+ // Erst wird gefragt, ob ComfyUI ueberhaupt laeuft: eine leere Liste ohne+ // laufenden Dienst ist keine Aussage ueber den Bestand, und die Bahn+ // benutzt dafuer denselben Zwischenzustand wie der Bild-Reiter.+ expect(screen.getByText('Checking ComfyUI…')).toBeTruthy()+ expect(await screen.findByText('No LoRAs installed yet')).toBeTruthy()+ expect(screen.getByRole('button', { name: /Get new LoRAs/ })).toBeTruthy()+ })+})++describe('ComfyUI steht', () => {+ it('die LoRA-Bahn zeigt denselben Zustand wie der Bild-Reiter, mit ihrem eigenen Wort', async () => {+ comfyLaeuft = false+ bestand = [CHECKPOINT]+ openLoraInstalled()+ expect(await screen.findByText('Start ComfyUI to see your LoRA models')).toBeTruthy()+ expect(screen.getByText(/LoRA models are served by ComfyUI, which isn't running right now/)).toBeTruthy()+ expect(screen.getByRole('button', { name: /Open Settings/ })).toBeTruthy()+ // GEGENPROBE: der Bild-Reiter sagt weiter Image, das Wort ist nicht+ // ueberall dasselbe geworden.+ cleanup()+ bestand = []+ render(createElement(ModelManager))+ fireEvent.click(screen.getByRole('button', { name: /^Image/ }))+ fireEvent.click(screen.getByRole('button', { name: /^Installed/ }))+ expect(await screen.findByText('Start ComfyUI to see your image models')).toBeTruthy()+ })+})++describe('Loeschen aus dem LoRA-Reiter', () => {+ it('THE FIX: bestaetigt, ruft delete_comfy_model mit dem Dateinamen, die Zeile geht', async () => {+ openLoraInstalled()+ fireEvent.click(screen.getByRole('button', { name: 'Delete pixel_art_xl.safetensors' }))+ fireEvent.click(screen.getByRole('button', { name: /^Delete$/ }))+ await waitFor(() => expect(backendCall).toHaveBeenCalledTimes(1))+ expect(backendCall.mock.calls[0][0]).toBe('delete_comfy_model')+ expect((backendCall.mock.calls[0][1] as { filename: string }).filename)+ .toBe('pixel_art_xl.safetensors')+ // Der Bestand ist die eine Quelle der Liste: faellt die Datei dort weg,+ // faellt die Zeile weg.+ bestand = [CHECKPOINT, CHARACTER_LORA, VAE]+ cleanup()+ openLoraInstalled()+ const namen = screen.getAllByTestId('lora-row').map((z) => z.textContent ?? '')+ expect(namen).toHaveLength(1)+ expect(namen[0]).not.toContain('pixel_art_xl')+ })++ it('GEGENPROBE: Abbruch ueber Cancel loescht nichts', async () => {+ openLoraInstalled()+ fireEvent.click(screen.getByRole('button', { name: 'Delete pixel_art_xl.safetensors' }))+ fireEvent.click(screen.getByRole('button', { name: /^Cancel$/ }))+ expect(backendCall).not.toHaveBeenCalled()+ expect(screen.getAllByTestId('lora-row')).toHaveLength(2)+ })++ it('GEGENPROBE: Escape schliesst die Bestaetigung und loescht nichts', async () => {+ openLoraInstalled()+ fireEvent.click(screen.getByRole('button', { name: 'Delete pixel_art_xl.safetensors' }))+ expect(screen.getByText('Delete Model')).toBeTruthy()+ fireEvent.keyDown(document, { key: 'Escape' })+ await waitFor(() => expect(screen.queryByText('Delete Model')).toBeNull())+ expect(backendCall).not.toHaveBeenCalled()+ })++ it('GEGENPROBE: das X der Bestaetigung loescht nichts', async () => {+ openLoraInstalled()+ fireEvent.click(screen.getByRole('button', { name: 'Delete pixel_art_xl.safetensors' }))+ const dialog = screen.getByRole('dialog')+ fireEvent.click(within(dialog).getByRole('button', { name: /close/i }))+ await waitFor(() => expect(screen.queryByText('Delete Model')).toBeNull())+ expect(backendCall).not.toHaveBeenCalled()+ })+})++describe('Get new unter LoRAs', () => {+ it('THE FIX: fragt CivitAI nach LORA', async () => {+ render(createElement(ModelManager))+ fireEvent.click(screen.getByRole('button', { name: /^LoRAs/ }))+ fireEvent.click(screen.getByRole('button', { name: /^Get new/ }))+ fireEvent.change(screen.getByLabelText('Search CivitAI for LoRAs'), { target: { value: 'pixel art' } })+ fireEvent.click(screen.getByRole('button', { name: 'Search CivitAI' }))+ await waitFor(() => expect(searchCivitaiModels).toHaveBeenCalledTimes(1))+ expect(searchCivitaiModels.mock.calls[0][0]).toBe('pixel art')+ expect(searchCivitaiModels.mock.calls[0][1]).toBe('LORA')+ })++ it('und laedt einen Treffer in den loras-Ordner', async () => {+ searchCivitaiModels.mockResolvedValueOnce([{+ id: 7, name: 'Pixel Art XL', sourceUrl: 'https://civitai.com/models/7',+ downloadUrl: 'https://civitai.com/api/download/models/7',+ filename: 'pixel_art_xl.safetensors', subfolder: 'loras', sizeGB: 0.16,+ }])+ render(createElement(ModelManager))+ fireEvent.click(screen.getByRole('button', { name: /^LoRAs/ }))+ fireEvent.click(screen.getByRole('button', { name: /^Get new/ }))+ fireEvent.change(screen.getByLabelText('Search CivitAI for LoRAs'), { target: { value: 'pixel art' } })+ fireEvent.click(screen.getByRole('button', { name: 'Search CivitAI' }))+ const knopf = await screen.findByRole('button', { name: 'Download' })+ fireEvent.click(knopf)+ await waitFor(() => expect(startModelDownload).toHaveBeenCalledTimes(1))+ expect(startModelDownload.mock.calls[0][1]).toBe('loras')+ expect(startModelDownload.mock.calls[0][2]).toBe('pixel_art_xl.safetensors')+ })+})++describe('der Bild-Reiter ist die LoRAs los', () => {+ it('THE FIX: nur der Checkpoint und die VAE stehen dort, keine LoRA', () => {+ render(createElement(ModelManager))+ fireEvent.click(screen.getByRole('button', { name: /^Image/ }))+ fireEvent.click(screen.getByRole('button', { name: /^Installed/ }))+ const seite = document.body.textContent ?? ''+ expect(seite).toContain('sdxl_base.safetensors')+ // Die anderen Addon-Bahnen bleiben, wo sie waren: nur die LoRA-Bahn zieht um.+ expect(seite).toContain('sdxl_vae.safetensors')+ expect(seite).not.toContain('pixel_art_xl.safetensors')+ expect(seite).not.toContain('char_marla_zimage.safetensors')+ })++ it('der Zaehler der Bild-Bahn zaehlt die LoRAs nicht mehr mit', () => {+ render(createElement(ModelManager))+ // Vier Bilddateien im Bestand, zwei davon LoRAs: die Bahn zeigt 2.+ const bildKnopf = screen.getByRole('button', { name: /^Image/ })+ expect(bildKnopf.textContent).toMatch(/2$/)+ expect(screen.getByRole('button', { name: /^LoRAs/ }).textContent).toMatch(/2$/)+ })+})++describe('die Checkpoint-Suche fragt weiter nach Checkpoint', () => {+ it('GEGENPROBE: DiscoverModels gibt dem geteilten Panel den alten Typ mit', () => {+ const quelle = readFileSync(resolve(__dirname, '..', 'DiscoverModels.tsx'), 'utf8')+ expect(quelle).toMatch(/<CivitaiSearchPanel[\s\S]{0,120}modelType="Checkpoint"/)+ expect(quelle).not.toContain('modelType="LORA"')+ })+})diff --git a/src/components/settings/__tests__/die-meldung-zeigt-auf-den-abschnitt-den-es-gibt.test.ts b/src/components/settings/__tests__/die-meldung-zeigt-auf-den-abschnitt-den-es-gibt.test.tsindex b193bc42..913d7e6f 100644--- a/src/components/settings/__tests__/die-meldung-zeigt-auf-den-abschnitt-den-es-gibt.test.ts+++ b/src/components/settings/__tests__/die-meldung-zeigt-auf-den-abschnitt-den-es-gibt.test.ts@@ -90,4 +90,24 @@ describe('a download failure points at a section the app really has', () => {agentMode: true, agentWorkflows: true, mediaTimeouts: true,} as SettingsSectionFlags)).toContain('CivitAI API key')})++ /**+ * Dieselbe Frage, eine Etage hoeher: nicht der abgelehnte Download, sondern+ * die leere Trefferliste. Die sagte "add your CivitAI API key in the+ * Workflow finder", und der Workflow-Finder ist nicht der Ort, an dem das+ * Feld liegt. Das ist genau der Fehler, den der Rust-Text eine Runde+ * frueher hatte, im zweiten Satz, den ein Nutzer an derselben Stelle liest.+ */+ it('und die leere CivitAI-Trefferliste nennt denselben echten Abschnitt', () => {+ const panel = readFileSync(+ resolve(here, '../../models/CivitaiSearchPanel.tsx'), 'utf8',+ )+ const leer = panel.slice(panel.indexOf('No matches for'))+ for (const pfad of settingsPathsIn(leer.replace(/>/g, '>'))) {+ expect(everySectionTitle()).toContain(pfad.split('>').pop()!.trim())+ }+ expect(leer).toContain('CivitAI API key')+ // NEGATIVKONTROLLE: der alte Wegweiser faellt durch.+ expect(panel).not.toContain('in the Workflow finder')+ })})diff --git a/src/hooks/useModels.ts b/src/hooks/useModels.tsindex c99100d1..695e4dec 100644--- a/src/hooks/useModels.ts+++ b/src/hooks/useModels.ts@@ -37,7 +37,7 @@ import {isEmbeddingGgufName as isEmbeddingModel,} from '../api/engine'import type { BundledModel } from '../api/engine'-import type { PullProgress, AIModel, ModelCategory, ImageModel, VideoModel, CloudModel } from '../types/models'+import type { PullProgress, AIModel, ModelCategory, ImageModel, VideoModel, CloudModel, ComfyModelSource } from '../types/models'// Boot-resume for the managed built-in engine (2.5.7): the llama-server@@ -490,9 +490,17 @@ export function useModels() {// entry used to carry size 0, and the card hides a zero size, so the// Installed list answered "what is this costing me" with silence.const sizes = await readModelDiskSizes([...imageModels, ...videoModels])- const toModel = <T extends 'image' | 'video'>(m: { name: string; type: string }, type: T) => ({+ // `source` rides along. It is the only thing that tells a LoRA from a+ // checkpoint once the row is an AIModel (both are files under+ // ComfyUI/models and both come out of this lane as type 'image'), and+ // dropping it here is what put the LoRAs nameless between the+ // checkpoints in the Image tab, clickable as if one were a main model.+ const toModel = <T extends 'image' | 'video'>(+ m: { name: string; type: string; source: ComfyModelSource },+ type: T,+ ) => ({name: m.name, model: m.name, size: sizes.get(m.name) ?? 0, format: format(m.name),- architecture: m.type, type, providerName: 'ComfyUI' as const,+ architecture: m.type, type, providerName: 'ComfyUI' as const, source: m.source,})comfyModels = [...imageModels.map((m) => toModel(m, 'image') as ImageModel),diff --git a/src/lib/__tests__/inventory-counter.test.ts b/src/lib/__tests__/inventory-counter.test.tsindex a8c71a32..2e556a60 100644--- a/src/lib/__tests__/inventory-counter.test.ts+++ b/src/lib/__tests__/inventory-counter.test.ts@@ -57,16 +57,23 @@ describe('a counter never states a number it has not counted', () => {describe('the Models page routes both counters through the one rule', () => {it('the rail badge asks counterView', () => {- expect(manager).toMatch(/const badge = counterView\(models\.filter\(\(m\) => m\.type === key\)\.length, inventoryState\)/)+ // Since the LoRAs rail the badge counts one of two things (the category's+ // models, or the LoRAs), and both of them go through the same rule: the+ // call wraps the whole choice instead of one of its arms.+ expect(manager).toMatch(/const badge = counterView\(\s*key === 'lora'\s*\?\s*loraRows\.length\s*:\s*models\.filter\(\(m\) => m\.type === key && !isLoraRow\(m\)\)\.length,\s*inventoryState,\s*\)/)})it('the Installed badge asks counterView', () => {- expect(manager).toMatch(/counterView\(filteredModels\.length, inventoryState\)/)+ expect(manager).toMatch(/counterView\(installedCount, inventoryState\)/)+ // And that one number is the lane's own count, not a second reading.+ expect(manager).toMatch(/const installedCount = rail === 'lora' \? loraRows\.length : filteredModels\.length/)})it('NEGATIVE CONTROL: neither counter prints a bare list length any more', () => {// This is the shape that put "Installed 0" on the screen.expect(manager).not.toMatch(/tabular-nums">\{filteredModels\.length\}</)+ expect(manager).not.toMatch(/tabular-nums">\{loraRows\.length\}</)+ expect(manager).not.toMatch(/tabular-nums">\{installedCount\}</)expect(manager).not.toMatch(/\{count > 0 && \(/)})diff --git a/src/lib/release-notes.ts b/src/lib/release-notes.tsindex 6673446e..20e32508 100644--- a/src/lib/release-notes.ts+++ b/src/lib/release-notes.ts@@ -391,6 +391,10 @@ export const RELEASE_NOTES: ReleaseNote[] = [title: 'A narrow window no longer scrolls the whole chat sideways.',detail: 'At a narrow window width, picking a model, opening the sampling sliders or opening the plugins menu used to leave the whole chat shifted sideways afterward, because the shared chat area allowed the browser to scroll it into view when a clicked control sat partly off screen. That area no longer accepts a programmatic scroll, so it stays put.',},+ {+ title: 'Models now has a LoRAs tab that searches and installs from CivitAI.',+ detail: 'Models has a LoRAs entry of its own next to Chat, Image and Video. Get new searches CivitAI for LoRAs and downloads what you pick into ComfyUI\'s models/loras folder; Installed lists what is already there with its size, marks the characters you trained yourself with their trigger word, and deletes a file you no longer want. LoRAs no longer sit unnamed among the checkpoints in the Image tab, where one could be picked as if it were a main model.',+ },{title: 'Update ComfyUI now asks first and refuses while ComfyUI is busy.',detail: 'Update ComfyUI in Settings now shows a confirmation dialog before it starts. It stops LU\'s own running ComfyUI first if there is one, refuses while a ComfyUI this app did not start or one that is generating something holds the port, and puts the ComfyUI code back to the version it had before if you cancel partway through; Python packages already installed during that attempt are not undone.',diff --git a/src/types/models.ts b/src/types/models.tsindex f5e6e314..153dbdfb 100644--- a/src/types/models.ts+++ b/src/types/models.ts@@ -56,6 +56,25 @@ export interface CloudModel {path?: string}+/**+ * Which ComfyUI models folder a listed file was enumerated out of.+ *+ * THE definition of that set, and it lives here rather than in `api/comfyui`+ * because the inventory rows carry it all the way into the views: a LoRA and a+ * checkpoint are both files under `ComfyUI/models`, they are both `type:+ * 'image'`, and only this field tells them apart. It used to be dropped the+ * moment the inventory became `AIModel`, which is why LoRAs sat nameless+ * between the checkpoints in the Image tab and could be clicked as if one of+ * them were a main model.+ *+ * `api/comfyui` narrows this to its addon half (`AddonSource`) instead of+ * spelling the names a second time.+ */+export type ComfyModelSource =+ | 'checkpoint' | 'diffusion_model' | 'motion_module'+ | 'lora' | 'vae' | 'text_encoder'+ | 'clip_vision' | 'controlnet' | 'upscale_model' | 'embedding' | 'style_model'+// Image model (e.g. Stable Diffusion, SDXL, Fooocus, ComfyUI)export interface ImageModel {name: string@@ -71,6 +90,8 @@ export interface ImageModel {type: 'image'provider?: ProviderIdproviderName?: string+ /** Set for rows the ComfyUI inventory produced, absent for everything else. */+ source?: ComfyModelSource}// Video model (e.g. SVD, AnimateDiff, VideoCrafter, ComfyUI)@@ -88,6 +109,8 @@ export interface VideoModel {type: 'video'provider?: ProviderIdproviderName?: string+ /** Set for rows the ComfyUI inventory produced, absent for everything else. */+ source?: ComfyModelSource}// Generic model type