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): a bundle is installed only when ComfyUI can see its own model

purple92e2608685ca
diff --git a/src/api/__tests__/bundle-install-visible-wait.test.ts b/src/api/__tests__/bundle-install-visible-wait.test.ts
index a4d18c02..06f71818 100644
--- a/src/api/__tests__/bundle-install-visible-wait.test.ts
+++ b/src/api/__tests__/bundle-install-visible-wait.test.ts
@@ -11,18 +11,26 @@
* finished produced a red row claiming LU and ComfyUI use different model
* folders. They do not. The scan was simply still running.
*
- * The budget here is deliberately short, three rounds against the other two
- * paths' twenty: this runs inside a click, an old file answers on the first
- * lookup with no waiting at all, and the download poller keeps watching the
- * same file with the full budget.
+ * The budget inside the click is deliberately short, three rounds against the
+ * other two paths' twenty, because it runs inside a click and an old file
+ * answers on the first lookup with no waiting at all.
+ *
+ * D2, 2.6.7: those three rounds are a fast path, not the verdict. 05ee25ff
+ * justified them with "the download poller keeps watching the same file with
+ * the full budget", which is not true for a file the install SKIPPED because it
+ * was already on disk: no transfer is started, so nothing ever reaches the
+ * poller. Anything the click cannot confirm now goes to a background
+ * confirmation on the full budget, and the click meanwhile announces the one
+ * thing that is certain, that the file is on disk.
*
* Run: npx vitest run src/api/__tests__/bundle-install-visible-wait.test.ts
*/
-import { describe, it, expect, vi, beforeAll, beforeEach } from 'vitest'
+import { describe, it, expect, vi, beforeAll, beforeEach, afterEach } from 'vitest'
import type { ModelBundle } from '../discover'
const backendCall = vi.fn<(cmd: string, args?: unknown) => Promise<unknown>>()
const getCheckpoints = vi.fn<() => Promise<string[]>>(async () => [])
+const getGgufUnetModels = vi.fn<() => Promise<string[]>>(async () => [])
const refreshComfyModels = vi.fn<(maxAttempts?: number) => Promise<boolean>>(async () => true)
vi.mock('../backend', () => ({
@@ -35,7 +43,7 @@ vi.mock('../comfyui', () => ({
getDiffusionModels: async () => [],
getVAEModels: async () => [],
getCLIPModels: async () => [],
- getGgufUnetModels: async () => [],
+ getGgufUnetModels: () => getGgufUnetModels(),
filterPartialFiles: async (names: string[]) => new Set(names),
refreshComfyModels: (...a: unknown[]) => refreshComfyModels(...(a as [number])),
}))
@@ -53,6 +61,7 @@ vi.mock('../../lib/bundle-install', async (importOriginal) => {
})
let installBundleComplete: typeof import('../discover').installBundleComplete
+let whenVisibilityConfirmed: typeof import('../discover').whenVisibilityConfirmed
let win: EventTarget
beforeAll(async () => {
@@ -60,11 +69,12 @@ beforeAll(async () => {
// its verdicts on window.
win = new EventTarget()
;(globalThis as unknown as { window: EventTarget }).window = win
- ;({ installBundleComplete } = await import('../discover'))
+ ;({ installBundleComplete, whenVisibilityConfirmed } = await import('../discover'))
})
const VIDEO = 'wan2.2_s2v_14B_fp8.safetensors'
const VAE = 'wan_2.1_vae.safetensors'
+const GGUF = 'wan2.2-i2v-rapid-aio-v10-nsfw-Q4_K_M.gguf'
function bundleOf(files: Array<{ filename: string; subfolder: string }>): ModelBundle {
return {
@@ -99,6 +109,19 @@ function recordVerdicts() {
}
}
+/** Resolves with the filename the next event of this type carries. The long
+ * visibility confirmation runs past the install click on purpose, so a test
+ * about its verdict has to wait for it instead of for the click. */
+function nextEvent(type: string): Promise<string | undefined> {
+ return new Promise((resolve) => {
+ const once = (e: Event) => {
+ win.removeEventListener(type, once)
+ resolve((e as CustomEvent<{ filename?: string }>).detail?.filename)
+ }
+ win.addEventListener(type, once)
+ })
+}
+
/** ComfyUI lists nothing on the first read and everything from the second on,
* which is what the tail of its directory scan looks like from outside. */
function scanFinishesAfterOneRound(...names: string[]) {
@@ -118,6 +141,12 @@ describe('a file complete on disk waits out the ComfyUI scan before it is called
})
})
+ // The long confirmation outlives the click on purpose. Draining it here keeps
+ // one test's engine chatter out of the next test's call counts.
+ afterEach(async () => {
+ await whenVisibilityConfirmed()
+ })
+
it('a file the engine already lists is skipped without any waiting', async () => {
getCheckpoints.mockResolvedValue([VIDEO])
const rec = recordVerdicts()
@@ -166,17 +195,83 @@ describe('a file complete on disk waits out the ComfyUI scan before it is called
expect(rec.seen.map((v) => v.type)).not.toContain('comfyui-model-invisible')
})
- it('a file the engine never lists still reports the folder mismatch, after the budget', async () => {
+ it('a file the engine never lists still reports the folder mismatch, after the FULL budget', async () => {
+ // D2, changed on 2.6.7. The click no longer passes its own verdict. 4.5s is
+ // the patience of a click, not the length of a ComfyUI directory scan, and
+ // the justification for it ("the download poller keeps watching with the
+ // full budget afterwards") is not true for a file the install SKIPPED: no
+ // transfer is started, so the Rust progress map never gains an entry,
+ // downloadStore.refresh never sees a completion, and announceUntilVisible
+ // is never called. The video bundles share exactly those already-present
+ // files, so that is the common case, not the rare one.
+ //
+ // The click therefore announces the one thing that is certain, that the
+ // file is on disk, and the accusation only follows if the full budget runs
+ // out with the engine still silent.
getCheckpoints.mockResolvedValue([])
const rec = recordVerdicts()
+ const accused = nextEvent('comfyui-model-invisible')
await installBundleComplete(bundleOf([{ filename: VIDEO, subfolder: 'diffusion_models' }]))
- rec.stop()
- expect(rec.seen).toEqual([{ type: 'comfyui-model-invisible', filename: VIDEO }])
- // The initial lookup plus three rescan rounds, then it stops asking.
- expect(getCheckpoints).toHaveBeenCalledTimes(4)
+ // Nothing but "it is on disk" while the click is still running.
+ expect(rec.seen).toEqual([{ type: 'comfyui-download-exists', filename: VIDEO }])
+ // Three rescan rounds is all the click itself spends. refreshComfyModels(1)
+ // is the click's single attempt rescan; the long confirmation calls it with
+ // no argument, so the two are told apart by the argument.
expect(refreshComfyModels.mock.calls.filter((c) => c[0] === 1)).toHaveLength(3)
+
+ expect(await accused).toBe(VIDEO)
+ rec.stop()
+ expect(rec.seen.map((v) => v.type)).toContain('comfyui-model-invisible')
+ // The long confirmation ran on top of the click's four lookups, which is
+ // the point: the file got the same budget the other two paths give it.
+ expect(getCheckpoints.mock.calls.length).toBeGreaterThan(4)
+ })
+
+ it('a scan that finishes after the click keeps the card honest without an accusation', async () => {
+ // D2's payoff. The click's three rounds run out, then the scan finishes.
+ // Nobody is accused of anything, and every round of the confirmation
+ // re-announces the arrival, which is what makes the Model Manager run its
+ // installed check again instead of leaving the model out of the list until
+ // the user reloads by hand.
+ let reads = 0
+ getCheckpoints.mockImplementation(async () => (++reads > 6 ? [VIDEO] : []))
+ const rec = recordVerdicts()
+ const announced: Array<string | undefined> = []
+ const onAnnounce = (e: Event) =>
+ announced.push((e as CustomEvent<{ filename?: string }>).detail?.filename)
+ win.addEventListener('comfyui-model-downloaded', onAnnounce)
+
+ await installBundleComplete(bundleOf([{ filename: VIDEO, subfolder: 'diffusion_models' }]))
+ await whenVisibilityConfirmed()
+ rec.stop()
+ win.removeEventListener('comfyui-model-downloaded', onAnnounce)
+
+ expect(rec.seen.map((v) => v.type)).not.toContain('comfyui-model-invisible')
+ expect(announced).toContain(VIDEO)
+ })
+
+ it('a GGUF quant the ComfyUI-GGUF loader lists is visible to the install click too', async () => {
+ // B1. UNETLoader enumerates only .safetensors and .sft, so a .gguf never
+ // shows up in getDiffusionModels. checkBundlesInstalled was taught the GGUF
+ // loader in 2.6.6 and modelsNotVisibleInComfy was born with it; the install
+ // click kept asking four loaders. Both Unfiltered video bundles are GGUF,
+ // which is the title of GH #113, so on that path a model ComfyUI serves
+ // perfectly came back "not listed" and the user was told LU and ComfyUI use
+ // different model folders. Without the fifth list this test goes red: the
+ // click finds nothing, spends its rounds, and starts an accusation.
+ getCheckpoints.mockResolvedValue([])
+ getGgufUnetModels.mockResolvedValue([GGUF])
+ const rec = recordVerdicts()
+
+ await installBundleComplete(bundleOf([{ filename: GGUF, subfolder: 'diffusion_models' }]))
+ await whenVisibilityConfirmed()
+ rec.stop()
+
+ expect(rec.seen).toEqual([{ type: 'comfyui-download-exists', filename: GGUF }])
+ // Answered on the very first lookup, no rescan round at all.
+ expect(refreshComfyModels.mock.calls.filter((c) => c[0] === 1)).toHaveLength(0)
})
it('the rescan carries the next file of the same bundle, no second wait', async () => {
diff --git a/src/api/__tests__/bundles-installed-every-file.test.ts b/src/api/__tests__/bundles-installed-every-file.test.ts
new file mode 100644
index 00000000..867d07d1
--- /dev/null
+++ b/src/api/__tests__/bundles-installed-every-file.test.ts
@@ -0,0 +1,162 @@
+/**
+ * B1, GH #113 back on 2.6.6: "unfiltered models doesn't shown as installed".
+ *
+ * Blahx (2026-08-23, screenshot) and lapbo (2026-08-25, "The model is not
+ * visible, although it is downloaded"). The screenshot is the whole bug in one
+ * frame: the Video / Unfiltered grid shows Wan 2.2 TI2V 5B and Wan 2.2 Rapid
+ * AIO both reading Installed, over a rail counter that says 1.
+ *
+ * The card and the counter ask different sources. The counter is
+ * getVideoModels, which enumerates what the running ComfyUI can actually
+ * serve. The card is checkBundlesInstalled: files complete on disk, confirmed
+ * against ComfyUI. That confirmation accepted ANY ONE enumerable file of the
+ * bundle, and this catalogue shares files on purpose. Seven of the thirteen
+ * video bundles carry the same umt5_xxl_fp8_e4m3fn_scaled text encoder and six
+ * the same wan_2.1_vae, so one neighbour that installed cleanly leaves those
+ * two listed for good. A bundle whose own main model ComfyUI cannot serve then
+ * passed the gate on somebody else's file, and the gate that was built for
+ * exactly this (pnwpdr4519: LU and ComfyUI reading different model folders)
+ * could never fire for a Wan bundle at all.
+ *
+ * The engine state below is the real one behind the screenshot: the .gguf is on
+ * disk at full size, and ComfyUI lists nothing through UnetLoaderGGUF because
+ * the ComfyUI-GGUF pack is not loaded. Same shape for a second copy of ComfyUI,
+ * a moved install, or a scan that never reached the file.
+ *
+ * Run: npx vitest run src/api/__tests__/bundles-installed-every-file.test.ts
+ */
+import { describe, it, expect, vi, beforeEach } from 'vitest'
+import type { ModelBundle } from '../discover'
+
+const backendCall = vi.fn<(cmd: string, args?: unknown) => Promise<unknown>>()
+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 () => [])
+
+vi.mock('../backend', () => ({
+ backendCall: (...a: unknown[]) => backendCall(...(a as [string, unknown])),
+ fetchExternal: vi.fn(),
+}))
+
+vi.mock('../comfyui', () => ({
+ getCheckpoints: async () => [],
+ getDiffusionModels: () => diffusionModels(),
+ getGgufUnetModels: () => ggufUnets(),
+ getVAEModels: () => vaes(),
+ getCLIPModels: () => clips(),
+ filterPartialFiles: async (names: string[]) => new Set(names),
+ refreshComfyModels: vi.fn(async () => true),
+}))
+
+const { checkBundlesInstalled, normalizeModelBase, ENUM_SUBFOLDERS } = await import('../discover')
+
+const GGUF = 'wan2.2-i2v-rapid-aio-v10-nsfw-Q4_K_M.gguf'
+const VAE = 'wan_2.1_vae.safetensors'
+const CLIP = 'umt5_xxl_fp8_e4m3fn_scaled.safetensors'
+
+const RAPID_AIO = {
+ name: 'Wan 2.2 Rapid AIO (Uncensored I2V, GGUF)',
+ description: '',
+ tags: [],
+ totalSizeGB: 16.6,
+ vramRequired: '10-12 GB',
+ files: [
+ { name: '', description: '', pulls: '', tags: [], updated: '', filename: GGUF, subfolder: 'diffusion_models', sizeGB: 10.1 },
+ { name: '', description: '', pulls: '', tags: [], updated: '', filename: VAE, subfolder: 'vae', sizeGB: 0.24 },
+ { name: '', description: '', pulls: '', tags: [], updated: '', filename: CLIP, subfolder: 'text_encoders', sizeGB: 6.27 },
+ ],
+} as unknown as ModelBundle
+
+/** A LoRA bundle: nothing ComfyUI enumerates through these loaders, so the
+ * gate has no business judging it either way. */
+const LORA_ONLY = {
+ name: 'Character LoRA',
+ description: '', tags: [], totalSizeGB: 0.2, vramRequired: '4 GB',
+ files: [
+ { name: '', description: '', pulls: '', tags: [], updated: '', filename: 'mychar.safetensors', subfolder: 'loras', sizeGB: 0.2 },
+ ],
+} as unknown as ModelBundle
+
+describe('a bundle counts as installed only when ComfyUI lists every file it enumerates', () => {
+ beforeEach(() => {
+ vi.clearAllMocks()
+ // The disk says every file of every bundle asked about is there at full size.
+ backendCall.mockImplementation(async (cmd, args) => {
+ if (cmd !== 'check_model_sizes') return undefined
+ const files = (args as { files: Array<{ filename: string }> }).files
+ return files.map((f) => ({ filename: f.filename, exists: true, actualBytes: 1, complete: true }))
+ })
+ // The neighbour bundle (Wan 2.2 TI2V 5B) installed cleanly, so the two
+ // shared helper files are listed. The GGUF pack is not loaded.
+ vaes.mockResolvedValue([VAE])
+ clips.mockResolvedValue([CLIP])
+ diffusionModels.mockResolvedValue([])
+ ggufUnets.mockResolvedValue([])
+ })
+
+ it('the main model ComfyUI cannot serve is not covered by the shared helper files', async () => {
+ const out = await checkBundlesInstalled([RAPID_AIO])
+ expect(out[RAPID_AIO.name]).toBe(false)
+ })
+
+ it('NEGATIVE CONTROL: the old "at least one" expression calls the same state installed', async () => {
+ // The exact gate that shipped in 2.6.6, replayed against the same engine
+ // and the same disk. It is satisfied by wan_2.1_vae alone, which belongs to
+ // a different bundle's install, and the card it drives says Installed for a
+ // model that is in no picker and in no Installed tab. This is the assertion
+ // the fix has to make impossible, so it must read `true` here.
+ const visible = new Set(
+ [...(await vaes()), ...(await clips()), ...(await diffusionModels()), ...(await ggufUnets())]
+ .map(normalizeModelBase),
+ )
+ const enumFiles = RAPID_AIO.files.filter((f) => f.subfolder && ENUM_SUBFOLDERS.has(f.subfolder))
+ const oldGatePasses = enumFiles.some((f) => visible.has(normalizeModelBase(f.filename!)))
+ expect(oldGatePasses).toBe(true)
+ // Same files, same engine, asked properly.
+ const newGatePasses = enumFiles.every((f) => visible.has(normalizeModelBase(f.filename!)))
+ expect(newGatePasses).toBe(false)
+ })
+
+ it('the GGUF pack loaded, so the quant is listed, puts the bundle back to installed', async () => {
+ ggufUnets.mockResolvedValue([GGUF])
+ const out = await checkBundlesInstalled([RAPID_AIO])
+ expect(out[RAPID_AIO.name]).toBe(true)
+ })
+
+ it('a bundle whose files ComfyUI never enumerates is left to the disk check', async () => {
+ const out = await checkBundlesInstalled([LORA_ONLY])
+ expect(out[LORA_ONLY.name]).toBe(true)
+ })
+
+ it('an engine that cannot be reached leaves the disk verdict standing', async () => {
+ vaes.mockRejectedValue(new Error('ECONNREFUSED'))
+ const out = await checkBundlesInstalled([RAPID_AIO])
+ expect(out[RAPID_AIO.name]).toBe(true)
+ })
+})
+
+describe('the row a user actually reads names the cause that fits the file', () => {
+ it('a GGUF names the node pack that reads GGUF, not a folder mismatch', async () => {
+ const { invisibleFileMessage } = await import('../../stores/downloadStore')
+ const msg = invisibleFileMessage(GGUF)
+ expect(msg).toContain('ComfyUI-GGUF')
+ expect(msg).toContain(GGUF)
+ })
+
+ it('a safetensors file still names the folder mismatch', async () => {
+ const { invisibleFileMessage } = await import('../../stores/downloadStore')
+ const msg = invisibleFileMessage(VAE)
+ expect(msg).toContain('different model folders')
+ expect(msg).not.toContain('ComfyUI-GGUF')
+ })
+
+ it('no dashes in either text (house rule) and both stay English', () => {
+ // eslint-disable-next-line no-misleading-character-class
+ const dash = /[\u2013\u2014]/
+ return import('../../stores/downloadStore').then(({ invisibleFileMessage }) => {
+ expect(invisibleFileMessage(GGUF)).not.toMatch(dash)
+ expect(invisibleFileMessage(VAE)).not.toMatch(dash)
+ })
+ })
+})
diff --git a/src/api/discover.ts b/src/api/discover.ts
index 9b256345..898bf6da 100644
--- a/src/api/discover.ts
+++ b/src/api/discover.ts
@@ -175,7 +175,19 @@ export async function checkBundlesInstalled(bundles: ModelBundle[]): Promise<Rec
// copy, moved install). "Installed" from the disk check alone then locks the
// user out: the Create picker (fed by ComfyUI's enums) shows nothing AND
// re-downloading is refused. When ComfyUI is reachable, a bundle only counts
- // as installed if ComfyUI can actually see at least one of its listed files.
+ // as installed if ComfyUI can actually see the files it needs.
+ //
+ // EVERY enumerable file, not merely one of them. GH #113 came back on 2.6.6
+ // (Blahx with a screenshot, lapbo: "the model is not visible, although it is
+ // downloaded") because "at least one" is nearly free in this catalogue:
+ // seven of the thirteen video bundles ship the same umt5_xxl_fp8_e4m3fn_scaled
+ // text encoder and six the same wan_2.1_vae. One neighbour that installed
+ // cleanly leaves those two listed forever, so a bundle whose own main model
+ // ComfyUI cannot serve still passed the gate on somebody else's file. The
+ // card then said Installed while the Installed tab and every picker, which
+ // enumerate the real model, had nothing (Blahx: two cards reading Installed
+ // over a rail counter of 1). The file that makes the bundle what it is is
+ // exactly the file this gate has to be sure about.
if (comfyLists) {
const visible = new Set<string>()
for (const arr of Object.values(comfyLists)) for (const n of arr) visible.add(normalizeModelBase(n))
@@ -183,9 +195,12 @@ export async function checkBundlesInstalled(bundles: ModelBundle[]): Promise<Rec
if (!result[bundle.name]) continue
const enumFiles = bundle.files.filter(f => f.filename && f.subfolder && ENUM_SUBFOLDERS.has(f.subfolder))
if (enumFiles.length === 0) continue
- if (!enumFiles.some(f => visible.has(normalizeModelBase(f.filename!)))) {
+ const unseen = enumFiles.filter(f => !visible.has(normalizeModelBase(f.filename!)))
+ if (unseen.length > 0) {
result[bundle.name] = false
- log.warn(`[discover] ${bundle.name}: files on disk but invisible to the running ComfyUI · not counting as installed`)
+ log.warn(`[discover] ${bundle.name}: files on disk but invisible to the running ComfyUI · not counting as installed`, {
+ files: unseen.map(f => f.filename),
+ })
}
}
}
@@ -226,6 +241,24 @@ export function normalizeModelBase(name: string): string {
.replace(/[-_](fp4|fp8|fp16|bf16|e4m3fn|scaled|fp8_e4m3fn_scaled)$/g, '')
}
+/** Every model name the RUNNING ComfyUI enumerates, as one flat list.
+ *
+ * ONE reader, because "can ComfyUI see this file" is asked from three places
+ * and every place that asked its own way ended up asking a different question.
+ * UNETLoader enumerates only .safetensors and .sft; every GGUF quant is listed
+ * by ComfyUI-GGUF's own loader instead. checkBundlesInstalled was taught that
+ * fifth loader in 2.6.6 (6abf570) and the Create probe in 2.6.5 (b8531b6),
+ * while the Model Manager's install click kept asking four. Both Unfiltered
+ * video bundles are GGUF, so on that path a perfectly listed model came back
+ * "not listed" and the user was told LU and ComfyUI use different model
+ * folders, which was never true. Nothing here may go back to a subset. */
+export async function readComfyModelNames(): Promise<string[]> {
+ const lists = await Promise.all([
+ getCheckpoints(), getDiffusionModels(), getVAEModels(), getCLIPModels(), getGgufUnetModels(),
+ ])
+ return lists.flat()
+}
+
/** Which of `wanted` the RUNNING ComfyUI does not list yet.
*
* One function, because there are two journeys that end in the same place: a
@@ -245,10 +278,7 @@ export function normalizeModelBase(name: string): string {
* not get is not a file we have seen. */
export async function modelsNotVisibleInComfy(wanted: string[]): Promise<string[]> {
try {
- const lists = await Promise.all([
- getCheckpoints(), getDiffusionModels(), getVAEModels(), getCLIPModels(), getGgufUnetModels(),
- ])
- const visible = new Set(lists.flat().map(normalizeModelBase))
+ const visible = new Set((await readComfyModelNames()).map(normalizeModelBase))
return wanted.filter((n) => !visible.has(normalizeModelBase(n)))
} catch {
return wanted // engine unreachable, so it has confirmed nothing
@@ -285,15 +315,78 @@ export async function installCustomNodes(nodeKeys: string[]): Promise<void> {
}
}
-/** How long an install click may wait for ComfyUI to notice a file that is
+/** How long an install click itself waits for ComfyUI to notice a file that is
* already complete on disk. Three rounds of 1.5s against the 20 rounds of 3s
* the Create install and the download poller spend, because this one runs
* inside a click: the common case is an old file that answers on the very
- * first lookup, before any waiting happens at all, and the poller keeps
- * watching the same file with the full budget afterwards. */
+ * first lookup, before any waiting happens at all.
+ *
+ * This is a fast path, NOT the verdict. Anything it cannot confirm inside the
+ * click goes to confirmVisibleOrAccuse below, on the full budget. */
const INVISIBLE_RECHECK_ATTEMPTS = 3
const INVISIBLE_RECHECK_DELAY_MS = 1500
+/** Files whose long visibility confirmation is already running, so a second
+ * click on an overlapping bundle does not start a second one. */
+const confirmingVisibility = new Map<string, Promise<void>>()
+
+/** Resolves once every long visibility confirmation started so far has ended.
+ * The confirmation outlives the install click by design, so a test about its
+ * verdict needs something to wait on, and a test about the NEXT install needs
+ * a way to be sure the previous one is not still asking the engine. */
+export async function whenVisibilityConfirmed(): Promise<void> {
+ await Promise.all([...confirmingVisibility.values()])
+}
+
+/**
+ * D2. Give a file that is on disk but not listed yet the same sixty seconds the
+ * other two paths give it, without holding the click.
+ *
+ * 05ee25ff justified the click's three rounds with "the download poller keeps
+ * watching the same file with the full budget afterwards". For a file that was
+ * DOWNLOADED in this run that is true. For a file the install skipped because
+ * it was already complete on disk it is not: nothing is started, so the Rust
+ * progress map never gains an entry, downloadStore.refresh never sees a
+ * transition to complete, and announceUntilVisible is never called. Those 4.5
+ * seconds were the only window such a file ever got, and the video bundles
+ * share exactly those files, so the case is the common one and not the rare
+ * one. Voxyl AI and Aldrich Ironhart (Discord 2026-08-13) measured scans on the
+ * big files that run far longer than that.
+ *
+ * So the click says what it knows for certain, that the file is on disk, and
+ * this keeps asking. Every round re-announces the arrival, which is what makes
+ * the Model Manager re-run its installed check, and only an engine that still
+ * does not list the file after the full budget is called a folder mismatch.
+ */
+function confirmVisibleOrAccuse(filename: string): Promise<void> {
+ const running = confirmingVisibility.get(filename)
+ if (running) return running
+ const started = runVisibilityConfirmation(filename).finally(() => confirmingVisibility.delete(filename))
+ confirmingVisibility.set(filename, started)
+ return started
+}
+
+async function runVisibilityConfirmation(filename: string): Promise<void> {
+ try {
+ const { waitForModelsVisible } = await import('../lib/bundle-install')
+ const left = await waitForModelsVisible({
+ missing: () => modelsNotVisibleInComfy([filename]),
+ refresh: async () => {
+ await refreshComfyModels().catch(() => false)
+ window.dispatchEvent(new CustomEvent('comfyui-model-downloaded', { detail: { filename } }))
+ },
+ })
+ if (left.length === 0) {
+ log.info(`[discover] ${filename} is listed by ComfyUI now`)
+ return
+ }
+ log.warn(`[discover] ${filename} exists on disk but the running ComfyUI does not list it`)
+ window.dispatchEvent(new CustomEvent('comfyui-model-invisible', { detail: { filename } }))
+ } catch (err) {
+ log.warn('[discover] visibility confirmation failed', { filename, err })
+ }
+}
+
export async function installBundleComplete(bundle: ModelBundle): Promise<void> {
const errors: string[] = []
@@ -320,8 +413,7 @@ export async function installBundleComplete(bundle: ModelBundle): Promise<void>
let visibleBases: Set<string> | null | undefined
const readVisibleBases = async (): Promise<Set<string> | null> => {
try {
- const lists = await Promise.all([getCheckpoints(), getDiffusionModels(), getVAEModels(), getCLIPModels()])
- return new Set(lists.flat().map(normalizeModelBase))
+ return new Set((await readComfyModelNames()).map(normalizeModelBase))
} catch {
return null // ComfyUI unreachable · cannot judge visibility
}
@@ -360,13 +452,12 @@ export async function installBundleComplete(bundle: ModelBundle): Promise<void>
if (!file.downloadUrl || !file.filename || !file.subfolder) continue
if (installedFiles.has(file.filename)) {
const visible = ENUM_SUBFOLDERS.has(file.subfolder) ? await comfyCanSee(file.filename) : null
- if (visible === false) {
- log.warn(`[discover] ${file.filename} exists on disk but the running ComfyUI does not list it`)
- window.dispatchEvent(new CustomEvent('comfyui-model-invisible', { detail: { filename: file.filename } }))
- } else {
- log.info(`[discover] Skipping ${file.filename} · already installed`)
- window.dispatchEvent(new CustomEvent('comfyui-download-exists', { detail: { filename: file.filename } }))
- }
+ // The file is on disk at its full size. That much is certain right now,
+ // so it is what the card is told, and an engine that has not caught up
+ // yet is not turned into an accusation the user cannot act on.
+ log.info(`[discover] Skipping ${file.filename} · already installed`)
+ window.dispatchEvent(new CustomEvent('comfyui-download-exists', { detail: { filename: file.filename } }))
+ if (visible === false) void confirmVisibleOrAccuse(file.filename)
continue
}
try {
diff --git a/src/lib/__tests__/model-visible-wait.test.ts b/src/lib/__tests__/model-visible-wait.test.ts
index a7d8f103..24fb1d68 100644
--- a/src/lib/__tests__/model-visible-wait.test.ts
+++ b/src/lib/__tests__/model-visible-wait.test.ts
@@ -149,12 +149,30 @@ describe('the install path uses it, and says something honest when it runs out',
// diffusion_models, which IS in ENUM_SUBFOLDERS. Without the GGUF loader
// the probe fails for a file ComfyUI lists perfectly well: 20 rounds of
// waiting, an uncalled-for engine restart, then a wrong diagnosis.
+ //
+ // B1 (2.6.7): the loader list moved into one reader, readComfyModelNames,
+ // because the three paths that ask "can ComfyUI see this file" each had
+ // their own copy and they drifted. checkBundlesInstalled was taught the
+ // GGUF loader in 2.6.6 and this probe was born with it, while the Model
+ // Manager's install click kept asking four loaders and told users LU and
+ // ComfyUI use different model folders for a GGUF the engine serves fine.
+ // The guard pins the reader AND that both callers go through it.
+ const reader = discoverSrc.slice(
+ discoverSrc.indexOf('export async function readComfyModelNames'),
+ discoverSrc.indexOf('/** Which of `wanted`'),
+ )
+ expect(reader).toContain('getGgufUnetModels()')
+ expect(discoverSrc).toMatch(/import \{[^}]*getGgufUnetModels[^}]*\} from "\.\/comfyui"/)
const probe = discoverSrc.slice(
discoverSrc.indexOf('export async function modelsNotVisibleInComfy'),
discoverSrc.indexOf('/** #72:'),
)
- expect(probe).toContain('getGgufUnetModels()')
- expect(discoverSrc).toMatch(/import \{[^}]*getGgufUnetModels[^}]*\} from "\.\/comfyui"/)
+ expect(probe).toContain('readComfyModelNames()')
+ const installClick = discoverSrc.slice(
+ discoverSrc.indexOf('const readVisibleBases ='),
+ discoverSrc.indexOf('const comfyCanSee ='),
+ )
+ expect(installClick).toContain('readComfyModelNames()')
// And the caller still runs it through the wait rather than once.
expect(src).toContain('missing: stillMissing, refresh: refreshLists')
expect(src).toContain('const stillMissing = () => modelsNotVisibleInComfy(wanted)')
diff --git a/src/stores/downloadStore.ts b/src/stores/downloadStore.ts
index eda7d9c3..a0cf5092 100644
--- a/src/stores/downloadStore.ts
+++ b/src/stores/downloadStore.ts
@@ -55,6 +55,27 @@ async function announceUntilVisible(filename: string, subfolder: string | undefi
}
}
+/**
+ * What to tell the user about a file that is on disk while the running ComfyUI
+ * does not list it.
+ *
+ * The old text named one cause, a model folder LU and ComfyUI do not share
+ * (pnwpdr4519). For a .gguf that is almost never the cause. UNETLoader does not
+ * enumerate .gguf at all: the file is read by ComfyUI-GGUF's own loader, so a
+ * pack that is missing, or that failed to import because its gguf dependency
+ * landed in a different Python environment, leaves ComfyUI with no loader that
+ * can see the file even though the folder is exactly right. Every Unfiltered
+ * video bundle we ship is a GGUF, which is what lapbo and Blahx were looking at.
+ *
+ * English on purpose, like every error text in the product.
+ */
+export function invisibleFileMessage(filename: string): string {
+ if (filename.toLowerCase().endsWith('.gguf')) {
+ return `${filename} is on disk, but the running ComfyUI does not list it. GGUF models are read by the ComfyUI-GGUF node pack, so this usually means that pack is missing or failed to load. Install this model again from the Model Manager: that installs the pack and restarts ComfyUI. If it is still missing afterwards, LU and ComfyUI are pointed at different model folders, so set the right ComfyUI install under Settings, AI Backends.`
+ }
+ return `${filename} is on disk, but the running ComfyUI does not list it, so LU and ComfyUI are pointed at different model folders. Set the right ComfyUI install under Settings, AI Backends, or restart ComfyUI from LU, then try again.`
+}
+
// Maps filename → bundle name for grouped display
type BundleMap = Record<string, string>
@@ -177,7 +198,7 @@ export const useDownloadStore = create<DownloadStoreState>()((set, get) => ({
...s.downloads,
[filename]: {
progress: 0, total: 0, speed: 0, filename, status: 'error',
- error: 'File is already on disk, but your running ComfyUI does not list it — LU and ComfyUI are using different model folders. Point LU at the right ComfyUI install (Settings → AI Backends) or restart ComfyUI from LU, then try again.',
+ error: invisibleFileMessage(filename),
},
},
}))