Skip to content

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.

fix(models): the Image inventory counts every folder a file can sit in

purple11cbe5f96bae
diff --git a/src/api/__tests__/bundle-install-visible-wait.test.ts b/src/api/__tests__/bundle-install-visible-wait.test.ts
index a9aacf3e..3aa9f654 100644
--- a/src/api/__tests__/bundle-install-visible-wait.test.ts
+++ b/src/api/__tests__/bundle-install-visible-wait.test.ts
@@ -47,6 +47,9 @@ vi.mock('../comfyui', () => ({
// Sixth loader (2026-08-29): the AnimateDiff pack lists its motion modules
// itself. No motion module in these fixtures, so it answers empty.
getAnimateDiffModels: async () => [],
+ // Seventh loader (2026-08-29, abnahme counter-check): LoraLoader enumerates
+ // the loras folder, so a LoRA is judged like every other file now.
+ getLoraModels: async () => [],
filterPartialFiles: async (names: string[]) => new Set(names),
refreshComfyModels: (...a: unknown[]) => refreshComfyModels(...(a as [number])),
}))
@@ -300,15 +303,27 @@ describe('a file complete on disk waits out the ComfyUI scan before it is called
})
it('a subfolder ComfyUI never enumerates is not judged at all', async () => {
- // loras and upscale models do not appear in these lists, so waiting on one
- // would be certain failure on a click.
+ // Upscale models do not appear in these lists, so waiting on one would be
+ // certain failure on a click. (loras left this group on 2026-08-29: the
+ // LoRA folder IS enumerated, by LoraLoader, and the abnahme counter-check
+ // showed what not asking it costs.)
+ const rec = recordVerdicts()
+
+ await installBundleComplete(bundleOf([{ filename: '4x-UltraSharp.pth', subfolder: 'upscale_models' }]))
+ rec.stop()
+
+ expect(rec.seen).toEqual([{ type: 'comfyui-download-exists', filename: '4x-UltraSharp.pth' }])
+ expect(getCheckpoints).not.toHaveBeenCalled()
+ })
+
+ it('a LoRA IS judged now, so a finished LoRA download gets the same wait as any other file', async () => {
const rec = recordVerdicts()
await installBundleComplete(bundleOf([{ filename: 'mychar.safetensors', subfolder: 'loras' }]))
rec.stop()
expect(rec.seen).toEqual([{ type: 'comfyui-download-exists', filename: 'mychar.safetensors' }])
- expect(getCheckpoints).not.toHaveBeenCalled()
+ expect(getCheckpoints).toHaveBeenCalled()
})
it('an engine that cannot be reached is not a verdict, and costs no budget', async () => {
diff --git a/src/api/__tests__/bundles-installed-every-file.test.ts b/src/api/__tests__/bundles-installed-every-file.test.ts
index 27c3b18e..310d1d81 100644
--- a/src/api/__tests__/bundles-installed-every-file.test.ts
+++ b/src/api/__tests__/bundles-installed-every-file.test.ts
@@ -33,6 +33,7 @@ const diffusionModels = vi.fn<() => Promise<string[]>>(async () => [])
const ggufUnets = vi.fn<() => Promise<string[]>>(async () => [])
const vaes = vi.fn<() => Promise<string[]>>(async () => [])
const clips = vi.fn<() => Promise<string[]>>(async () => [])
+const loras = vi.fn<() => Promise<string[]>>(async () => [])
vi.mock('../backend', () => ({
backendCall: (...a: unknown[]) => backendCall(...(a as [string, unknown])),
@@ -48,6 +49,10 @@ vi.mock('../comfyui', () => ({
getAnimateDiffModels: async () => [],
getVAEModels: () => vaes(),
getCLIPModels: () => clips(),
+ // Seventh loader (2026-08-29, abnahme counter-check): LoraLoader has always
+ // enumerated the loras folder and nothing here ever asked it, so a LoRA was
+ // the one installed file no surface could reason about.
+ getLoraModels: () => loras(),
filterPartialFiles: async (names: string[]) => new Set(names),
refreshComfyModels: vi.fn(async () => true),
}))
@@ -71,8 +76,9 @@ const RAPID_AIO = {
],
} as unknown as ModelBundle
-/** A LoRA bundle: nothing ComfyUI enumerates through these loaders, so the
- * gate has no business judging it either way. */
+/** A LoRA bundle. Since 2026-08-29 the loras folder IS enumerated, so this
+ * bundle is judged like every other one: the counter-check found Pixel Art XL
+ * reading Installed on its card while no list and no counter knew the file. */
const LORA_ONLY = {
name: 'Character LoRA',
description: '', tags: [], totalSizeGB: 0.2, vramRequired: '4 GB',
@@ -81,6 +87,16 @@ const LORA_ONLY = {
],
} as unknown as ModelBundle
+/** An upscale model: still nothing any of these loaders enumerates, so the
+ * gate still has no business judging it either way. */
+const UPSCALE_ONLY = {
+ name: 'Upscaler',
+ description: '', tags: [], totalSizeGB: 0.07, vramRequired: '4 GB',
+ files: [
+ { name: '', description: '', pulls: '', tags: [], updated: '', filename: '4x-UltraSharp.pth', subfolder: 'upscale_models', sizeGB: 0.07 },
+ ],
+} as unknown as ModelBundle
+
describe('a bundle counts as installed only when ComfyUI lists every file it enumerates', () => {
beforeEach(() => {
vi.clearAllMocks()
@@ -128,10 +144,25 @@ describe('a bundle counts as installed only when ComfyUI lists every file it enu
})
it('a bundle whose files ComfyUI never enumerates is left to the disk check', async () => {
+ const out = await checkBundlesInstalled([UPSCALE_ONLY])
+ expect(out[UPSCALE_ONLY.name]).toBe(true)
+ })
+
+ it('a LoRA the running ComfyUI lists counts as installed', async () => {
+ loras.mockResolvedValue(['mychar.safetensors'])
const out = await checkBundlesInstalled([LORA_ONLY])
expect(out[LORA_ONLY.name]).toBe(true)
})
+ it('NEGATIVE CONTROL: a LoRA on disk the running ComfyUI does not list is not installed', async () => {
+ // The counter-check case, from the other end: the card used to trust the
+ // disk alone here, which is how it read Installed over a list that had
+ // never heard of the file.
+ loras.mockResolvedValue([])
+ const out = await checkBundlesInstalled([LORA_ONLY])
+ expect(out[LORA_ONLY.name]).toBe(false)
+ })
+
it('an engine that cannot be reached leaves the disk verdict standing', async () => {
vaes.mockRejectedValue(new Error('ECONNREFUSED'))
const out = await checkBundlesInstalled([RAPID_AIO])
diff --git a/src/api/__tests__/bundles-installed-gguf.test.ts b/src/api/__tests__/bundles-installed-gguf.test.ts
index 99007269..b70bb9bd 100644
--- a/src/api/__tests__/bundles-installed-gguf.test.ts
+++ b/src/api/__tests__/bundles-installed-gguf.test.ts
@@ -33,6 +33,9 @@ vi.mock('../comfyui', () => ({
// Sixth loader (2026-08-29): the AnimateDiff pack lists its motion modules
// itself. No motion module in these fixtures, so it answers empty.
getAnimateDiffModels: async () => [],
+ // Seventh loader (2026-08-29, abnahme counter-check): LoraLoader enumerates
+ // the loras folder. Nothing in these fixtures is a LoRA, so it answers empty.
+ getLoraModels: async () => [],
filterPartialFiles: async (names: string[]) => new Set(names),
}))
diff --git a/src/api/__tests__/installed-image-inventory.test.ts b/src/api/__tests__/installed-image-inventory.test.ts
new file mode 100644
index 00000000..e285f424
--- /dev/null
+++ b/src/api/__tests__/installed-image-inventory.test.ts
@@ -0,0 +1,225 @@
+/**
+ * Befund 1 of the abnahme counter-check on the real 2.6.7 Windows build
+ * (2026-08-29, ergebnis-abnahme-durchklick.md).
+ *
+ * Endstate there, category Image: the rail said 3, the Installed list held
+ * three checkpoints, and two cards in "Get new" read Installed that were in
+ * no list and no counter at all. Their files were on the disk and measured:
+ *
+ * C:\Users\ddrob\ComfyUI\models\loras\pixel-art-xl.safetensors 163 MB
+ * C:\Users\ddrob\ComfyUI\models\vae\sdxl_vae.safetensors 319 MB
+ *
+ * Beside them lay two more LoRAs, four text encoders and five more VAEs that
+ * no surface in the app had ever mentioned. The cards told the truth; the
+ * counter and the list read checkpoints\ and diffusion_models\ and nothing
+ * else. So the user could not see what those files cost him and could not
+ * remove one of them from the list.
+ *
+ * Same bug shape as GH #113 and as the video round before it: card, counter
+ * and list answering from different readers. These tests pin the one reader
+ * the image counter and the Installed list use now, that it covers every
+ * storage folder, and that the Create picker reader did NOT move with it: a
+ * VAE is never a main model.
+ *
+ * Run: npx vitest run src/api/__tests__/installed-image-inventory.test.ts
+ */
+import { describe, it, expect, vi, beforeEach } from 'vitest'
+
+const localFetch = vi.fn()
+const backendCall = vi.fn()
+vi.mock('../backend', async (importOriginal) => ({
+ ...(await importOriginal<typeof import('../backend')>()),
+ localFetch: (...a: unknown[]) => localFetch(...a),
+ backendCall: (...a: unknown[]) => backendCall(...a),
+ isTauri: () => false,
+ comfyuiUrl: (path: string) => `http://127.0.0.1:8188${path}`,
+}))
+
+import {
+ getImageModels, getInstalledImageModels, getVideoModels,
+ subfolderForSource, readModelDiskSizes,
+} from '../comfyui'
+import { ENUM_SUBFOLDERS, ANIMATEDIFF_SUBFOLDER, readComfyModelNames } from '../discover'
+
+const okJson = (body: unknown) => ({ ok: true, status: 200, json: async () => body })
+
+// The two addon files of the counter-check, spelled as the box spells them.
+const LORA = 'pixel-art-xl.safetensors'
+const VAE = 'sdxl_vae.safetensors'
+// And the three checkpoints that were already counted.
+const CKPT_RV = 'Realistic_Vision_V6.0_NV_B1_fp16.safetensors'
+const CKPT_TURBO = 'sd_turbo.safetensors'
+const UNET_Z = 'z_image_bf16.safetensors'
+
+function routeObjectInfo(opts: {
+ checkpoints?: string[]
+ unets?: string[]
+ gguf?: string[]
+ loras?: string[] | 'missing'
+ vaes?: string[]
+ clips?: string[]
+}) {
+ const { checkpoints = [], unets = [], gguf = [], loras = [], vaes = [], clips = [] } = opts
+ localFetch.mockImplementation(async (url: string) => {
+ if (url.includes('CheckpointLoaderSimple')) {
+ return okJson({ CheckpointLoaderSimple: { input: { required: { ckpt_name: [checkpoints] } } } })
+ }
+ if (url.includes('UnetLoaderGGUF')) {
+ return okJson({ UnetLoaderGGUF: { input: { required: { unet_name: [gguf] } } } })
+ }
+ if (url.includes('UNETLoader')) {
+ return okJson({ UNETLoader: { input: { required: { unet_name: [unets] } } } })
+ }
+ if (url.includes('LoraLoader')) {
+ if (loras === 'missing') return { ok: false, status: 404, json: async () => ({}) }
+ return okJson({ LoraLoader: { input: { required: { lora_name: [loras] } } } })
+ }
+ if (url.includes('VAELoader')) {
+ return okJson({ VAELoader: { input: { required: { vae_name: [vaes] } } } })
+ }
+ if (url.includes('CLIPLoader')) {
+ return okJson({ CLIPLoader: { input: { required: { clip_name: [clips] } } } })
+ }
+ return okJson({})
+ })
+}
+
+beforeEach(() => {
+ localFetch.mockReset()
+ backendCall.mockReset()
+ // Every file on disk and complete, unless a test says otherwise. This is
+ // the size probe filterPartialFiles and readModelDiskSizes both ask.
+ backendCall.mockImplementation(async (_cmd: string, args: { files: Array<{ filename: string }> }) =>
+ args.files.map((f) => ({ filename: f.filename, exists: true, actualBytes: 1024, complete: true })),
+ )
+})
+
+describe('the Image inventory sees what the cards see', () => {
+ it('THE FIX: the LoRA and the VAE of the counter-check are in the image inventory', async () => {
+ routeObjectInfo({ loras: [LORA], vaes: [VAE] })
+ const names = (await getInstalledImageModels()).map((m) => m.name)
+ expect(names).toContain(LORA)
+ expect(names).toContain(VAE)
+ })
+
+ it('the exact counter-check endstate: three counted files plus everything that was invisible', async () => {
+ routeObjectInfo({
+ checkpoints: [CKPT_RV, CKPT_TURBO],
+ unets: [UNET_Z],
+ loras: [LORA, 'char_lukompass_v1.safetensors', 'char_lukompass_v2.safetensors'],
+ vaes: [VAE, 'ae.safetensors', 'wan_2.1_vae.safetensors', 'flux2-vae.safetensors', 'mochi_vae.safetensors', 'cosmos_cv8x8x8_1.0.safetensors'],
+ clips: ['t5xxl_fp8_e4m3fn.safetensors', 'clip_l.safetensors', 'umt5_xxl_fp8_e4m3fn_scaled.safetensors', 'qwen_3_4b.safetensors'],
+ })
+ const names = (await getInstalledImageModels()).map((m) => m.name)
+ // the three that were counted before
+ expect(names).toContain(CKPT_RV)
+ expect(names).toContain(CKPT_TURBO)
+ expect(names).toContain(UNET_Z)
+ // three LoRAs, six VAEs, four text encoders: 3 + 3 + 6 + 4
+ expect(names).toHaveLength(16)
+ expect(new Set(names).size).toBe(names.length) // no double counting
+ })
+
+ it('every addon carries the folder it lives in, so the size probe and the delete can find it', async () => {
+ routeObjectInfo({ checkpoints: [CKPT_TURBO], loras: [LORA], vaes: [VAE], clips: ['clip_l.safetensors'] })
+ const bySource = new Map((await getInstalledImageModels()).map((m) => [m.name, m.source]))
+ expect(bySource.get(CKPT_TURBO)).toBe('checkpoint')
+ expect(bySource.get(LORA)).toBe('lora')
+ expect(bySource.get(VAE)).toBe('vae')
+ expect(bySource.get('clip_l.safetensors')).toBe('text_encoder')
+ expect(subfolderForSource('lora')).toBe('loras')
+ expect(subfolderForSource('vae')).toBe('vae')
+ expect(subfolderForSource('text_encoder')).toBe('text_encoders')
+ })
+
+ it('a file two loaders both list stays one entry', async () => {
+ // ComfyUI does offer the same file through more than one enum. One file on
+ // the disk is one line in the list, or the counter starts inventing.
+ routeObjectInfo({ checkpoints: [CKPT_TURBO], vaes: [CKPT_TURBO] })
+ const names = (await getInstalledImageModels()).map((m) => m.name)
+ expect(names).toEqual([CKPT_TURBO])
+ })
+
+ it('one failing lane costs itself, never the rest of the list', async () => {
+ // LoraLoader absent (a custom-node distro without it). The inventory is
+ // short one folder and complete in every other.
+ routeObjectInfo({ checkpoints: [CKPT_TURBO], loras: 'missing', vaes: [VAE] })
+ const names = (await getInstalledImageModels()).map((m) => m.name)
+ expect(names).toContain(CKPT_TURBO)
+ expect(names).toContain(VAE)
+ expect(names).not.toContain(LORA)
+ })
+})
+
+describe('NEGATIVE CONTROL: the pickers did not move', () => {
+ it('the Create image picker still offers no LoRA, no VAE and no text encoder', async () => {
+ routeObjectInfo({
+ checkpoints: [CKPT_TURBO], loras: [LORA], vaes: [VAE], clips: ['clip_l.safetensors'],
+ })
+ const picker = (await getImageModels()).map((m) => m.name)
+ expect(picker).toEqual([CKPT_TURBO])
+ expect(picker).not.toContain(LORA)
+ expect(picker).not.toContain(VAE)
+ expect(picker).not.toContain('clip_l.safetensors')
+ })
+
+ it('the video picker is untouched by the addon folders too', async () => {
+ routeObjectInfo({ loras: [LORA], vaes: [VAE], clips: ['clip_l.safetensors'] })
+ expect(await getVideoModels()).toEqual([])
+ })
+
+ it('an empty ComfyUI yields an empty inventory, not a phantom entry', async () => {
+ routeObjectInfo({})
+ expect(await getInstalledImageModels()).toEqual([])
+ })
+})
+
+describe('the size on disk reaches the card', () => {
+ it('asks the folder each file actually lives in and returns the measured bytes', async () => {
+ const sizes = await readModelDiskSizes([
+ { name: LORA, type: 'unknown', source: 'lora' },
+ { name: VAE, type: 'unknown', source: 'vae' },
+ ])
+ expect(sizes.get(LORA)).toBe(1024)
+ expect(sizes.get(VAE)).toBe(1024)
+ const [, args] = backendCall.mock.calls[0] as [string, { files: Array<{ subfolder: string; filename: string }> }]
+ expect(args.files).toEqual([
+ { subfolder: 'loras', filename: LORA, expectedBytes: 0 },
+ { subfolder: 'vae', filename: VAE, expectedBytes: 0 },
+ ])
+ })
+
+ it('NEGATIVE CONTROL: a failing probe costs the sizes, never the list', async () => {
+ backendCall.mockRejectedValue(new Error('ComfyUI path not set'))
+ const sizes = await readModelDiskSizes([{ name: LORA, type: 'unknown', source: 'lora' }])
+ expect(sizes.size).toBe(0)
+ })
+
+ it('NEGATIVE CONTROL: a file the probe cannot find gets no invented size', async () => {
+ backendCall.mockResolvedValue([{ filename: LORA, exists: false, actualBytes: 0, complete: false }])
+ const sizes = await readModelDiskSizes([{ name: LORA, type: 'unknown', source: 'lora' }])
+ expect(sizes.has(LORA)).toBe(false)
+ })
+
+ it('nothing to weigh means no backend call at all', async () => {
+ expect((await readModelDiskSizes([])).size).toBe(0)
+ expect(backendCall).not.toHaveBeenCalled()
+ })
+})
+
+describe('the shared visibility reader covers the LoRA folder', () => {
+ it('readComfyModelNames lists a LoRA now', async () => {
+ routeObjectInfo({ loras: [LORA] })
+ expect(await readComfyModelNames()).toContain(LORA)
+ })
+
+ it('loras is one of the folders the installed check can reason about', () => {
+ expect(ENUM_SUBFOLDERS.has('loras')).toBe(true)
+ })
+
+ it('the motion-module folder is spelled the same in both modules', () => {
+ // comfyui.ts cannot import discover.ts statically (discover imports back),
+ // so the string is written twice. This is the seam that keeps them equal.
+ expect(subfolderForSource('motion_module')).toBe(ANIMATEDIFF_SUBFOLDER)
+ })
+})
diff --git a/src/api/comfyui.ts b/src/api/comfyui.ts
index e8e86bba..9b16432d 100644
--- a/src/api/comfyui.ts
+++ b/src/api/comfyui.ts
@@ -146,8 +146,29 @@ export interface ClassifiedModel {
name: string
type: ModelType
/** Which ComfyUI enum listed this file. `motion_module` is the AnimateDiff
- * one, and it lives outside ComfyUI\models entirely (see getMotionModels). */
- source: 'checkpoint' | 'diffusion_model' | 'motion_module'
+ * one, and it lives outside ComfyUI\models entirely (see getMotionModels).
+ * `lora`, `vae` and `text_encoder` are the addon folders: files that are
+ * not a model on their own, take up real disk, and used to appear in no
+ * list and no counter at all (counter-check 2026-08-29). */
+ source: 'checkpoint' | 'diffusion_model' | 'motion_module' | 'lora' | 'vae' | 'text_encoder'
+}
+
+/** 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.
+ *
+ * The motion-module folder is spelled out rather than imported: discover.ts
+ * owns ANIMATEDIFF_SUBFOLDER and imports back into this module, so a static
+ * import here would be a cycle. A unit test pins the two spellings together
+ * so the duplicate cannot drift. */
+export function subfolderForSource(source: ClassifiedModel['source']): string {
+ switch (source) {
+ case 'checkpoint': return 'checkpoints'
+ case 'diffusion_model': return 'diffusion_models'
+ case 'motion_module': return 'custom_nodes/ComfyUI-AnimateDiff-Evolved/models'
+ case 'lora': return 'loras'
+ case 'vae': return 'vae'
+ case 'text_encoder': return 'text_encoders'
+ }
}
// ─── Model Classification ───
@@ -861,6 +882,87 @@ export async function getInstalledVideoModels(): Promise<ClassifiedModel[]> {
return out
}
+/** One addon folder, as classified models. These files are not a model on
+ * their own, which is why no picker offers them and why every inventory
+ * surface used to skip them. They still occupy the disk and the user still
+ * has to be able to see and remove them. */
+async function addonLane(
+ read: () => Promise<string[]>,
+ source: 'lora' | 'vae' | 'text_encoder',
+): Promise<ClassifiedModel[]> {
+ const names = await read()
+ const complete = await filterPartialFiles(names)
+ return names
+ .filter((name) => complete.has(name))
+ .map((name) => ({ name, type: classifyModel(name), source }))
+}
+
+/** Everything installed in the image lane, for the INVENTORY surfaces: the
+ * Models rail counter and the Installed tab. The image twin of
+ * getInstalledVideoModels, and the same bug shape one folder further out.
+ *
+ * Counter-check on the Windows box, 2026-08-29: the cards for Pixel Art XL
+ * (163 MB in loras\) and SDXL VAE fp16-fix (319 MB in vae\) both read
+ * Installed, and neither file was in any Installed list or any counter.
+ * Beside them sat two more LoRAs, four text encoders and five more VAEs that
+ * no surface in the app had ever mentioned. The counter and the list read
+ * checkpoints\ and diffusion_models\ and nothing else, so the user could
+ * neither see what those files cost him nor delete one from the list.
+ *
+ * Not used by the Create picker or model-pick: those ask for a main model
+ * and getImageModels still answers exactly what it did. A VAE is never a
+ * main model, and this function is the only place that says otherwise. */
+export async function getInstalledImageModels(): Promise<ClassifiedModel[]> {
+ const [imageModels, loras, vaes, textEncoders] = await Promise.all([
+ inventoryLane('image', getImageModels),
+ inventoryLane('lora', () => addonLane(getLoraModels, 'lora')),
+ inventoryLane('vae', () => addonLane(getVAEModels, 'vae')),
+ inventoryLane('text_encoder', () => addonLane(getCLIPModels, 'text_encoder')),
+ ])
+ const out: ClassifiedModel[] = []
+ const seen = new Set<string>()
+ // First lane wins. A name that two loaders both list (a checkpoint ComfyUI
+ // also offers as a VAE) is one file on the disk and belongs in the list
+ // once, or the Installed count starts inventing entries.
+ for (const m of [...imageModels, ...loras, ...vaes, ...textEncoders]) {
+ if (seen.has(m.name)) continue
+ seen.add(m.name)
+ out.push(m)
+ }
+ return out
+}
+
+/** What each listed file weighs on the disk, by filename.
+ *
+ * The inventory used to hand every ComfyUI file a size of 0, which the card
+ * renders as no size at all. That was tolerable while the list held nothing
+ * but big checkpoints the user had just picked himself; it is not once the
+ * list is supposed to answer "what is all this costing me". Best effort
+ * throughout: a probe that fails costs the sizes, never the list. */
+export async function readModelDiskSizes(models: ClassifiedModel[]): Promise<Map<string, number>> {
+ const out = new Map<string, number>()
+ if (models.length === 0) return out
+ try {
+ // expectedBytes 0 on purpose: this asks how big the file IS, and the
+ // partial-download verdict is filterPartialFiles' job, not this one's.
+ const files = models.map((m) => ({
+ subfolder: subfolderForSource(m.source),
+ filename: m.name,
+ expectedBytes: 0,
+ }))
+ const results: Array<{ filename: string; exists?: boolean; actualBytes?: number }> =
+ await backendCall('check_model_sizes', { files })
+ for (const r of results) {
+ if (r.exists && typeof r.actualBytes === 'number' && r.actualBytes > 0) {
+ out.set(r.filename, r.actualBytes)
+ }
+ }
+ } catch (err) {
+ log.warn('comfyui.disk_sizes_failed', { err })
+ }
+ return out
+}
+
// ── 2.5.8 specialized local-lane model lists ─────────────────────────────────
// Each lane owns its picker: an ACE checkpoint in the Image list (or a 14B S2V
// in the Video list) would build a graph that ComfyUI rejects, so these
diff --git a/src/api/discover.ts b/src/api/discover.ts
index 9b1d9714..84655264 100644
--- a/src/api/discover.ts
+++ b/src/api/discover.ts
@@ -1,5 +1,5 @@
import { backendCall, fetchExternal } from "./backend"
-import { getCheckpoints, getDiffusionModels, getVAEModels, getCLIPModels, getGgufUnetModels, getAnimateDiffModels, filterPartialFiles, refreshComfyModels } from "./comfyui"
+import { getCheckpoints, getDiffusionModels, getVAEModels, getCLIPModels, getGgufUnetModels, getAnimateDiffModels, getLoraModels, filterPartialFiles, refreshComfyModels } from "./comfyui"
import type { ProviderId } from "./providers/types"
import { log } from "../lib/logger"
@@ -156,23 +156,29 @@ export async function checkBundlesInstalled(bundles: ModelBundle[]): Promise<Rec
// gate below skipped those files and the card trusted the disk alone,
// which is how two cards read Installed over a rail counter that knew
// neither of them.
- const [rawCheckpoints, rawDiffModels, rawGgufUnets, rawVaes, rawClips, rawMotion] = await Promise.all([
+ // getLoraModels for the same reason, found one round later (abnahme
+ // counter-check 2026-08-29): the LoRA folder is enumerated by LoraLoader
+ // and nothing here asked it, so a LoRA bundle's card was decided on the
+ // disk alone while no counter and no list knew the file existed.
+ const [rawCheckpoints, rawDiffModels, rawGgufUnets, rawVaes, rawClips, rawMotion, rawLoras] = await Promise.all([
getCheckpoints(), getDiffusionModels(), getGgufUnetModels(), getVAEModels(), getCLIPModels(),
- getAnimateDiffModels(),
+ getAnimateDiffModels(), getLoraModels(),
])
- const [checkpoints, diffModels, ggufUnets, vaes, clips, motion] = await Promise.all([
+ const [checkpoints, diffModels, ggufUnets, vaes, clips, motion, loras] = await Promise.all([
filterPartialFiles(rawCheckpoints).then(s => Array.from(s)),
filterPartialFiles(rawDiffModels).then(s => Array.from(s)),
filterPartialFiles(rawGgufUnets).then(s => Array.from(s)),
filterPartialFiles(rawVaes).then(s => Array.from(s)),
filterPartialFiles(rawClips).then(s => Array.from(s)),
filterPartialFiles(rawMotion).then(s => Array.from(s)),
+ filterPartialFiles(rawLoras).then(s => Array.from(s)),
])
comfyLists = {
checkpoints,
diffusion_models: [...diffModels, ...ggufUnets],
vae: vaes,
text_encoders: clips,
+ loras,
[ANIMATEDIFF_SUBFOLDER]: motion,
}
} catch {
@@ -242,12 +248,18 @@ export async function checkBundlesInstalled(bundles: ModelBundle[]): Promise<Rec
export const ANIMATEDIFF_SUBFOLDER = 'custom_nodes/ComfyUI-AnimateDiff-Evolved/models'
/** Subfolders whose contents ComfyUI enumerates via object_info — the only
- * ones the visibility check can reason about (loras/upscale etc. stay on the
- * pure size check). The AnimateDiff one is enumerated by the pack's own
- * ADE_LoadAnimateDiffModel node, so it belongs here even though it sits under
- * custom_nodes: a motion module the running ComfyUI cannot list is exactly as
- * useless as an invisible checkpoint. */
-export const ENUM_SUBFOLDERS = new Set(['checkpoints', 'diffusion_models', 'vae', 'text_encoders', ANIMATEDIFF_SUBFOLDER])
+ * ones the visibility check can reason about (upscale models and the GGUF
+ * text downloads stay on the pure size check). The AnimateDiff one is
+ * enumerated by the pack's own ADE_LoadAnimateDiffModel node, so it belongs
+ * here even though it sits under custom_nodes: a motion module the running
+ * ComfyUI cannot list is exactly as useless as an invisible checkpoint.
+ *
+ * loras joined on 2026-08-29, with readComfyModelNames below. LoraLoader has
+ * always enumerated that folder; nothing here ever asked it, so a LoRA was
+ * the one installed file the app could not reason about anywhere: its card
+ * trusted the disk alone, the counter and the list never saw it, and a
+ * finished LoRA download was skipped by the visibility wait as unjudgeable. */
+export const ENUM_SUBFOLDERS = new Set(['checkpoints', 'diffusion_models', 'vae', 'text_encoders', 'loras', ANIMATEDIFF_SUBFOLDER])
/** Base identity of a model file: basename only (ComfyUI enums can carry
* nested-subdir prefixes), lowercase, extension and common quant suffixes
@@ -273,6 +285,12 @@ export function normalizeModelBase(name: string): string {
export async function readComfyModelNames(): Promise<string[]> {
const lists = await Promise.all([
getCheckpoints(), getDiffusionModels(), getVAEModels(), getCLIPModels(), getGgufUnetModels(),
+ // Seventh loader, added 2026-08-29 after the abnahme counter-check: the
+ // LoRA folder. Two installed addon bundles (Pixel Art XL, SDXL VAE) read
+ // Installed on their cards while no list and no counter knew them, and
+ // the LoRA half of that could not even be judged, because this reader
+ // never asked LoraLoader.
+ getLoraModels(),
// Sixth loader, added 2026-08-29 after the counter-check: the AnimateDiff
// pack enumerates its motion modules itself, from a folder under
// custom_nodes. Without it a finished AnimateDiff download could never be
diff --git a/src/hooks/useModels.ts b/src/hooks/useModels.ts
index 700dea58..984d6c91 100644
--- a/src/hooks/useModels.ts
+++ b/src/hooks/useModels.ts
@@ -2,10 +2,11 @@ import { useCallback, useEffect, useMemo } from 'react'
import { listModels, pullModel as pullModelApi, pullModelTauri, deleteModel as deleteModelApi } from '../api/ollama'
import { isTauri, isMacOS } from '../api/backend'
import {
- getImageModels as getComfyImageModels,
+ getInstalledImageModels as getComfyImageModels,
getInstalledVideoModels as getComfyVideoModels,
checkComfyConnection,
filterPartialFiles,
+ readModelDiskSizes,
} from '../api/comfyui'
import { parseNDJSONStream } from '../api/stream'
import { log } from '../lib/logger'
@@ -191,13 +192,16 @@ export function useModels() {
if (comfyOk) {
// Settled, not all: a folder ComfyUI cannot read costs that one lane,
// never the whole list. The old code lost both to a single throw.
- // The VIDEO side asks getInstalledVideoModels, not getVideoModels. This
- // is the inventory, and the inventory has to agree with the bundle
- // cards: a bundle whose card says Installed must be in this count and
- // in the Installed list. The four ComfyUI\models loaders alone cannot
- // do that, because the AnimateDiff pack keeps its motion modules under
- // custom_nodes (counter-check on the Windows box, 2026-08-29: two
- // cards Installed, rail counter 3, neither bundle in the list).
+ // BOTH sides ask an inventory reader, not a picker reader. The
+ // inventory has to agree with the bundle cards: a bundle whose card
+ // says Installed must be in this count and in the Installed list.
+ // The four ComfyUI\models loaders alone cannot do that. Video needed
+ // the AnimateDiff pack, which keeps its motion modules under
+ // custom_nodes (counter-check 2026-08-29: two cards Installed, rail
+ // counter 3, neither bundle in the list). Image needed the addon
+ // folders: the abnahme counter-check the same day found Pixel Art XL
+ // in loras\ and the SDXL VAE in vae\ with Installed cards, present on
+ // the disk, and in no list and no counter anywhere.
const [imageResult, videoResult] = await Promise.allSettled([
getComfyImageModels(),
getComfyVideoModels(),
@@ -218,8 +222,12 @@ export function useModels() {
])
const format = (name: string) =>
name.toLowerCase().endsWith('.gguf') ? 'gguf' : 'safetensors'
+ // What each file weighs, asked once for both lanes. Every ComfyUI
+ // 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) => ({
- name: m.name, model: m.name, size: 0, format: format(m.name),
+ name: m.name, model: m.name, size: sizes.get(m.name) ?? 0, format: format(m.name),
architecture: m.type, type, providerName: 'ComfyUI' as const,
})
comfyModels = [