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(video): Wan 2.2 Fast offers the one clip length its endpoint renders

purple2382185050d5
diff --git a/src/lib/render/__tests__/video-duration.test.ts b/src/lib/render/__tests__/video-duration.test.ts
index 51b8a6d7..e7bd1cac 100644
--- a/src/lib/render/__tests__/video-duration.test.ts
+++ b/src/lib/render/__tests__/video-duration.test.ts
@@ -18,7 +18,11 @@
import { describe, expect, it } from 'vitest'
import { readFileSync } from 'node:fs'
import { resolve } from 'node:path'
-import { bookedVideoSeconds, videoDurations } from '../video-duration'
+import { bookedVideoSeconds, effectiveVideoDurations, videoDurations } from '../video-duration'
+import durations from '../video-durations.json'
+import endpoints from '../provider-endpoints.json'
+import schemas from '../provider-schemas.json'
+import { CLOUD_MODEL_SEED } from '../cloud-models'
const WEB = process.env.LU_STUDIO_WEB_REPO?.trim() ? resolve(process.env.LU_STUDIO_WEB_REPO.trim()) : undefined
if (!WEB) {
@@ -48,6 +52,39 @@ describe('priced video duration contract', () => {
expect(() => bookedVideoSeconds('missing', {})).toThrow()
})
+ // Fund F3 (05.10.2026): Wan 2.2 Fast bot "8s" an und buchte dafuer mehr, sein
+ // Endpunkt kennt aber kein Feld fuer die Dauer. Jede Laenge, die die
+ // Oberflaeche anbietet, muss jeder Endpunkt des Modells auch annehmen.
+ it('jede angebotene Laenge nimmt jeder Endpunkt des Modells an', () => {
+ type Field = { enum?: number[]; minimum?: number; maximum?: number }
+ const schemaOf = (path: string) => (schemas as unknown as Record<string, { properties: Record<string, Field> }>)[path]
+ for (const [model, lengths] of Object.entries(durations as Record<string, number[]>)) {
+ const paths = Object.values((endpoints as unknown as Record<string, Record<string, string>>)[model])
+ expect(paths.length, model).toBeGreaterThan(0)
+ for (const path of paths) {
+ const field = schemaOf(path)?.properties.duration
+ if (!field) {
+ // Kein Feld fuer die Dauer: es gibt genau eine Laenge.
+ expect(lengths, `${model} ${path}`).toHaveLength(1)
+ continue
+ }
+ for (const seconds of lengths) {
+ const ok = field.enum
+ ? field.enum.includes(seconds)
+ : seconds >= (field.minimum ?? seconds) && seconds <= (field.maximum ?? seconds)
+ expect(ok, `${model} ${path} ${seconds}s`).toBe(true)
+ }
+ }
+ }
+ })
+
+ it('Wan 2.2 Fast hat eine Laenge, in der Liste wie im Notvorrat des Katalogs', () => {
+ expect(videoDurations('wan-2.2-fast')).toEqual([5])
+ expect(effectiveVideoDurations('wan-2.2-fast')).toEqual([5])
+ expect(CLOUD_MODEL_SEED.find((m) => m.id === 'wan-2.2-fast')?.clip).toEqual({ short: 5 })
+ expect(() => bookedVideoSeconds('wan-2.2-fast', { frames: 128, fps: 16 })).toThrow()
+ })
+
it('exposes the durations file directly, since P3 does not wire CLOUD_MODELS yet', () => {
expect(videoDurations('wan-2.2-720p')).toEqual([5, 8])
expect(videoDurations('missing')).toEqual([])
diff --git a/src/lib/render/cloud-models.ts b/src/lib/render/cloud-models.ts
index 9ccc3cb7..bfa049fc 100644
--- a/src/lib/render/cloud-models.ts
+++ b/src/lib/render/cloud-models.ts
@@ -136,7 +136,8 @@ export const CLOUD_MODEL_SEED: CloudModel[] = [
// note — a future t2v-only or i2v-only model MUST set the flag it lacks to
// false. Server truth is /api/jobs/catalog; keep in sync with uselu.
{ id: 'wan-2.2-720p', label: 'Wan 2.2 720p', kind: 'video', t2v: true, i2v: true, negative_prompt: true, clip: CLIP, tier: 'older', weights: 'open' },
- { id: 'wan-2.2-fast', label: 'Wan 2.2 Fast', kind: 'video', t2v: true, i2v: true, negative_prompt: true, clip: CLIP, tier: 'older', weights: 'open' },
+ // One clip length: its endpoints take no duration field (video-durations.json).
+ { id: 'wan-2.2-fast', label: 'Wan 2.2 Fast', kind: 'video', t2v: true, i2v: true, negative_prompt: true, clip: { short: 5 }, tier: 'older', weights: 'open' },
{ id: 'ltx-2', label: 'LTX-2 (with audio)', kind: 'video', t2v: true, i2v: true, clip: CLIP, credits: { base: 8000, lora: 10000 }, tier: 'older', weights: 'open' },
{ id: 'hunyuan-video', label: 'HunyuanVideo 1.5', kind: 'video', t2v: true, i2v: true, negative_prompt: true, clip: CLIP, tier: 'older', weights: 'open' },
{ id: 'ltx-2.3', label: 'LTX 2.3', kind: 'video', t2v: true, i2v: true, clip: CLIP, tier: 'older', weights: 'open' },
diff --git a/src/lib/render/video-durations.json b/src/lib/render/video-durations.json
index 1105117a..97af514d 100644
--- a/src/lib/render/video-durations.json
+++ b/src/lib/render/video-durations.json
@@ -4,8 +4,7 @@
8
],
"wan-2.2-fast": [
- 5,
- 8
+ 5
],
"ltx-2": [
5,