Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.
TypeScript ai-artartificial-intelligencegenerative-artimage-generationimg2imginpaintinglatent-diffusionlinuxmacosoutpaintingstable-diffusiontxt2imgwindows
feat(webv2): video panel entry points and polish
Lincoln Steina896b99fd19f
diff --git a/docs/src/content/docs/features/video-generation.mdx b/docs/src/content/docs/features/video-generation.mdxindex ac2e2e38a5..8357ba8338 100644--- a/docs/src/content/docs/features/video-generation.mdx+++ b/docs/src/content/docs/features/video-generation.mdx@@ -8,6 +8,11 @@ import { Card, CardGrid, Steps } from '@astrojs/starlight/components';InvokeAI ships **experimental support for the Wan 2.2 model family**, which lets you generate short MP4 clips from a text prompt, an image, or both. Output ranges from a few-second loop (the model's training distribution) up to longer sequences assembled with the [concat trick](#making-longer-videos) below.+## The Video panel++The fastest way to generate video is the **Video panel** in the editor's left rail (next to Generate and Upscale) — no workflow required. Type a prompt and pick a Wan 2.2 or MiniMax H3 model for text-to-video; add a **First Frame** for image-to-video, a **Last Frame** for first-to-last interpolation, or an **Initial Video** (with trim) to extend an existing clip toward an optional destination image. The panel knows each model family's constraints — frame grids, canvas rules, fixed vs. adjustable frame rates, which conditioning modes exist per variant — and derives legal output dimensions from your aspect-ratio preset or the conditioning media automatically. When the matching distillation LoRA is installed (Wan's Lightning pair, H3's Turbo), the panel's **fast path** is on by default at the distilled step counts; switch it off for full-quality sampling. The bundled workflow templates below remain available for advanced graph-level control.++:::caution[Experimental]Video generation is a prototype feature. Workflows, node fields, and starter-model packaging may change between releases. The underlying models are also new — expect rough edges in coherence and artifacts at longer durations.:::diff --git a/invokeai/frontend/webv2/public/locales/en.json b/invokeai/frontend/webv2/public/locales/en.jsonindex 676b9d3c20..7c219064ce 100644--- a/invokeai/frontend/webv2/public/locales/en.json+++ b/invokeai/frontend/webv2/public/locales/en.json@@ -1362,7 +1362,9 @@"upscale": "Upscale an image","upscaleDescription": "Add resolution and detail","workflow": "Build a workflow",- "workflowDescription": "Wire nodes together"+ "workflowDescription": "Wire nodes together",+ "video": "Generate a video",+ "videoDescription": "Text, image, or extend an existing clip"},"queue": {"summary": "{{inProgress}} running · {{pending}} queued"@@ -3050,7 +3052,8 @@"removeLora": "Remove {{name}}","selectComponent": "Select a component model…","acceleratorBroken": "Accelerator turned off",- "acceleratorBrokenDescription": "One of its LoRAs was removed or disabled, so steps and CFG were restored to the model's defaults."+ "acceleratorBrokenDescription": "One of its LoRAs was removed or disabled, so steps and CFG were restored to the model's defaults.",+ "resetAllToModelDefaults": "Reset all settings to the model's defaults"}},"workflowLibrary": {diff --git a/invokeai/frontend/webv2/src/features/video/core/settings.test.ts b/invokeai/frontend/webv2/src/features/video/core/settings.test.tsindex e63c6f5055..f9f6c171f6 100644--- a/invokeai/frontend/webv2/src/features/video/core/settings.test.ts+++ b/invokeai/frontend/webv2/src/features/video/core/settings.test.ts@@ -55,11 +55,19 @@ describe('normalizeVideoSettings', () => {expect(isVideoSettings(settings)).toBe(true);});- it('rejects values missing the core shape', () => {+ it('rejects non-records but heals partial records field-by-field, upscale-style', () => {expect(normalizeVideoSettings(null)).toBeNull();- expect(normalizeVideoSettings({})).toBeNull();- expect(normalizeVideoSettings({ ...createSettings(), numFrames: 'many' })).toBeNull();- expect(normalizeVideoSettings({ ...createSettings(), positivePrompt: 7 })).toBeNull();+ expect(normalizeVideoSettings(7)).toBeNull();+ // A seeded partial write ("Send to Video" on a never-opened widget) keeps+ // its payload instead of being nulled and wiped by the reconciler.+ const seeded = normalizeVideoSettings({ firstFrameImage: FIRST_FRAME, sourceVideo: null });++ expect(seeded).not.toBeNull();+ expect(seeded?.firstFrameImage).toEqual(FIRST_FRAME);+ expect(seeded).toMatchObject({ fps: 16, modelKey: '', numFrames: 81, steps: 40, targetResolution: '720p' });+ // Invalid field types heal to defaults rather than failing wholesale.+ expect(normalizeVideoSettings({ ...createSettings(), numFrames: 'many' })?.numFrames).toBe(81);+ expect(normalizeVideoSettings({ ...createSettings(), positivePrompt: 7 })?.positivePrompt).toBe('');});it('fills fields older persisted projects predate with defaults', () => {diff --git a/invokeai/frontend/webv2/src/features/video/core/settings.ts b/invokeai/frontend/webv2/src/features/video/core/settings.tsindex 15c5b77f2e..a5453001cd 100644--- a/invokeai/frontend/webv2/src/features/video/core/settings.ts+++ b/invokeai/frontend/webv2/src/features/video/core/settings.ts@@ -116,28 +116,30 @@ export const VIDEO_UI_STATE_KEYS = {positivePromptHeightPx: true,} satisfies Partial<Record<keyof VideoSettings, true>>;+// Model-agnostic fallbacks for healing partial records. They intentionally+// mirror the Wan fallback in the capability matrix, which cannot be imported+// here (videoPolicies imports this module); when a model is known, the+// selection transition re-snaps them to its family anyway.+const SETTINGS_FALLBACKS = {+ aspectRatioId: '16:9',+ cfgScale: 5,+ fps: 16,+ numFrames: 81,+ steps: 40,+ targetResolution: '720p',+} as const;+/**- * Validate stored widget values and fill in fields that older persisted- * projects predate. The core fields must be present and well-typed; newer- * fields fall back to their defaults so old projects keep their prompts and- * frame counts instead of being reset wholesale.+ * Heals older/partial persisted values without silently clamping invalid user+ * input, upscale-style: any record normalizes field-by-field (so a seeded+ * partial write — e.g. "Send to Video" landing on a never-opened widget —+ * keeps its payload), while range problems stay validation reasons.*/export const normalizeVideoSettings = (values: unknown): VideoSettings | null => {if (!isRecord(values)) {return null;}- const isCoreShapeValid =- typeof values.modelKey === 'string' &&- typeof values.positivePrompt === 'string' &&- typeof values.negativePrompt === 'string' &&- typeof values.shouldRandomizeSeed === 'boolean' &&- ['numFrames', 'fps', 'steps', 'cfgScale', 'seed'].every((key) => hasFiniteNumber(values, key));-- if (!isCoreShapeValid) {- return null;- }-const firstFrameImage = isImageWithDims(values.firstFrameImage) ? values.firstFrameImage : null;// A first frame and a source video are mutually exclusive; if a stale// project somehow holds both, the first frame wins deterministically.@@ -151,20 +153,20 @@ export const normalizeVideoSettings = (values: unknown): VideoSettings | null =>values.acceleratorEnabled === true && areAcceleratorLorasPresent(acceleratorLoraKeys, loras);return {- aspectRatioId: isVideoAspectRatioId(values.aspectRatioId) ? values.aspectRatioId : '16:9',+ aspectRatioId: isVideoAspectRatioId(values.aspectRatioId) ? values.aspectRatioId : SETTINGS_FALLBACKS.aspectRatioId,batchCount: sanitizeBatchCount(values.batchCount),- cfgScale: values.cfgScale as number,+ cfgScale: hasFiniteNumber(values, 'cfgScale') ? (values.cfgScale as number) : SETTINGS_FALLBACKS.cfgScale,cfgScaleLowNoise: hasFiniteNumber(values, 'cfgScaleLowNoise') ? (values.cfgScaleLowNoise as number) : null,firstFrameImage,- fps: values.fps as number,+ fps: hasFiniteNumber(values, 'fps') ? (values.fps as number) : SETTINGS_FALLBACKS.fps,h3TextEncoderModel: isModelIdentifierConfig(values.h3TextEncoderModel) ? values.h3TextEncoderModel : null,h3TransformerModel: isMainModelConfig(values.h3TransformerModel) ? values.h3TransformerModel : null,acceleratorEnabled,acceleratorLoraKeys: acceleratorEnabled ? acceleratorLoraKeys : [],lastFrameImage: isImageWithDims(values.lastFrameImage) ? values.lastFrameImage : null,loras,- modelKey: values.modelKey as string,- negativePrompt: values.negativePrompt as string,+ modelKey: typeof values.modelKey === 'string' ? values.modelKey : '',+ negativePrompt: typeof values.negativePrompt === 'string' ? values.negativePrompt : '',negativePromptEnabled: typeof values.negativePromptEnabled === 'boolean' ? values.negativePromptEnabled : true,negativePromptHeightPx: getClampedNumber(values,@@ -173,8 +175,8 @@ export const normalizeVideoSettings = (values: unknown): VideoSettings | null =>MAX_NEGATIVE_PROMPT_HEIGHT_PX,DEFAULT_NEGATIVE_PROMPT_HEIGHT_PX),- numFrames: values.numFrames as number,- positivePrompt: values.positivePrompt as string,+ numFrames: hasFiniteNumber(values, 'numFrames') ? (values.numFrames as number) : SETTINGS_FALLBACKS.numFrames,+ positivePrompt: typeof values.positivePrompt === 'string' ? values.positivePrompt : '',positivePromptHeightPx: getClampedNumber(values,'positivePromptHeightPx',@@ -182,11 +184,13 @@ export const normalizeVideoSettings = (values: unknown): VideoSettings | null =>MAX_POSITIVE_PROMPT_HEIGHT_PX,DEFAULT_POSITIVE_PROMPT_HEIGHT_PX),- seed: values.seed as number,- shouldRandomizeSeed: values.shouldRandomizeSeed as boolean,+ seed: hasFiniteNumber(values, 'seed') ? (values.seed as number) : 0,+ shouldRandomizeSeed: typeof values.shouldRandomizeSeed === 'boolean' ? values.shouldRandomizeSeed : true,sourceVideo,- steps: values.steps as number,- targetResolution: isVideoTargetResolution(values.targetResolution) ? values.targetResolution : '720p',+ steps: hasFiniteNumber(values, 'steps') ? (values.steps as number) : SETTINGS_FALLBACKS.steps,+ targetResolution: isVideoTargetResolution(values.targetResolution)+ ? values.targetResolution+ : SETTINGS_FALLBACKS.targetResolution,vae: isVaeModelConfig(values.vae) ? values.vae : null,wanLowNoiseModel: isMainModelConfig(values.wanLowNoiseModel) ? values.wanLowNoiseModel : null,wanT5EncoderModel: isModelIdentifierConfig(values.wanT5EncoderModel) ? values.wanT5EncoderModel : null,diff --git a/invokeai/frontend/webv2/src/features/video/ui/VideoHeaderActions.tsx b/invokeai/frontend/webv2/src/features/video/ui/VideoHeaderActions.tsxnew file mode 100644index 0000000000..9b04c805d9--- /dev/null+++ b/invokeai/frontend/webv2/src/features/video/ui/VideoHeaderActions.tsx@@ -0,0 +1,63 @@+/* oxlint-disable react-perf/jsx-no-new-function-as-prop */+import { Icon } from '@chakra-ui/react';+import { useModelsSelector } from '@features/models';+import { normalizeVideoWidgetValues } from '@features/video/core/settings';+import { getVideoSettingsWithModelDefaults } from '@features/video/core/videoPolicies';+import { IconButton, Tooltip } from '@platform/ui';+import { RotateCcwIcon } from 'lucide-react';+import { useTranslation } from 'react-i18next';++import { areVideoValuesEqual } from './videoComparators';+import { useVideoUi } from './VideoUiContext';++/**+ * Widget-header action: reset every model-governed setting (frames, fps,+ * target resolution, steps, CFG, accelerator state) back to the selected+ * model's defaults. Prompts, conditioning media, and non-default-bearing+ * fields are left untouched.+ */+const sortLorasByKey = <T extends { model: { key: string } }>(loras: readonly T[]): T[] =>+ [...loras].sort((a, b) => a.model.key.localeCompare(b.model.key));++export const VideoHeaderActions = () => {+ const { t } = useTranslation();+ const { patchValues, rawValues } = useVideoUi();+ const models = useModelsSelector((snapshot) => snapshot.models);+ // Defaults computed from an unloaded catalog would claim the accelerator+ // pair is "not a default" and strip it as the reset — stay disabled until+ // the catalog is authoritative.+ const modelsLoaded = useModelsSelector((snapshot) => snapshot.status) === 'loaded';+ const values = normalizeVideoWidgetValues(rawValues);+ const model = values?.model ?? null;+ const defaults =+ modelsLoaded && values && model ? { ...getVideoSettingsWithModelDefaults(values, model, models), model } : null;+ // LoRA order is insertion history, not a model-governed setting; compare as sets.+ const isAtModelDefaults =+ values && defaults+ ? areVideoValuesEqual(+ { ...values, loras: sortLorasByKey(values.loras) },+ { ...defaults, loras: sortLorasByKey(defaults.loras) }+ )+ : true;+ const label = t('widgets.video.resetAllToModelDefaults');++ const resetToModelDefaults = () => {+ if (defaults) {+ patchValues({ ...defaults });+ }+ };++ return (+ <Tooltip content={label}>+ <IconButton+ aria-label={label}+ disabled={isAtModelDefaults}+ size="2xs"+ variant="ghost"+ onClick={resetToModelDefaults}+ >+ <Icon as={RotateCcwIcon} boxSize="3.5" />+ </IconButton>+ </Tooltip>+ );+};diff --git a/invokeai/frontend/webv2/src/features/video/ui/implementation.ts b/invokeai/frontend/webv2/src/features/video/ui/implementation.tsindex b0628194f3..0445c5b16d 100644--- a/invokeai/frontend/webv2/src/features/video/ui/implementation.ts+++ b/invokeai/frontend/webv2/src/features/video/ui/implementation.ts@@ -1,3 +1,4 @@+import { VideoHeaderActions } from './VideoHeaderActions';import { VideoWidgetView } from './VideoWidgetView';-export const widgetImplementation = { view: VideoWidgetView };+export const widgetImplementation = { headerActions: VideoHeaderActions, view: VideoWidgetView };diff --git a/invokeai/frontend/webv2/src/workbench/image-actions/ImageContextMenu.tsx b/invokeai/frontend/webv2/src/workbench/image-actions/ImageContextMenu.tsxindex 761741aa32..9e7b50fb35 100644--- a/invokeai/frontend/webv2/src/workbench/image-actions/ImageContextMenu.tsx+++ b/invokeai/frontend/webv2/src/workbench/image-actions/ImageContextMenu.tsx@@ -10,11 +10,13 @@ import {legacyGeneratedImageToGalleryItem,toGalleryItemKey,} from '@features/gallery';+import { createVideoSourceClip } from '@features/video';import { MenuContent, Tooltip } from '@platform/ui';import { MiddleTruncate } from '@platform/ui/MiddleTruncate';import { useOpenWorkbenchWidget } from '@workbench/useOpenWorkbenchWidget';import { useWorkbenchCommands } from '@workbench/WorkbenchContext';import {+ ClapperboardIcon,AsteriskIcon,ChevronRightIcon,CopyIcon,@@ -316,6 +318,27 @@ const SingleItemMenuItems = ({[actions, itemRef]);const handleDelete = useCallback(() => onRequestDeletion([itemRef]), [itemRef, onRequestDeletion]);+ const { generation, widgets } = useWorkbenchCommands();+ const openWidget = useOpenWorkbenchWidget();+ const handleExtendInVideo = useCallback(() => {+ if (item.kind !== 'video') {+ return;+ }++ openWidget('video', { preferredRegions: ['left'] });+ // An initial video and a first frame are mutually exclusive in the panel.+ widgets.patchValues('video', {+ firstFrameImage: null,+ sourceVideo: createVideoSourceClip({+ durationSeconds: item.durationSeconds,+ fps: item.fps,+ height: item.height,+ name: item.name,+ width: item.width,+ }),+ });+ generation.setSource('video');+ }, [generation, item, openWidget, widgets]);return (<>@@ -342,6 +365,14 @@ const SingleItemMenuItems = ({/></HStack><Menu.Separator borderColor="border.subtle" />+ {item.kind === 'video' ? (+ <ContextMenuItem+ icon={ClapperboardIcon}+ label="Extend in Video"+ value="extend-in-video"+ onClick={handleExtendInVideo}+ />+ ) : null}{item.kind === 'video' && previewVideoActions && previewVideoActions.itemKey === toGalleryItemKey(item) ? (<><ContextMenuItem@@ -610,6 +641,15 @@ const SingleImageMenuItems = ({});generation.setSource('upscale');}, [generation, image.height, image.imageName, image.width, openWidget, widgets]);+ const handleSendToVideo = useCallback(() => {+ openWidget('video', { preferredRegions: ['left'] });+ // The first frame and an initial video are mutually exclusive in the panel.+ widgets.patchValues('video', {+ firstFrameImage: { height: image.height, image_name: image.imageName, width: image.width },+ sourceVideo: null,+ });+ generation.setSource('video');+ }, [generation, image.height, image.imageName, image.width, openWidget, widgets]);return (<>@@ -668,6 +708,12 @@ const SingleImageMenuItems = ({</ContextSubMenu><Menu.Separator borderColor="border.subtle" /><ContextMenuItem icon={ScanIcon} label="Send to Upscale" value="send-to-upscale" onClick={handleSendToUpscale} />+ <ContextMenuItem+ icon={ClapperboardIcon}+ label="Send to Video"+ value="send-to-video"+ onClick={handleSendToVideo}+ /><ContextMenuItemdisabled={!actions.canUseAsReferenceImage}icon={ImageIcon}diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/home/IntentTiles.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/home/IntentTiles.tsxindex 714d8a6159..c95c2623e2 100644--- a/invokeai/frontend/webv2/src/workbench/launchpad/home/IntentTiles.tsx+++ b/invokeai/frontend/webv2/src/workbench/launchpad/home/IntentTiles.tsx@@ -4,7 +4,7 @@ import type { LucideIcon } from 'lucide-react';import { Icon, SimpleGrid, Stack, Text } from '@chakra-ui/react';import { Link } from '@tanstack/react-router';import { LAUNCHPAD_INTENT_IDS } from '@workbench/launchpad/intents';-import { BlocksIcon, BrushIcon, ScalingIcon, TypeIcon } from 'lucide-react';+import { BlocksIcon, BrushIcon, ClapperboardIcon, ScalingIcon, TypeIcon } from 'lucide-react';import { useMemo } from 'react';import { useTranslation } from 'react-i18next';@@ -16,7 +16,7 @@ import { useTranslation } from 'react-i18next';* level it is the first move rather than a thing you find after arriving.*/-const TILE_COLUMNS = { base: 1, lg: 4, sm: 2 } as const;+const TILE_COLUMNS = { base: 1, lg: 5, sm: 2 } as const;const TILE_HOVER = { bg: 'bg.muted', borderColor: 'border.emphasized' } as const;const TILE_TRANSITION ='border-color var(--wb-motion-duration-medium) ease, background var(--wb-motion-duration-medium) ease';@@ -25,6 +25,7 @@ const INTENT_ICON: Record<LaunchpadIntentId, LucideIcon> = {canvas: BrushIcon,generate: TypeIcon,upscale: ScalingIcon,+ video: ClapperboardIcon,workflow: BlocksIcon,};@@ -34,6 +35,7 @@ const INTENT_LABEL_KEY: Record<LaunchpadIntentId, string> = {canvas: 'launchpad.home.intents.canvas',generate: 'launchpad.home.intents.generate',upscale: 'launchpad.home.intents.upscale',+ video: 'launchpad.home.intents.video',workflow: 'launchpad.home.intents.workflow',};@@ -41,6 +43,7 @@ const INTENT_DESCRIPTION_KEY: Record<LaunchpadIntentId, string> = {canvas: 'launchpad.home.intents.canvasDescription',generate: 'launchpad.home.intents.generateDescription',upscale: 'launchpad.home.intents.upscaleDescription',+ video: 'launchpad.home.intents.videoDescription',workflow: 'launchpad.home.intents.workflowDescription',};diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/intents.ts b/invokeai/frontend/webv2/src/workbench/launchpad/intents.tsindex 283cd9a4e2..e53e049d3e 100644--- a/invokeai/frontend/webv2/src/workbench/launchpad/intents.ts+++ b/invokeai/frontend/webv2/src/workbench/launchpad/intents.ts@@ -20,7 +20,7 @@ import type { BuiltInLayoutPresetId } from '@workbench/layoutContracts';* shared between both routes, the preset table is not.*/-export type LaunchpadIntentId = 'generate' | 'canvas' | 'upscale' | 'workflow';+export type LaunchpadIntentId = 'generate' | 'canvas' | 'upscale' | 'video' | 'workflow';export interface LaunchpadIntent {id: LaunchpadIntentId;@@ -28,12 +28,19 @@ export interface LaunchpadIntent {sourceId: InvocationSourceId;}-export const LAUNCHPAD_INTENT_IDS: readonly LaunchpadIntentId[] = ['generate', 'canvas', 'upscale', 'workflow'];+export const LAUNCHPAD_INTENT_IDS: readonly LaunchpadIntentId[] = [+ 'generate',+ 'canvas',+ 'upscale',+ 'video',+ 'workflow',+];const INTENTS: Record<LaunchpadIntentId, LaunchpadIntent> = {canvas: { id: 'canvas', presetId: 'edit', sourceId: 'canvas' },generate: { id: 'generate', presetId: 'compose', sourceId: 'generate' },upscale: { id: 'upscale', presetId: 'compose', sourceId: 'upscale' },+ video: { id: 'video', presetId: 'compose', sourceId: 'video' },workflow: { id: 'workflow', presetId: 'automate', sourceId: 'workflow' },};