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.

Text-to-video must skip I2V-only models (SVD) → fixes "UNETLoader value not in list"

purple7e4500233ed9
diff --git a/src/api/__tests__/vram-handoff.test.ts b/src/api/__tests__/vram-handoff.test.ts
index 6b0b87dd..ea7f64d1 100644
--- a/src/api/__tests__/vram-handoff.test.ts
+++ b/src/api/__tests__/vram-handoff.test.ts
@@ -365,10 +365,28 @@ describe('vramHandoffGenerate — video path', () => {
detectVideoBackend.mockResolvedValue('none')
const out = await vramHandoffGenerate('video', { prompt: 'a wave' })
- expect(out).toMatch(/no video model installed/i)
+ expect(out).toMatch(/no text-to-video model installed/i)
expect(unloadModel).not.toHaveBeenCalled()
})
+ it('text-to-video does NOT pick an I2V-only model (SVD) → would mis-load as UNet', async () => {
+ // Scenario 3c live: gemma omitted inputImage; T2V must skip the SVD
+ // checkpoint and use the real T2V model, else ComfyUI rejects the workflow.
+ getActiveAgentModel.mockReturnValue({ name: 'gpt-4o', providerId: 'openai', remote: false })
+ getVideoModels.mockResolvedValue([
+ { name: 'svd_xt_1_1.safetensors', type: 'svd', source: 'checkpoint' },
+ { name: 'wan2.1_t2v.safetensors', type: 'wan', source: 'diffusion_model' },
+ ])
+ detectVideoBackend.mockResolvedValue('wan')
+ buildTxt2VidWorkflow.mockResolvedValue({ '9': { class_type: 'VHS_VideoCombine' } })
+ submitWorkflow.mockResolvedValue('vpid-2')
+ getHistory.mockResolvedValue({ status: { completed: true }, outputs: { '9': { gifs: [{ filename: 'c.mp4', subfolder: '', type: 'output' }] } } })
+
+ await vramHandoffGenerate('video', { prompt: 'a wave' })
+ // The model handed to buildTxt2VidWorkflow must be the Wan one, never SVD.
+ expect(buildTxt2VidWorkflow.mock.calls[0][0].model).toBe('wan2.1_t2v.safetensors')
+ })
+
it('builds a video workflow via buildTxt2VidWorkflow and returns the URL', async () => {
getActiveAgentModel.mockReturnValue({ name: 'gpt-4o', providerId: 'openai', remote: false })
getVideoModels.mockResolvedValue([{ name: 'wan2.1.safetensors', type: 'wan', source: 'diffusion_model' }])
diff --git a/src/api/vram-handoff.ts b/src/api/vram-handoff.ts
index 46085ed7..7121aa4c 100644
--- a/src/api/vram-handoff.ts
+++ b/src/api/vram-handoff.ts
@@ -440,11 +440,16 @@ async function runHandoff(kind: 'image' | 'video', args: VramHandoffArgs): Promi
targetModel = typeof args.model === 'string' && args.model ? args.model : i2vModels[0].name
videoBackend = backend
} else {
- if (models.length === 0 || backend === 'none') {
- emitHandoff('error', { kind, detail: 'no video model installed' })
- return 'Error: No video model installed in ComfyUI (need a Wan/Hunyuan model or AnimateDiff nodes). Download one from the Create tab and try again.'
+ // Text-to-video must NOT pick an image-to-video-only checkpoint (SVD /
+ // FramePack) — those load via ImageOnlyCheckpointLoader, so feeding one
+ // into a Wan/UNet T2V workflow yields ComfyUI "UNETLoader: value not in
+ // list" (gemma4 live, scenario 3c). Prefer a real T2V model.
+ const t2vModels = models.filter((m) => !isI2VModel(m.name))
+ if (t2vModels.length === 0 || backend === 'none') {
+ emitHandoff('error', { kind, detail: 'no text-to-video model installed' })
+ return 'Error: No text-to-video model installed (an SVD model is image-to-video only). Download a Wan/Hunyuan model from the Create tab — or generate an image first and animate it (image-to-video).'
}
- targetModel = typeof args.model === 'string' && args.model ? args.model : models[0].name
+ targetModel = typeof args.model === 'string' && args.model ? args.model : t2vModels[0].name
videoBackend = backend
}
}