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.

feat(create): restore local image-to-video (Animate) across ComfyUI families

purple11da4c5414f3
diff --git a/src/api/__tests__/dynamic-workflow-i2v.test.ts b/src/api/__tests__/dynamic-workflow-i2v.test.ts
new file mode 100644
index 00000000..2cffc26b
--- /dev/null
+++ b/src/api/__tests__/dynamic-workflow-i2v.test.ts
@@ -0,0 +1,227 @@
+/**
+ * Local Animate (I2V) restored (David 2026-07-17): a video request that
+ * carries an inputImage must swap the empty latent for the family's
+ * image-to-video conditioning on the MAIN builder path — WAN 2.1 i2v
+ * (WanImageToVideo), Hunyuan i2v (HunyuanImageToVideo, single conditioning
+ * output), LTX (LTXVImgToVideo), Cosmos (CosmosImageToVideoLatent,
+ * latent-only) — with schema-driven inputs and output mapping. Mochi (t2v
+ * only) and a missing family node must reject-and-report, never silently
+ * ignore the source image (the lu-labs port regression that hid the lane).
+ *
+ * Run: npx vitest run src/api/__tests__/dynamic-workflow-i2v.test.ts
+ */
+import { describe, it, expect, vi, beforeEach } from 'vitest'
+
+vi.mock('../comfyui-nodes', async (importOriginal) => {
+ const actual = await importOriginal<typeof import('../comfyui-nodes')>()
+ return { ...actual, getAllNodeInfo: vi.fn() }
+})
+vi.mock('../backend', async (importOriginal) => {
+ const actual = await importOriginal<typeof import('../backend')>()
+ return { ...actual, localFetch: vi.fn(), comfyuiUrl: (p: string) => `http://test${p}` }
+})
+// The encoder/VAE resolvers hit live model listings — not what these tests pin.
+// Predicates (isI2VModel/isT2VCapable) stay REAL via the actual spread.
+vi.mock('../comfyui', async (importOriginal) => {
+ const actual = await importOriginal<typeof import('../comfyui')>()
+ return {
+ ...actual,
+ findMatchingCLIP: vi.fn(async () => 'mock_text_encoder.safetensors'),
+ findMatchingVAE: vi.fn(async () => 'mock_vae.safetensors'),
+ }
+})
+
+import { buildDynamicWorkflow, WorkflowUnavailableError } from '../dynamic-workflow'
+import { getAllNodeInfo } from '../comfyui-nodes'
+import { isI2VModel, isT2VCapable } from '../comfyui'
+
+type WfNode = { class_type: string; inputs: Record<string, any> }
+const nodeOf = (wf: Record<string, any>, klass: string): [string, WfNode] | undefined =>
+ (Object.entries(wf) as [string, WfNode][]).find(([, n]) => n.class_type === klass)
+
+// Core nodes every video family shares in these fixtures.
+const CORE = {
+ CLIPTextEncode: { input: { required: {} } },
+ KSampler: { input: { required: {} } },
+ VAEDecode: { input: { required: {} } },
+ LoadImage: { input: { required: { image: [[]] } } },
+ VHS_VideoCombine: { input: { required: {} } },
+ EmptyHunyuanLatentVideo: { input: { required: {} } },
+}
+
+const vidParams = (model: string) => ({
+ model,
+ prompt: 'gentle camera push in', negativePrompt: '',
+ sampler: 'euler', scheduler: 'simple',
+ steps: 20, cfgScale: 5, width: 832, height: 480, seed: 7, batchSize: 1,
+ frames: 33, fps: 16,
+ inputImage: 'still.png',
+})
+
+describe('predicate coverage for the Animate picker', () => {
+ it('LTX base checkpoints are dual (i2v + t2v)', () => {
+ expect(isI2VModel('ltx-video-2b-v0.9.safetensors')).toBe(true)
+ expect(isT2VCapable('ltx-video-2b-v0.9.safetensors')).toBe(true)
+ })
+ it('Cosmos Video2World is i2v-only, Text2World stays t2v-only', () => {
+ expect(isI2VModel('Cosmos-1_0-Diffusion-7B-Video2World.safetensors')).toBe(true)
+ expect(isT2VCapable('Cosmos-1_0-Diffusion-7B-Video2World.safetensors')).toBe(false)
+ expect(isI2VModel('Cosmos-1_0-Diffusion-7B-Text2World.safetensors')).toBe(false)
+ expect(isT2VCapable('Cosmos-1_0-Diffusion-7B-Text2World.safetensors')).toBe(true)
+ })
+ it('WAN 2.1 t2v stays out of the Animate list', () => {
+ expect(isI2VModel('wan2.1_t2v_1.3B_bf16.safetensors')).toBe(false)
+ })
+})
+
+describe('buildDynamicWorkflow — I2V override on the main path', () => {
+ beforeEach(() => vi.clearAllMocks())
+
+ it('WAN i2v: WanImageToVideo consumes pos/neg/vae/start_image and re-points the sampler', async () => {
+ vi.mocked(getAllNodeInfo).mockResolvedValue({
+ ...CORE,
+ UNETLoader: { input: { required: { unet_name: [['wan2.1_i2v_14B_fp8.safetensors']] } } },
+ CLIPLoader: { input: { required: { clip_name: [['umt5_xxl_fp8_e4m3fn_scaled.safetensors']] } } },
+ VAELoader: { input: { required: { vae_name: [['wan_2.1_vae.safetensors']] } } },
+ WanImageToVideo: {
+ input: {
+ required: { positive: ['CONDITIONING'], negative: ['CONDITIONING'], vae: ['VAE'], width: ['INT'], height: ['INT'], length: ['INT'], batch_size: ['INT'] },
+ optional: { start_image: ['IMAGE', {}] },
+ },
+ output: ['CONDITIONING', 'CONDITIONING', 'LATENT'],
+ },
+ } as never)
+
+ const wf = await buildDynamicWorkflow(vidParams('wan2.1_i2v_14B_fp8.safetensors') as never, 'wan')
+ const [loadId, load] = nodeOf(wf, 'LoadImage')!
+ const [i2vId, i2v] = nodeOf(wf, 'WanImageToVideo')!
+ const [, sampler] = nodeOf(wf, 'KSampler')!
+ expect(load.inputs.image).toBe('still.png')
+ expect(i2v.inputs.start_image).toEqual([loadId, 0])
+ expect(i2v.inputs.length).toBe(33)
+ expect(sampler.inputs.positive).toEqual([i2vId, 0])
+ expect(sampler.inputs.negative).toEqual([i2vId, 1])
+ expect(sampler.inputs.latent_image).toEqual([i2vId, 2])
+ expect(nodeOf(wf, 'EmptyHunyuanLatentVideo')).toBeUndefined()
+ })
+
+ it('Hunyuan i2v: single CONDITIONING output re-points positive only', async () => {
+ vi.mocked(getAllNodeInfo).mockResolvedValue({
+ ...CORE,
+ UNETLoader: { input: { required: { unet_name: [['hunyuan_video_i2v_720_fp8.safetensors']] } } },
+ CLIPLoader: { input: { required: { clip_name: [['llava_llama3_fp8_scaled.safetensors']] } } },
+ VAELoader: { input: { required: { vae_name: [['hunyuan_video_vae_bf16.safetensors']] } } },
+ HunyuanImageToVideo: {
+ input: {
+ required: { positive: ['CONDITIONING'], vae: ['VAE'], width: ['INT'], height: ['INT'], length: ['INT'], batch_size: ['INT'], guidance_type: [['v1 (concat)', 'v2 (replace)']] },
+ optional: { start_image: ['IMAGE', {}] },
+ },
+ output: ['CONDITIONING', 'LATENT'],
+ },
+ } as never)
+
+ const wf = await buildDynamicWorkflow(vidParams('hunyuan_video_i2v_720_fp8.safetensors') as never, 'hunyuan')
+ const [i2vId, i2v] = nodeOf(wf, 'HunyuanImageToVideo')!
+ const [, sampler] = nodeOf(wf, 'KSampler')!
+ // unknown required widget falls back to the schema's first combo option
+ expect(i2v.inputs.guidance_type).toBe('v1 (concat)')
+ expect(sampler.inputs.positive).toEqual([i2vId, 0])
+ expect(sampler.inputs.latent_image).toEqual([i2vId, 1])
+ // negative stays on the text encoder — Hunyuan's node emits no negative
+ expect(sampler.inputs.negative).not.toEqual([i2vId, expect.anything()])
+ })
+
+ it('LTX: LTXVImgToVideo wires image input and conditioning outputs', async () => {
+ vi.mocked(getAllNodeInfo).mockResolvedValue({
+ ...CORE,
+ UNETLoader: { input: { required: { unet_name: [['ltx-video-2b-v0.9.safetensors']] } } },
+ CLIPLoader: { input: { required: { clip_name: [['t5xxl_fp16.safetensors']] } } },
+ VAELoader: { input: { required: { vae_name: [['ltx_vae.safetensors']] } } },
+ EmptyLTXVLatentVideo: { input: { required: {} } },
+ LTXVImgToVideo: {
+ input: {
+ required: { positive: ['CONDITIONING'], negative: ['CONDITIONING'], vae: ['VAE'], image: ['IMAGE'], width: ['INT'], height: ['INT'], length: ['INT'], batch_size: ['INT'] },
+ },
+ output: ['CONDITIONING', 'CONDITIONING', 'LATENT'],
+ },
+ } as never)
+
+ const wf = await buildDynamicWorkflow(vidParams('ltx-video-2b-v0.9.safetensors') as never, 'ltx')
+ const [loadId] = nodeOf(wf, 'LoadImage')!
+ const [i2vId, i2v] = nodeOf(wf, 'LTXVImgToVideo')!
+ const [, sampler] = nodeOf(wf, 'KSampler')!
+ expect(i2v.inputs.image).toEqual([loadId, 0])
+ expect(sampler.inputs.latent_image).toEqual([i2vId, 2])
+ expect(nodeOf(wf, 'EmptyLTXVLatentVideo')).toBeUndefined()
+ })
+
+ it('Cosmos: latent-only CosmosImageToVideoLatent leaves conditioning untouched', async () => {
+ vi.mocked(getAllNodeInfo).mockResolvedValue({
+ ...CORE,
+ UNETLoader: { input: { required: { unet_name: [['Cosmos-1_0-Diffusion-7B-Video2World.safetensors']] } } },
+ CLIPLoader: { input: { required: { clip_name: [['oldt5_xxl_fp8_e4m3fn_scaled.safetensors']] } } },
+ VAELoader: { input: { required: { vae_name: [['cosmos_cv8x8x8_1.0.safetensors']] } } },
+ EmptyCosmosLatentVideo: { input: { required: {} } },
+ CosmosImageToVideoLatent: {
+ input: {
+ required: { vae: ['VAE'], width: ['INT'], height: ['INT'], length: ['INT'], batch_size: ['INT'] },
+ optional: { start_image: ['IMAGE', {}] },
+ },
+ output: ['LATENT'],
+ },
+ } as never)
+
+ const wf = await buildDynamicWorkflow(vidParams('Cosmos-1_0-Diffusion-7B-Video2World.safetensors') as never, 'cosmos')
+ const [i2vId, i2v] = nodeOf(wf, 'CosmosImageToVideoLatent')!
+ const [, sampler] = nodeOf(wf, 'KSampler')!
+ const [posId] = nodeOf(wf, 'CLIPTextEncode')!
+ expect(i2v.inputs.start_image).toBeDefined()
+ expect(sampler.inputs.latent_image).toEqual([i2vId, 0])
+ // conditioning still comes from the text encoders, not the latent node
+ expect(sampler.inputs.positive).toEqual([posId, 0])
+ expect(nodeOf(wf, 'EmptyCosmosLatentVideo')).toBeUndefined()
+ })
+
+ it('Mochi + inputImage rejects with an actionable message', async () => {
+ vi.mocked(getAllNodeInfo).mockResolvedValue({
+ ...CORE,
+ UNETLoader: { input: { required: { unet_name: [['mochi_preview_bf16.safetensors']] } } },
+ CLIPLoader: { input: { required: { clip_name: [['t5xxl_fp16.safetensors']] } } },
+ VAELoader: { input: { required: { vae_name: [['mochi_vae.safetensors']] } } },
+ EmptyMochiLatentVideo: { input: { required: {} } },
+ } as never)
+
+ await expect(
+ buildDynamicWorkflow(vidParams('mochi_preview_bf16.safetensors') as never, 'mochi'),
+ ).rejects.toThrow(/text-to-video only/i)
+ })
+
+ it('missing family node rejects with an update hint instead of a silent t2v graph', async () => {
+ vi.mocked(getAllNodeInfo).mockResolvedValue({
+ ...CORE,
+ UNETLoader: { input: { required: { unet_name: [['wan2.1_i2v_14B_fp8.safetensors']] } } },
+ CLIPLoader: { input: { required: { clip_name: [['umt5_xxl_fp8_e4m3fn_scaled.safetensors']] } } },
+ VAELoader: { input: { required: { vae_name: [['wan_2.1_vae.safetensors']] } } },
+ // no WanImageToVideo on this (old) ComfyUI
+ } as never)
+
+ await expect(
+ buildDynamicWorkflow(vidParams('wan2.1_i2v_14B_fp8.safetensors') as never, 'wan'),
+ ).rejects.toThrow(WorkflowUnavailableError)
+ })
+
+ it('t2v request (no inputImage) still builds the plain empty-latent graph', async () => {
+ vi.mocked(getAllNodeInfo).mockResolvedValue({
+ ...CORE,
+ UNETLoader: { input: { required: { unet_name: [['wan2.1_t2v_1.3B_bf16.safetensors']] } } },
+ CLIPLoader: { input: { required: { clip_name: [['umt5_xxl_fp8_e4m3fn_scaled.safetensors']] } } },
+ VAELoader: { input: { required: { vae_name: [['wan_2.1_vae.safetensors']] } } },
+ WanImageToVideo: { input: { required: {} }, output: ['CONDITIONING', 'CONDITIONING', 'LATENT'] },
+ } as never)
+
+ const { inputImage: _drop, ...t2v } = vidParams('wan2.1_t2v_1.3B_bf16.safetensors')
+ const wf = await buildDynamicWorkflow(t2v as never, 'wan')
+ expect(nodeOf(wf, 'WanImageToVideo')).toBeUndefined()
+ expect(nodeOf(wf, 'EmptyHunyuanLatentVideo')).toBeDefined()
+ })
+})
diff --git a/src/api/comfyui.ts b/src/api/comfyui.ts
index b3075d54..bba8617d 100644
--- a/src/api/comfyui.ts
+++ b/src/api/comfyui.ts
@@ -207,26 +207,32 @@ export function isVideoModelType(type: ModelType): boolean {
/**
* Can this model accept a source still (image-to-video)? True for explicit i2v
- * tags, SVD, FramePack, and Wan 2.2 TI2V (which is dual T2V/I2V). Used to build
- * the I2V picker list and to route an inputImage to the I2V branch.
+ * tags, SVD, FramePack, Wan 2.2 TI2V (dual T2V/I2V), LTX-Video (its base
+ * checkpoints drive both graphs via LTXVImgToVideo), and Cosmos Video2World.
+ * Used to build the Animate picker list and to route an inputImage to the I2V
+ * branch (local lane restored 2026-07-17).
*/
export function isI2VModel(name: string): boolean {
const lower = name.toLowerCase()
return lower.includes('i2v') || lower.includes('svd') || lower.includes('framepack')
|| lower.includes('ti2v') || lower.includes('wan2.2') || lower.includes('wan2_2') || lower.includes('wan22')
+ || lower.includes('ltx') || lower.includes('video2world')
}
/**
* Can this model do TEXT-to-video (no source image required)? Everything EXCEPT
* the I2V-ONLY checkpoints: SVD and FramePack load via image-only/wrapper loaders,
- * and a CogVideoX *I2V* checkpoint needs a still — none can run a T2V graph. Wan 2.2
- * TI2V is dual-capable, so it stays in the T2V list too (the `ti2v`/`wan2.2` guard
- * wins over the generic `i2v` substring). Keeps wan22 selectable for both modes.
+ * a CogVideoX *I2V* checkpoint needs a still, and Cosmos Video2World is the
+ * conditioned variant (Text2World is its t2v sibling) — none can run a T2V graph.
+ * Wan 2.2 TI2V is dual-capable, so it stays in the T2V list too (the
+ * `ti2v`/`wan2.2` guard wins over the generic `i2v` substring), and LTX base
+ * checkpoints stay because they run both graphs.
*/
export function isT2VCapable(name: string): boolean {
const lower = name.toLowerCase()
if (lower.includes('ti2v') || lower.includes('wan2.2') || lower.includes('wan2_2') || lower.includes('wan22')) return true
if (lower.includes('svd') || lower.includes('framepack')) return false
+ if (lower.includes('video2world')) return false
if (lower.includes('i2v')) return false
return true
}
diff --git a/src/api/dynamic-workflow.ts b/src/api/dynamic-workflow.ts
index fa0e206a..f2e60961 100644
--- a/src/api/dynamic-workflow.ts
+++ b/src/api/dynamic-workflow.ts
@@ -836,6 +836,72 @@ export async function buildDynamicWorkflow(
delete workflow[latentId]
}
+ // ─── I2V override (Animate — local lane restored, David 2026-07-17) ───
+ // A video request carrying an inputImage swaps the empty latent for the
+ // family's image-to-video conditioning node. Covers every family core
+ // ComfyUI can animate on this main path (WAN i2v, Hunyuan i2v, LTX,
+ // Cosmos); wan22/SVD/FramePack already handle the image in their dedicated
+ // builders above. Wiring is schema-driven — we only feed inputs the live
+ // node declares and map outputs by their declared types — so version drift
+ // in these nodes degrades to a ComfyUI validation error, not a bad graph.
+ const isI2V = isVideo && !!(params as GenerateParams).inputImage
+ if (isI2V && ['unet_video', 'unet_ltx', 'unet_cosmos', 'unet_mochi'].includes(strategy)) {
+ if (strategy === 'unet_mochi') {
+ throw new WorkflowUnavailableError(
+ 'Mochi is text-to-video only — pick an i2v-capable model (WAN i2v, WAN 2.2 ti2v, SVD, LTX, Cosmos) to animate an image.',
+ strategy,
+ )
+ }
+ const i2vNode =
+ strategy === 'unet_ltx' ? 'LTXVImgToVideo'
+ : strategy === 'unet_cosmos' ? 'CosmosImageToVideoLatent'
+ : type === 'hunyuan' ? 'HunyuanImageToVideo'
+ : 'WanImageToVideo'
+ const meta = allNodes[i2vNode]
+ if (!meta) {
+ throw new WorkflowUnavailableError(
+ `Animating with this model family needs the ${i2vNode} node, which your ComfyUI doesn't have. Update ComfyUI, then try again.`,
+ strategy,
+ )
+ }
+ const loadId = String(n++)
+ workflow[loadId] = { class_type: 'LoadImage', inputs: { image: (params as GenerateParams).inputImage } }
+ const required = (meta.input?.required ?? {}) as Record<string, any[]>
+ const optional = (meta.input?.optional ?? {}) as Record<string, any[]>
+ const decl = { ...required, ...optional }
+ const inputs: Record<string, any> = {}
+ if (decl.positive) inputs.positive = positiveRef
+ if (decl.negative) inputs.negative = negativeRef
+ if (decl.vae) inputs.vae = [vaeSourceId, vaeOutputSlot]
+ if (decl.width) inputs.width = params.width
+ if (decl.height) inputs.height = params.height
+ if (decl.length) inputs.length = videoParams.frames
+ if (decl.batch_size) inputs.batch_size = 1
+ if (decl.start_image) inputs.start_image = [loadId, 0]
+ else if (decl.image) inputs.image = [loadId, 0]
+ else if (decl.init_image) inputs.init_image = [loadId, 0]
+ // Remaining REQUIRED widgets we don't model: take the schema default
+ // (combo → first option) — same live-schema pattern as the RMBG builder.
+ for (const [key, spec] of Object.entries(required)) {
+ if (inputs[key] !== undefined) continue
+ if (Array.isArray(spec[0])) inputs[key] = spec[0][0]
+ else if (spec[1] && typeof spec[1] === 'object' && 'default' in spec[1]) inputs[key] = spec[1].default
+ }
+ const i2vId = String(n++)
+ workflow[i2vId] = { class_type: i2vNode, inputs, _meta: { title: 'I2V conditioning' } }
+ // Outputs by declared type: 1st CONDITIONING → positive, 2nd → negative
+ // (Hunyuan emits only one — its negative stays on the text encoder),
+ // LATENT → sampler latent. A latent-only node (Cosmos) leaves both
+ // conditionings untouched.
+ const outs: string[] = (meta.output ?? []) as string[]
+ const latSlot = outs.indexOf('LATENT')
+ latentRef = [i2vId, latSlot >= 0 ? latSlot : 0]
+ const condSlots = outs.map((t, i) => (t === 'CONDITIONING' ? i : -1)).filter((i) => i >= 0)
+ if (condSlots.length >= 1) positiveRef = [i2vId, condSlots[0]]
+ if (condSlots.length >= 2) negativeRef = [i2vId, condSlots[1]]
+ delete workflow[latentId]
+ }
+
// ─── Phase 4: Sampling ───
const samplerId = String(n++)
diff --git a/src/components/chat/ModelPickerCard.tsx b/src/components/chat/ModelPickerCard.tsx
index edd403ef..46903bb9 100644
--- a/src/components/chat/ModelPickerCard.tsx
+++ b/src/components/chat/ModelPickerCard.tsx
@@ -2,7 +2,7 @@ import { useEffect, useRef, useState } from 'react'
import { Save, Check, Loader2, Settings2, X } from 'lucide-react'
import { useModelPickStore, MODEL_PICK_TIMEOUT_MS, type ModelPickKind, type ModelPickRequest } from '../../stores/modelPickStore'
import { useSettingsStore } from '../../stores/settingsStore'
-import { getImageModels, getVideoModels, isI2VModel } from '../../api/comfyui'
+import { getImageModels, getVideoModels, isI2VModel, isT2VCapable } from '../../api/comfyui'
import type { AgentToolCall } from '../../types/agent-mode'
/**
@@ -148,9 +148,11 @@ export function ChangeModelInline({ kind }: { kind: ModelPickKind }) {
;(async () => {
try {
const all = kind === 'image' ? await getImageModels() : await getVideoModels()
+ // T2V uses isT2VCapable, NOT !isI2VModel — dual-capable checkpoints
+ // (Wan 2.2 TI2V, LTX) belong in BOTH lists (mirrors model-pick.ts).
const eligible = kind === 'image'
? all
- : all.filter((m) => (kind === 'video-i2v' ? isI2VModel(m.name) : !isI2VModel(m.name)))
+ : all.filter((m) => (kind === 'video-i2v' ? isI2VModel(m.name) : isT2VCapable(m.name)))
if (!cancelled) setModels(eligible.map((m) => m.name))
} catch {
if (!cancelled) { setLoadError(true); setModels([]) }
diff --git a/src/components/create/experimental/ModelChip.tsx b/src/components/create/experimental/ModelChip.tsx
index 644ec72f..85b3e4c2 100644
--- a/src/components/create/experimental/ModelChip.tsx
+++ b/src/components/create/experimental/ModelChip.tsx
@@ -2,6 +2,7 @@ import { useCreateStore } from '../../../stores/createStore'
import { useCloudCatalogStore, defaultCloudModel } from '../../../stores/cloudCatalogStore'
import { Select, type SelectOption } from '../ui/Select'
import { TYPE_BADGE } from './badges'
+import { isI2VModel, isT2VCapable } from '../../../api/comfyui'
const CLOUD_BADGE = { label: 'Cloud', color: 'bg-violet-500/15 text-violet-300' }
@@ -60,6 +61,7 @@ function CloudModelChip() {
function LocalModelChip() {
const mode = useCreateStore((s) => s.mode)
+ const intent = useCreateStore((s) => s.intent())
const imageModel = useCreateStore((s) => s.imageModel)
const videoModel = useCreateStore((s) => s.videoModel)
const imageModelList = useCreateStore((s) => s.imageModelList)
@@ -69,8 +71,19 @@ function LocalModelChip() {
const isVideo = mode === 'video'
- const list = isVideo ? videoModelList : imageModelList
- const value = isVideo ? videoModel : imageModel
+ // Mirror the cloud picker's op-gating (David 2026-07-17: "only offer models
+ // that can actually do it"): Animate lists i2v-capable local models, Video
+ // lists t2v-capable ones (SVD/FramePack are i2v-only and drop out there).
+ const rawList = isVideo ? videoModelList : imageModelList
+ const list = !isVideo
+ ? rawList
+ : intent === 'animate'
+ ? rawList.filter((m) => isI2VModel(m.name))
+ : rawList.filter((m) => isT2VCapable(m.name))
+ const stored = isVideo ? videoModel : imageModel
+ // Reflect the model the run will really use — a leftover pick the current
+ // op can't perform must not show as "selected".
+ const value = list.some((m) => m.name === stored) ? stored : (list[0]?.name ?? stored)
const options: SelectOption[] = list.map((m) => ({
value: m.name,
diff --git a/src/components/create/experimental/__tests__/intents.test.ts b/src/components/create/experimental/__tests__/intents.test.ts
index d943b0fc..5b9eae75 100644
--- a/src/components/create/experimental/__tests__/intents.test.ts
+++ b/src/components/create/experimental/__tests__/intents.test.ts
@@ -3,24 +3,25 @@ import { INTENTS, INTENT_MAP } from '../intents'
// David 2026-07-10 made the advanced ops cloud-only; David 2026-07-12 brought
// Edit BACK to local as the 4th local tab (checkpoint mask inpaint —
-// VAEEncodeForInpaint / InpaintModelConditioning). Animate, upscale and eraser
-// remain hosted-endpoint-only.
+// VAEEncodeForInpaint / InpaintModelConditioning); David 2026-07-17 brought
+// Animate (local I2V) back as the 5th — the lu-labs port had regressed it to
+// cloud-only. Only the true hosted-endpoint ops (upscale, eraser) stay cloud.
describe('intent cloud gating', () => {
- it('animate, upscale and eraser are cloud-only', () => {
- for (const id of ['animate', 'upscale', 'eraser'] as const) {
+ it('upscale and eraser are cloud-only', () => {
+ for (const id of ['upscale', 'eraser'] as const) {
expect(INTENT_MAP[id].cloudOnly, id).toBe(true)
}
})
- it('image, edit, video and removebg stay available locally', () => {
- for (const id of ['image', 'edit', 'video', 'removebg'] as const) {
+ it('image, edit, video, removebg and animate stay available locally', () => {
+ for (const id of ['image', 'edit', 'video', 'removebg', 'animate'] as const) {
expect(INTENT_MAP[id].cloudOnly, id).toBeUndefined()
}
})
- it('the local IntentBar filter keeps exactly the 4 local tabs', () => {
+ it('the local IntentBar filter keeps exactly the 5 local tabs', () => {
const local = INTENTS.filter((m) => !m.cloudOnly).map((m) => m.id)
- expect(local).toEqual(['image', 'edit', 'removebg', 'video'])
+ expect(local).toEqual(['image', 'edit', 'removebg', 'video', 'animate'])
})
it('local edit gates on the inpaint capability + image models', () => {
@@ -31,4 +32,10 @@ describe('intent cloud gating', () => {
expect(INTENT_MAP.image.requiresModels).toBe('image')
expect(INTENT_MAP.video.requiresModels).toBe('video')
})
+
+ it('local animate needs a source image and gates on video models', () => {
+ expect(INTENT_MAP.animate.needsSource).toBe(true)
+ expect(INTENT_MAP.animate.isVideo).toBe(true)
+ expect(INTENT_MAP.animate.requiresModels).toBe('video')
+ })
})
diff --git a/src/components/create/experimental/intents.ts b/src/components/create/experimental/intents.ts
index ea710dd5..ae92ac57 100644
--- a/src/components/create/experimental/intents.ts
+++ b/src/components/create/experimental/intents.ts
@@ -72,10 +72,15 @@ export const INTENTS: IntentMeta[] = [
examples: ['a slow-motion wave breaking on rocks, cinematic', 'timelapse of clouds over a mountain range'],
},
{
+ // Local lane restored 2026-07-17 (David): the lu-labs port had marked
+ // animate cloudOnly, which silently dropped the local I2V the old Create
+ // tab always had. Local builds route through buildDynamicWorkflow's
+ // family-specific I2V wiring (WAN/WAN2.2/Hunyuan/LTX/Cosmos/SVD/FramePack);
+ // the model picker only offers i2v-capable models here.
id: 'animate', label: 'Animate Image', short: 'Animate', icon: Film,
placeholder: 'Describe how the image should move…',
needsSource: true, needsPrompt: true, allowsMask: false, isVideo: true,
- cloudOnly: true,
+ requiresModels: 'video',
examples: ['slow zoom in, subtle parallax', 'hair and clothes moving in the wind'],
},
]
diff --git a/src/hooks/useCreate.ts b/src/hooks/useCreate.ts
index 87b3e599..177e3747 100644
--- a/src/hooks/useCreate.ts
+++ b/src/hooks/useCreate.ts
@@ -14,6 +14,7 @@ import {
buildTxt2ImgWorkflow,
buildTxt2VidWorkflow,
classifyModel,
+ isI2VModel,
extractComfyOutputFiles,
type ClassifiedModel,
type ComfyUIOutput,
@@ -299,6 +300,20 @@ export function useCreate() {
: 'No video model selected. Install Wan 2.1 or AnimateDiff models.')
return
}
+ // Animate (local I2V, restored 2026-07-17): reject-and-report instead of
+ // feeding a start image to a t2v-only checkpoint — that either errors in
+ // ComfyUI or silently ignores the source. The ModelChip already filters
+ // the picker; this guards a stale store selection reaching submit.
+ if (intent === 'animate') {
+ if (!effI2vImage) {
+ setError('Add the image you want to animate first.')
+ return
+ }
+ if (!isI2VModel(activeModel)) {
+ setError(`${activeModel} is text-to-video only. Pick an i2v-capable model (WAN i2v / WAN 2.2 ti2v / SVD / LTX) to animate an image.`)
+ return
+ }
+ }
const isRunning = await checkComfyConnection()
if (!isRunning) {
diff --git a/src/stores/__tests__/createStore.test.ts b/src/stores/__tests__/createStore.test.ts
index 7db2bbd7..e6e93c7a 100644
--- a/src/stores/__tests__/createStore.test.ts
+++ b/src/stores/__tests__/createStore.test.ts
@@ -748,16 +748,19 @@ describe('createStore', () => {
expect(after.source).not.toBeNull()
})
- it('clears animate (i2v falls back to t2v)', () => {
+ it('keeps animate — its local I2V lane is back (2026-07-17)', () => {
+ // The lu-labs port cleared i2v on every local flip ("no local lane");
+ // with the lane restored, a cloud → local switch must keep the user's
+ // animate setup (sub-mode AND source) exactly like edit/removebg do.
const s = useCreateStore.getState()
s.setBackend('cloud')
s.setIntent('animate')
s.setSource(ref)
useCreateStore.getState().setBackend('local')
const after = useCreateStore.getState()
- expect(after.videoSubMode).toBe('t2v')
- expect(after.source).toBeNull()
- expect(after.intent()).toBe('video')
+ expect(after.videoSubMode).toBe('i2v')
+ expect(after.source).not.toBeNull()
+ expect(after.intent()).toBe('animate')
})
it('keeps removebg — it has a local lane via the RMBG node', () => {
diff --git a/src/stores/createStore.ts b/src/stores/createStore.ts
index c7435b60..10613cdc 100644
--- a/src/stores/createStore.ts
+++ b/src/stores/createStore.ts
@@ -452,18 +452,16 @@ export const useCreateStore = create<CreateState>()(
setSource: (source) => set({ source, sourceSetAt: source ? Date.now() : 0, ...(source ? {} : { mask: null }) }),
setMask: (mask) => set({ mask }),
// Flipping to local clears the intents that STILL have no local lane
- // (upscale/eraser hosted endpoints, animate i2v) so the surface never
- // strands on a dead op the IntentBar no longer shows. Edit keeps its
- // state since 2.5.7 — it has a local lane now (checkpoint mask inpaint),
- // exactly like removebg keeps its local RMBG lane.
+ // (upscale/eraser hosted endpoints) so the surface never strands on a
+ // dead op the IntentBar no longer shows. Edit keeps its state since
+ // 2.5.7 (checkpoint mask inpaint), removebg keeps its RMBG lane, and
+ // animate keeps its i2v state since 2026-07-17 — the local I2V lane is
+ // back (buildDynamicWorkflow wires the family's image-to-video node).
setBackend: (backend) =>
set((s) => {
if (backend !== 'local') return { backend }
const patch: Record<string, unknown> = { backend }
if (s.utilityOp) Object.assign(patch, { utilityOp: null, mask: null, error: null })
- if (s.videoSubMode === 'i2v') {
- Object.assign(patch, { videoSubMode: 't2v', source: null, mask: null, sourceSetAt: 0, error: null })
- }
return patch
}),
setCloudImageModel: (cloudImageModel) => set({ cloudImageModel }),