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: 8 QA bugs — video gen, preflight, classification, I2V upload, bundle detection

PurpleDoubleDcc19ab8edf23
diff --git a/src/api/comfyui.ts b/src/api/comfyui.ts
index 71c04b86..270fe406 100644
--- a/src/api/comfyui.ts
+++ b/src/api/comfyui.ts
@@ -401,6 +401,8 @@ export async function getImageModels(): Promise<ClassifiedModel[]> {
for (const name of checkpoints) {
if (!complete.has(name)) continue
const type = classifyModel(name)
+ // Skip video-type checkpoints (e.g. SVD) — they belong in getVideoModels()
+ if (isVideoModelType(type)) continue
result.push({ name, type: isImageModelType(type) ? type : 'sdxl', source: 'checkpoint' })
}
@@ -416,10 +418,19 @@ export async function getImageModels(): Promise<ClassifiedModel[]> {
}
export async function getVideoModels(): Promise<ClassifiedModel[]> {
- const diffModels = await getDiffusionModels()
- const complete = await filterPartialFiles(diffModels)
+ const [checkpoints, diffModels] = await Promise.all([getCheckpoints(), getDiffusionModels()])
+ const complete = await filterPartialFiles([...checkpoints, ...diffModels])
const result: ClassifiedModel[] = []
+ // Video checkpoints (e.g. SVD)
+ for (const name of checkpoints) {
+ if (!complete.has(name)) continue
+ const type = classifyModel(name)
+ if (isVideoModelType(type)) {
+ result.push({ name, type, source: 'checkpoint' })
+ }
+ }
+
for (const name of diffModels) {
if (!complete.has(name)) continue
const type = classifyModel(name)
diff --git a/src/api/discover.ts b/src/api/discover.ts
index 2ec28d1a..aa24eaf7 100644
--- a/src/api/discover.ts
+++ b/src/api/discover.ts
@@ -1,4 +1,5 @@
import { backendCall, fetchExternal } from "./backend"
+import { getCheckpoints, getDiffusionModels, getVAEModels, getCLIPModels } from "./comfyui"
import type { ProviderId } from "./providers/types"
export interface DiscoverModel {
@@ -112,6 +113,38 @@ export async function checkBundlesInstalled(bundles: ModelBundle[]): Promise<Rec
// If check fails (e.g. no ComfyUI), all bundles are not installed
for (const b of bundles) result[b.name] = false
}
+
+ // Fallback: for bundles not detected by exact filename, check ComfyUI's model lists
+ // This catches variant files (e.g. fp8 version of a model with different filename)
+ const undetected = bundles.filter(b => !result[b.name])
+ if (undetected.length > 0) {
+ try {
+ const [checkpoints, diffModels, vaes, clips] = await Promise.all([
+ getCheckpoints(), getDiffusionModels(), getVAEModels(), getCLIPModels(),
+ ])
+ const modelsBySubfolder: Record<string, string[]> = {
+ checkpoints, diffusion_models: diffModels, vae: vaes, text_encoders: clips,
+ }
+ for (const bundle of undetected) {
+ const allFound = bundle.files.every(f => {
+ if (!f.filename || !f.subfolder) return true
+ const models = modelsBySubfolder[f.subfolder] || []
+ // Strip extension and common quant suffixes for fuzzy matching
+ const base = f.filename.replace(/\.[^.]+$/, '').toLowerCase()
+ .replace(/[-_](fp4|fp8|fp16|bf16|e4m3fn|scaled|fp8_e4m3fn_scaled)$/g, '')
+ return models.some(m => {
+ const mBase = m.replace(/\.[^.]+$/, '').toLowerCase()
+ .replace(/[-_](fp4|fp8|fp16|bf16|e4m3fn|scaled|fp8_e4m3fn_scaled)$/g, '')
+ return mBase === base || mBase.includes(base) || base.includes(mBase)
+ })
+ })
+ if (allFound) result[bundle.name] = true
+ }
+ } catch {
+ // ComfyUI not reachable — keep exact-match results
+ }
+ }
+
return result
}
@@ -135,9 +168,29 @@ export async function installCustomNodes(nodeKeys: string[]): Promise<void> {
export async function installBundleComplete(bundle: ModelBundle): Promise<void> {
const errors: string[] = []
- // Step 1: Start ALL downloads IMMEDIATELY (don't wait for custom nodes)
+ // Pre-check: which files already exist on disk (skip re-downloading them)
+ let installedFiles = new Set<string>()
+ try {
+ const checkFiles = bundle.files
+ .filter(f => f.subfolder && f.filename)
+ .map(f => ({ subfolder: f.subfolder!, filename: f.filename!, expectedBytes: f.sizeGB ? Math.round(f.sizeGB * 1_073_741_824) : 0 }))
+ if (checkFiles.length > 0) {
+ const results: Array<{ filename: string; exists: boolean; complete: boolean }> =
+ await backendCall('check_model_sizes', { files: checkFiles })
+ for (const r of results) {
+ if (r.complete) installedFiles.add(r.filename)
+ }
+ }
+ } catch { /* can't check — download everything */ }
+
+ // Step 1: Start downloads only for files NOT already installed
for (const file of bundle.files) {
if (!file.downloadUrl || !file.filename || !file.subfolder) continue
+ if (installedFiles.has(file.filename)) {
+ console.log(`[discover] Skipping ${file.filename} — already installed`)
+ window.dispatchEvent(new CustomEvent('comfyui-download-exists', { detail: { filename: file.filename } }))
+ continue
+ }
try {
const expectedBytes = file.sizeGB ? Math.round(file.sizeGB * 1_073_741_824) : undefined
const result = await startModelDownload(file.downloadUrl, file.subfolder, file.filename, expectedBytes)
diff --git a/src/components/create/CreateView.tsx b/src/components/create/CreateView.tsx
index 32280380..48c0c4ef 100644
--- a/src/components/create/CreateView.tsx
+++ b/src/components/create/CreateView.tsx
@@ -196,6 +196,13 @@ export function CreateView() {
}, 3000)
}
+ // Re-run preflight when mode or video model changes
+ useEffect(() => {
+ if (connected === true && modelsLoaded) {
+ runPreflight()
+ }
+ }, [mode, videoModel, connected, modelsLoaded, runPreflight])
+
// Detect I2V model (SVD, FramePack need an input image)
const videoModelType = videoModel ? classifyModel(videoModel) : null
const isI2V = mode === 'video' && (videoModelType === 'svd' || videoModelType === 'framepack')
diff --git a/src/components/create/ParamPanel.tsx b/src/components/create/ParamPanel.tsx
index 809267ec..12286cdd 100644
--- a/src/components/create/ParamPanel.tsx
+++ b/src/components/create/ParamPanel.tsx
@@ -1,4 +1,4 @@
-import { useState } from 'react'
+import { useState, useEffect } from 'react'
import { useCreateStore } from '../../stores/createStore'
import { SliderControl } from '../settings/SliderControl'
import { WorkflowFinder } from './WorkflowFinder'
@@ -70,6 +70,16 @@ export function ParamPanel({ imageModels, videoModels, samplerList, schedulerLis
: videoModels
const models = isVideo ? filteredVideoModels : imageModels
+ // Auto-select first model in filtered list when switching video sub-tabs
+ useEffect(() => {
+ if (!isVideo || filteredVideoModels.length === 0) return
+ const currentModel = store.videoModel
+ const isCurrentInList = filteredVideoModels.some(m => m.name === currentModel)
+ if (!isCurrentInList) {
+ store.setVideoModel(filteredVideoModels[0].name)
+ }
+ }, [videoSubTab, isVideo])
+
const sel = 'w-full px-2.5 py-1.5 rounded-lg bg-gray-100 dark:bg-[#1a1a1a] border border-gray-200 dark:border-white/8 text-gray-900 dark:text-white text-[11px] focus:outline-none focus:border-gray-400 dark:focus:border-white/20 cursor-pointer'
const lbl = 'text-[10px] font-medium text-gray-500 dark:text-gray-600 uppercase tracking-widest mb-1 block'
diff --git a/src/hooks/useModels.ts b/src/hooks/useModels.ts
index 1c7bb49b..13015228 100644
--- a/src/hooks/useModels.ts
+++ b/src/hooks/useModels.ts
@@ -8,13 +8,21 @@ import { useProviderStore } from '../stores/providerStore'
import { getEnabledProviders, prefixModelName } from '../api/providers'
import type { PullProgress, AIModel, ModelCategory, ImageModel, VideoModel, CloudModel } from '../types/models'
-const VIDEO_PATTERNS = [/wan/, /svd/, /animatediff/, /animate/, /video/, /cogvideo/, /ltx/i]
+const VIDEO_PATTERNS = [/wan/, /svd/, /animatediff/, /animate/, /video/, /cogvideo/, /ltx/i, /framepack/, /mochi/, /cosmos/, /hunyuan/, /pyramidflow/, /allegro/]
+
+// Embedding models that should never appear in the chat model dropdown
+const EMBEDDING_PATTERNS = [/embed/, /nomic-embed/, /bge-/, /e5-/, /gte-/, /sentence-/]
function isVideoModel(name: string): boolean {
const lower = name.toLowerCase()
return VIDEO_PATTERNS.some((p) => p.test(lower))
}
+function isEmbeddingModel(name: string): boolean {
+ const lower = name.toLowerCase()
+ return EMBEDDING_PATTERNS.some((p) => p.test(lower))
+}
+
export function useModels() {
const {
models, activeModel, activePulls, categoryFilter,
@@ -49,14 +57,19 @@ export function useModels() {
})
)
for (const result of providerResults) {
- if (result.status === 'fulfilled') allModels.push(...result.value)
+ if (result.status === 'fulfilled') {
+ // Filter out embedding models (e.g. nomic-embed-text) — not usable for chat
+ allModels.push(...result.value.filter(m => !isEmbeddingModel(m.name)))
+ }
}
const ollamaEnabled = useProviderStore.getState().providers.ollama.enabled
const hasOllamaModels = allModels.some(m => m.provider === 'ollama')
if (ollamaEnabled && !hasOllamaModels) {
try {
const ollamaModels = await listModels()
- allModels.push(...ollamaModels.map(m => ({ ...m, provider: 'ollama' as const, providerName: 'Ollama' })))
+ allModels.push(...ollamaModels
+ .filter(m => !isEmbeddingModel(m.name))
+ .map(m => ({ ...m, provider: 'ollama' as const, providerName: 'Ollama' })))
} catch { /* Ollama might not be running */ }
}
let comfyModels: AIModel[] = []
diff --git a/src/stores/createStore.ts b/src/stores/createStore.ts
index 93f27f94..db7b667f 100644
--- a/src/stores/createStore.ts
+++ b/src/stores/createStore.ts
@@ -139,7 +139,32 @@ export const useCreateStore = create<CreateState>()(
promptHistory: [],
setPreflightStatus: (ready, errors, warnings) => set({ preflightReady: ready, preflightErrors: errors, preflightWarnings: warnings }),
- setMode: (mode) => set({ mode }),
+ setMode: (mode) => set((state) => {
+ // Reset parameters to the correct defaults when switching modes
+ // This prevents image resolution (1024x1024) leaking into video mode (causes HTTP 500)
+ if (mode === 'video' && state.videoModel) {
+ const type = classifyModel(state.videoModel)
+ const defaults = MODEL_TYPE_DEFAULTS[type] || MODEL_TYPE_DEFAULTS.unknown
+ return {
+ mode,
+ steps: defaults.steps, cfgScale: defaults.cfgScale,
+ sampler: defaults.sampler, scheduler: defaults.scheduler,
+ width: defaults.width, height: defaults.height,
+ ...(defaults.frames ? { frames: defaults.frames } : {}),
+ ...(defaults.fps ? { fps: defaults.fps } : {}),
+ }
+ }
+ if (mode === 'image' && state.imageModel) {
+ const defaults = MODEL_TYPE_DEFAULTS[state.imageModelType] || MODEL_TYPE_DEFAULTS.unknown
+ return {
+ mode,
+ steps: defaults.steps, cfgScale: defaults.cfgScale,
+ sampler: defaults.sampler, scheduler: defaults.scheduler,
+ width: defaults.width, height: defaults.height,
+ }
+ }
+ return { mode }
+ }),
setPrompt: (prompt) => set({ prompt }),
setNegativePrompt: (negativePrompt) => set({ negativePrompt }),
setImageModel: (model, type) => {