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(create): K9 Runde 3 Punkt 1, Krea 2 Begleitdateien wirklich holbar

purple992ac20664a7
diff --git a/src/api/__tests__/model-manager-entries-k9.test.ts b/src/api/__tests__/model-manager-entries-k9.test.ts
new file mode 100644
index 00000000..93216753
--- /dev/null
+++ b/src/api/__tests__/model-manager-entries-k9.test.ts
@@ -0,0 +1,96 @@
+/**
+ * K9 nachbessert Runde 3 (GH #136, customer-facing follow-up to Runde 1's
+ * classification fix): the coordinator's own repro found that after Krea 2
+ * checkpoints classify correctly, the resulting error named two companion
+ * files ("Download qwen3vl_4b_fp8_scaled / qwen_image_vae from the Model
+ * Manager") that the Model Manager could not actually provide: krea2 had no
+ * downloadUrl in COMPONENT_REGISTRY and no entry at all in model-bundles.ts.
+ * The customer followed the message and hit a dead end at the next step.
+ *
+ * This is the systematic guard the coordinator asked for: every
+ * `findMatching*` error in comfyui.ts that names a concrete file and points
+ * the customer at "the Model Manager" must name a file that a Model Manager
+ * bundle (getImageBundles() / getVideoBundles(), model-bundles.ts) actually
+ * lists, so the get-path is real instead of aspirational.
+ *
+ * Run: npx vitest run src/api/__tests__/model-manager-entries-k9.test.ts
+ */
+import { describe, it, expect } from 'vitest'
+import { readFileSync } from 'node:fs'
+import { join, dirname } from 'node:path'
+import { fileURLToPath } from 'node:url'
+import { getImageBundles, getVideoBundles, getAudioBundles, getLipsyncBundles, getMotionBundles } from '../model-bundles'
+
+/** Every bundle the Model Manager can actually show a customer, across every
+ * category tab (image/video/audio/lipsync/motion). A file that exists in
+ * only ONE category's getter is still real: findMatching* doesn't know or
+ * care which tab a customer opened. */
+function allBundles() {
+ return [...getImageBundles(), ...getVideoBundles(), ...getAudioBundles(), ...getLipsyncBundles(), ...getMotionBundles()]
+}
+
+const HERE = dirname(fileURLToPath(import.meta.url))
+const COMFYUI_SRC = readFileSync(join(HERE, '..', 'comfyui.ts'), 'utf8')
+
+/** Every `throw new Error(...)` line that points the customer at the Model
+ * Manager AND names at least one concrete filename to fetch (the generic
+ * "download a VAE for your model type" messages carry none and are not
+ * this guard's business: there is nothing to check them against). */
+function modelManagerFileClaims(): { line: number; files: string[] }[] {
+ const claims: { line: number; files: string[] }[] = []
+ COMFYUI_SRC.split('\n').forEach((line, i) => {
+ if (!line.trim().startsWith('throw')) return
+ if (!line.includes('from the Model Manager')) return
+ const files = [...line.matchAll(/"([^"]+\.safetensors)"/g)].map((m) => m[1])
+ if (files.length) claims.push({ line: i + 1, files })
+ })
+ return claims
+}
+
+// Documented, justified exceptions: a filename named in a message that is
+// provably unreachable in production, so a missing bundle entry strands no
+// real customer. Each entry needs a reason a reader can verify in the code.
+const EXCEPTIONS: Record<string, string> = {
+ // determineStrategy() (dynamic-workflow.ts) returns 'unavailable' for
+ // every 'cogvideo' model BEFORE buildDynamicWorkflow ever reaches VAE
+ // resolution (comment there: "the gate deliberately STAYS closed"). The
+ // findMatchingVAE 'cogvideo' branch and its cogvideox_vae_bf16.safetensors
+ // message are therefore dead code no live request can trigger, unlike
+ // krea2's branch, which a customer hit directly.
+ 'cogvideox_vae_bf16.safetensors': "determineStrategy gates 'cogvideo' to unavailable before VAE resolution runs, see dynamic-workflow.ts",
+}
+
+describe('every Model Manager download hint names a file the Model Manager can actually get (K9)', () => {
+ it('sanity: the scanner finds claims, and Krea 2s among them', () => {
+ const claims = modelManagerFileClaims()
+ expect(claims.length).toBeGreaterThan(10)
+ expect(claims.some((c) => c.files.includes('qwen_image_vae.safetensors'))).toBe(true)
+ expect(claims.some((c) => c.files.includes('qwen3vl_4b_fp8_scaled.safetensors'))).toBe(true)
+ })
+
+ it('every named file is listed in a real Model Manager bundle, or is a documented dead-code exception', () => {
+ const bundleFiles = new Set(allBundles().flatMap((b) => b.files.map((f) => f.filename)))
+ const missing: string[] = []
+ for (const { line, files } of modelManagerFileClaims()) {
+ for (const file of files) {
+ if (bundleFiles.has(file)) continue
+ if (file in EXCEPTIONS) continue
+ missing.push(`comfyui.ts:${line} "${file}"`)
+ }
+ }
+ expect(
+ missing,
+ `File(s) named in a "from the Model Manager" error but absent from every Model Manager ` +
+ `bundle: ${missing.join(', ')}. Add the file to a bundle in model-bundles.ts with a ` +
+ `verified downloadUrl, or add a justified, reasoned EXCEPTIONS entry above.`,
+ ).toEqual([])
+ })
+
+ it('Krea 2s two companion files are both in the "Krea 2 Companion Files" bundle, with a downloadUrl', () => {
+ const bundle = getImageBundles().find((b) => b.workflow === 'krea2')
+ expect(bundle).toBeDefined()
+ const byName = (n: string) => bundle!.files.find((f) => f.filename === n)
+ expect(byName('qwen3vl_4b_fp8_scaled.safetensors')?.downloadUrl).toMatch(/^https:\/\//)
+ expect(byName('qwen_image_vae.safetensors')?.downloadUrl).toMatch(/^https:\/\//)
+ })
+})
diff --git a/src/api/component-registry.ts b/src/api/component-registry.ts
index ef5c3fb1..ebb8bcba 100644
--- a/src/api/component-registry.ts
+++ b/src/api/component-registry.ts
@@ -60,14 +60,16 @@ export const COMPONENT_REGISTRY: Record<string, ComponentRequirements> = {
},
// Krea 2 (K9, GH #136): companion VAE/CLIP filenames are not standardized
// across CivitAI finetune authors (qwen_image_vae vs wan_2.1_vae;
- // qwen3vl_4b_int8_convrot vs qwen3vl_4b_fp8_scaled, see the issue). No
- // verified direct-download address exists yet, so downloadUrl stays unset
- // rather than guessing one: findMatchingVAE/findMatchingCLIP still name
- // the exact file to fetch manually via the Model Manager.
+ // qwen3vl_4b_int8_convrot vs qwen3vl_4b_fp8_scaled, see the issue).
+ // Nachbessert Runde 3: downloadUrl now points at the official
+ // Comfy-Org/Krea-2 repackage (verified reachable via HEAD, 2026-09-18),
+ // the exact filenames findMatchingVAE/findMatchingCLIP already name in
+ // their error text; see the matching Model Manager bundle in
+ // model-bundles.ts ("Krea 2 Companion Files").
krea2: {
loader: 'UNETLoader', needsSeparateVAE: true, needsSeparateCLIP: true, clipType: 'krea2',
- vae: { matchPatterns: ['krea', 'qwen_image', 'wan'], downloadFilename: 'qwen_image_vae.safetensors', subfolder: 'vae' },
- clip: { matchPatterns: ['qwen3vl', 'qwen3_vl'], downloadFilename: 'qwen3vl_4b_fp8_scaled.safetensors', subfolder: 'text_encoders' },
+ vae: { matchPatterns: ['krea', 'qwen_image', 'wan'], downloadFilename: 'qwen_image_vae.safetensors', downloadUrl: 'https://huggingface.co/Comfy-Org/Krea-2/resolve/main/vae/qwen_image_vae.safetensors', subfolder: 'vae' },
+ clip: { matchPatterns: ['qwen3vl', 'qwen3_vl'], downloadFilename: 'qwen3vl_4b_fp8_scaled.safetensors', downloadUrl: 'https://huggingface.co/Comfy-Org/Krea-2/resolve/main/text_encoders/qwen3vl_4b_fp8_scaled.safetensors', subfolder: 'text_encoders' },
},
zimage: {
loader: 'UNETLoader', needsSeparateVAE: true, needsSeparateCLIP: true, clipType: 'qwen_image',
diff --git a/src/api/model-bundles.ts b/src/api/model-bundles.ts
index b508eba3..f5d80fcc 100644
--- a/src/api/model-bundles.ts
+++ b/src/api/model-bundles.ts
@@ -237,6 +237,42 @@ export function getImageBundles(): ModelBundle[] {
},
],
},
+ // K9 nachbessert Runde 3 (GH #136): Krea 2 checkpoints come from LU's
+ // built-in CivitAI search, not this catalog, so there is no "Krea 2"
+ // checkpoint bundle here to attach these to. Without an entry the
+ // "Download X from the Model Manager" text findMatchingVAE/findMatchingCLIP
+ // throw (comfyui.ts) named two files the Model Manager had no way to
+ // actually get, so a customer who followed the message got stuck at the
+ // next step. Companions-only bundle, same pattern as every other type's
+ // files array, so the get-path is real: search "Krea 2" in the Model
+ // Manager, download both, done. Addresses verified reachable via HEAD
+ // (2026-09-18) against the official Comfy-Org/Krea-2 repackage.
+ {
+ name: 'Krea 2 Companion Files (Text Encoder + VAE)',
+ description: 'Not a checkpoint: the two files a Krea 2 CivitAI download needs alongside it (text encoder + VAE). Get the checkpoint itself from CivitAI search first.',
+ tags: ['Krea 2', 'Companion Files', 'Text Encoder', 'VAE'],
+ verified: true,
+ totalSizeGB: 5.5,
+ vramRequired: 'depends on the checkpoint',
+ workflow: 'krea2',
+ url: 'https://huggingface.co/Comfy-Org/Krea-2',
+ files: [
+ {
+ name: 'Qwen3-VL 4B Text Encoder (FP8)',
+ description: 'Required text encoder for Krea 2 (matches the "qwen3vl_4b_fp8_scaled" pipeline, e.g. LUSTIFY! v10 Krea2).',
+ pulls: '', tags: ['Text Encoder', '4.9 GB'], updated: '',
+ downloadUrl: 'https://huggingface.co/Comfy-Org/Krea-2/resolve/main/text_encoders/qwen3vl_4b_fp8_scaled.safetensors',
+ filename: 'qwen3vl_4b_fp8_scaled.safetensors', subfolder: 'text_encoders', sizeGB: 4.9,
+ },
+ {
+ name: 'Qwen Image VAE',
+ description: 'Required autoencoder for Krea 2 (matches the "qwen_image_vae" pipeline variant).',
+ pulls: '', tags: ['VAE', '242 MB'], updated: '',
+ downloadUrl: 'https://huggingface.co/Comfy-Org/Krea-2/resolve/main/vae/qwen_image_vae.safetensors',
+ filename: 'qwen_image_vae.safetensors', subfolder: 'vae', sizeGB: 0.24,
+ },
+ ],
+ },
{
name: 'Z-Image Turbo (Unfiltered, Fast)',
description: 'Explicitly unfiltered image model. 8 to 15 seconds per image. No safety filters. Text to Image and Image to Image.',