Skip to content

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.

chore: merge origin/main into feat/tweaks-fixes-compendium-04

Josh Corbettf913fb9a0c83
diff --cc AGENTS.md
index e052eb2ab5,72c42eb2e1..a61c97b5ed
--- a/AGENTS.md
+++ b/AGENTS.md
@@@ -63,13 -62,14 +63,14 @@@ If required independent review is unava
## Commands and environments
-- Use **pnpm 10**, never npm/yarn, for frontends and docs. Each package owns its lockfile. Use `pnpm -C <package> ...`; `.nvmrc` records the development Node version. Read the package scripts instead of assuming root Makefile frontend commands target webv2.
-- Use the existing Python environment and `uv.lock`. For a fresh test environment: `uv sync --locked --extra test`; do not replace a configured accelerator environment with a different backend as routine setup.
-- From the root: `uv tool run [email protected] check <paths>` and `uv tool run [email protected] format --check <paths>`. Python uses 120-column formatting and absolute imports. Respect configured vendored-code exclusions.
-- Run focused Python tests with `uv run --no-sync pytest <test-paths>`; the full CI suite is `uv run --no-sync pytest -n logical` (xdist; each file's tests stay on a single worker). Slow tests are excluded by default: `slow` is the lane for what needs a development machine -- real accelerator hardware, or a quiet one for timing -- and is run there with `-m slow`, not by CI.
-- `-n logical` is CI's invocation, sized for a runner that owns its machine. Do not use it on a development box: it starts one worker per logical core, each importing torch, and a development box is usually also holding a model. Cap the workers instead -- `-n 4` is a reasonable default, and plain `pytest` (no `-n`) is the safe choice -- and do not start a suite while a generation is running. Note that dropping `-n` does not make a run single-threaded: torch still spawns its own thread pool per process, so set `OMP_NUM_THREADS` as well when a run has to stay light.
-- `uv run --no-sync mypy scripts/invokeai-web.py` is an additional diagnostic using the current exclusions, not an enforced CI gate. Do not describe it as comprehensive type coverage.
-- Choose checks by changed behavior. Broaden to the milestone's required gates before review; do not repeatedly rerun unchanged checks without a reason.
-- Install local hooks with `uv run --no-sync pre-commit install` after test dependencies are available. Hook installation is local to each checkout and is not implied by committing the configuration.
+- Use **pnpm 10**, never npm/yarn, with package-owned lockfiles and `pnpm -C <package> ...`. Use `.nvmrc`'s Node version; consult package scripts, not root Makefile assumptions about webv2.
+- Preserve the existing Python/accelerator environment and `uv.lock`. Fresh test setup: `uv sync --locked --extra test`; do not routinely replace accelerator backends.
+- Root Python checks: `uv tool run [email protected] check <paths>` and `uv tool run [email protected] format --check <paths>`. Use 120-column formatting, absolute imports, and configured vendored-code exclusions.
+- Focused tests: `uv run --no-sync pytest <test-paths>`; full CI: `uv run --no-sync pytest -n logical`. Hardware/quiet-machine timing tests use `-m slow` on development machines; excluded by default and CI. See `tests/AGENTS.md` for isolation rules.
++- `-n logical` is sized for CI runners that own the machine. On a development box cap workers (`-n 4`, or plain `pytest`), set `OMP_NUM_THREADS` when a run must stay light, and do not start a suite while a generation is running.
+- `uv run --no-sync mypy scripts/invokeai-web.py` uses current exclusions; it is an optional diagnostic, not a CI gate or comprehensive type coverage.
+- Select checks by behavior; run required milestone gates before review. Repeat unchanged checks only for a reason.
+- After test dependencies are available, install hooks per checkout: `uv run --no-sync pre-commit install`. Committing configuration does not install hooks.
## Scratch files and repository hygiene
diff --cc invokeai/frontend/webv2/performance/architecture-baseline.json
index 3ebc5ceb22,9a43c28e1f..efff9e36cf
--- a/invokeai/frontend/webv2/performance/architecture-baseline.json
+++ b/invokeai/frontend/webv2/performance/architecture-baseline.json
@@@ -2,15 -2,15 +2,15 @@@
"build": {
"launchpad": {
"baseline": {
-- "brotliBytes": 890252,
++ "brotliBytes": 895804,
"cssRawBytes": 2159,
"fontRawBytes": 219480,
-- "gzipBytes": 889073,
++ "gzipBytes": 894617,
"imageRawBytes": 156376,
-- "initialRawBytes": 2113079,
-- "largestAssetRawBytes": 778932,
++ "initialRawBytes": 2128478,
++ "largestAssetRawBytes": 778953,
"otherAssetRawBytes": 0,
-- "ownedRawBytes": 87580,
++ "ownedRawBytes": 89515,
"requestCount": 37,
"scriptRequestCount": 21,
"sourceOwners": [
@@@ -324,15 -318,15 +324,15 @@@
},
"editor": {
"baseline": {
-- "brotliBytes": 1223010,
++ "brotliBytes": 1233253,
"cssRawBytes": 2159,
"fontRawBytes": 219480,
-- "gzipBytes": 1216850,
++ "gzipBytes": 1227029,
"imageRawBytes": 156376,
-- "initialRawBytes": 3131717,
-- "largestAssetRawBytes": 778932,
++ "initialRawBytes": 3164374,
++ "largestAssetRawBytes": 778953,
"otherAssetRawBytes": 0,
-- "ownedRawBytes": 140961,
++ "ownedRawBytes": 141887,
"requestCount": 86,
"scriptRequestCount": 70,
"sourceOwners": [
@@@ -1044,7 -1032,7 +1044,7 @@@
"source": "src/app/WorkbenchApp.tsx"
}
},
-- "capturedAt": "2026-09-20",
++ "capturedAt": "2026-09-22",
"developmentInvalidation": {
"platformUiBarrel": {
"specifier": "@platform/ui",
diff --cc invokeai/frontend/webv2/public/locales/en.json
index 9d80d56d91,cd9e8f7be9..71b96ada49
--- a/invokeai/frontend/webv2/public/locales/en.json
+++ b/invokeai/frontend/webv2/public/locales/en.json
@@@ -4021,56 -3966,29 +4025,78 @@@
"referencesHelp": "Add up to 3 videos and 9 images to condition the generation. A video reference can contribute its image track, its soundtrack, or both. In the text prompt, refer to the conditionings as <Picture 1>, <Video 1>, <Audio 1> and so forth.",
"removeReference": "Remove reference",
"staleReferences": "References are set but the selected model cannot use them.",
- "uploadVideoReference": "Upload video or audio"
+ "staleConditioningClip": "A conditioning clip is set, but this model cannot generate from one.",
+ "conditioningClip": "Conditioning Clip",
+ "conditioningClipHelp": "Drop a clip to generate the other half of it: a picture for its soundtrack, or a soundtrack for its picture.",
+ "conditioningClipBlocked": "Clear the First Frame, Last Frame, Initial Video and References to use a conditioning clip.",
+ "twoStageConditioningBlocked": "A conditioning clip cannot run a two-stage resolution. Pick a single-stage one.",
+ "conditioningRole": "Use from this clip",
+ "conditioningRoleAudio": "Its soundtrack \u2014 generate the picture",
+ "conditioningRoleVideo": "Its picture \u2014 generate the soundtrack",
+ "conditioningRoleVideoHelp": "The clip is re-encoded at the generation's canvas, so the picture comes back cropped and recompressed.",
+ "conditioningDerivedAudio": "{{frames}} frames at {{fps}} FPS, from the soundtrack's length.",
+ "conditioningDerivedVideo": "{{frames}} frames at {{fps}} FPS, from the clip itself.",
+ "dropConditioningClip": "Drop a clip to condition on",
+ "framesFromClip": "The conditioning clip decides the length.",
+ "fpsFromClip": "The generation runs at the conditioning clip's frame rate.",
+ "uploadVideoReference": "Upload video or audio",
+ "advancedGuidance": "Advanced guidance",
+ "audioCfg": "Audio CFG",
+ "audioCfgHelp": "How hard the soundtrack follows the prompt. LTX-2 guides audio far harder than picture.",
+ "stg": "STG",
+ "stgHelp": "Spatio-temporal guidance sharpens motion by steering away from a pass with one attention block skipped. 0 turns it off and saves a forward per step.",
+ "modality": "Modality guidance",
+ "modalityHelp": "How tightly the picture and its soundtrack are held to each other. 1 turns it off and saves a forward per step.",
+ "stepsFixed": "This checkpoint samples a fixed schedule of {{steps}} steps."
+ },
+ "diagnostics": {
+ "chipClean": "Clean",
+ "chipLabel": "Diagnostics: {{label}}",
+ "chipProblems_one": "{{count}} problem",
+ "chipProblems_other": "{{count}} problems",
+ "clearFilters": "Clear filters",
+ "clearScope": "Clear: {{scope}}",
+ "consoleOn": "Console on",
+ "copied_one": "Copied {{count}} event as JSON",
+ "copied_other": "Copied {{count}} events as JSON",
+ "copyEntry": "Copy event JSON",
+ "copyFailed": "Could not copy events to the clipboard.",
+ "copyFiltered": "Copy JSON ({{count}})",
+ "details": "Details",
+ "detailsLabel": "Event details",
+ "downloadFailed": "Could not download the events.",
+ "downloadFiltered": "Download JSON ({{count}})",
+ "downloaded_one": "Downloaded {{count}} event as JSON",
+ "downloaded_other": "Downloaded {{count}} events as JSON",
+ "emptyScope": "No events recorded in this scope yet.",
+ "entryTruncated": "Truncated",
+ "evicted_one": "{{count}} evicted",
+ "evicted_other": "{{count}} evicted",
+ "hideDetails": "Hide details",
+ "listLabel": "Diagnostic events",
+ "namespace": "Namespace",
+ "namespaceAll": "All namespaces",
+ "noMatches": "No events match the current filters.",
+ "openDeveloperSettings": "Open developer settings",
+ "page": "Page {{page}} of {{total}}",
+ "performanceNamespace": "Performance timings",
+ "recordingOff": "Recording off",
+ "recordingOffHint": "Turn on “Record diagnostic logs” in Developer settings to capture events here.",
+ "recordingStatus": "Recording {{level}}+ in {{count}} of {{total}} namespaces",
+ "retention": "{{problems}}/{{problemLimit}} problems · {{verbose}}/{{verboseLimit}} events · {{timings}}/{{timingLimit}} timings",
+ "scope": "Scope",
+ "scopes": {
+ "all": "All account events",
+ "project": "Current project",
+ "projectAndApplication": "Current project + application"
+ },
+ "search": "Search events",
+ "severity": "Minimum severity",
+ "severityAll": "All severities",
+ "severityAtLeast": "{{level}} and above",
+ "timingsOn": "Timings on",
+ "truncated_one": "{{count}} truncated",
+ "truncated_other": "{{count}} truncated"
}
},
"workflowLibrary": {
diff --cc invokeai/frontend/webv2/src/features/video/core/dimensions.ts
index 87b355b3db,d0d645d496..58268c73fd
--- a/invokeai/frontend/webv2/src/features/video/core/dimensions.ts
+++ b/invokeai/frontend/webv2/src/features/video/core/dimensions.ts
@@@ -6,8 -8,19 +8,8 @@@ import type
} from './types';
/**
- * Mirror Wan _scale_and_snap, H3 canvas presets, and reference-image normalization. Return null where backend math
- * rejects input so panel validation can explain it.
- * Client-side ports of the backend's video canvas math, so the panel can show
- * and validate the exact dimensions a graph will run at without extra nodes:
- *
- * - Wan: `_scale_and_snap` in `invokeai/app/invocations/wan/wan_ideal_dimensions.py`
- * ("nearest" rounding — the node default; the other modes are workflow-only).
- * - MiniMax H3: `resolve_canvas_size` in `invokeai/backend/minimax_h3/packing.py`
- * and `resolve_lowres_canvas_size` in `invokeai/backend/minimax_h3/presets.py`.
- * - LTX-2: `resolve_canvas` in `invokeai/backend/ltx2/packing.py`.
- * - Ref2VA image references: `resolve_reference_image_short_edge` and
- * `normalize_reference_image` in `invokeai/backend/minimax_h3/reference_conditioning.py`.
- *
- * Where the backend raises, these return null: the panel falls back to defaults
- * and reports the problem through `getVideoValidationReasons` instead of throwing.
++ * Mirror Wan _scale_and_snap, the H3 and LTX-2 canvas resolvers, and reference-image normalization. Return null
++ * where backend math rejects input so panel validation can explain it.
*/
export interface VideoDimensions {
diff --cc invokeai/frontend/webv2/src/features/video/core/graph.ts
index 90b7f97ef5,09233c2242..8d349e32e0
--- a/invokeai/frontend/webv2/src/features/video/core/graph.ts
+++ b/invokeai/frontend/webv2/src/features/video/core/graph.ts
@@@ -16,13 -16,32 +16,26 @@@ import
} from '@features/generation/graph';
import { getCompatibleDiffusersComponentSource } from '@features/generation/settings';
- import type { VideoGenerationMode, VideoReferenceItem, VideoSettings, VideoSourceClip } from './types';
-
- import { MINIMAX_H3_FPS } from './dimensions';
+ import type {
+ Ltx2TargetResolution,
+ VideoGenerationMode,
+ VideoReferenceItem,
+ VideoSettings,
+ VideoSourceClip,
+ } from './types';
+ import type { SupportedVideoBase } from './videoPolicies';
+
+ import { getLtx2StageCanvases, isLtx2TwoStage, MINIMAX_H3_FPS } from './dimensions';
import { MINIMAX_H3_HYBRID_BLOCK_RANGE, resolveVideoMode } from './settings';
- import { getVideoDimensions, getVideoModelPolicy, getVideoValidationReasons } from './videoPolicies';
+ import {
+ getEffectiveVideoTiming,
+ getVideoDimensions,
+ getVideoModelPolicy,
+ getVideoTargetResolution,
+ getVideoValidationReasons,
+ } from './videoPolicies';
-/**
- * Video graph compilation: one builder per model family, mirroring the shape
- * of the bundled video workflow templates (which are the reference wiring for
- * conditioning fan-out and metadata). Every graph exposes the same three fixed
- * node ids so the submit pipeline can inject expanded prompts and batch seeds
- * exactly as it does for image generation.
- */
+/** Mirror bundled template wiring per model family and expose fixed prompt/seed node IDs for submission batching. */
export interface CompiledVideoGraph {
backendGraph: BackendGraphContract;
diff --cc invokeai/frontend/webv2/src/features/video/core/settings.test.ts
index 880d0083c0,55f24916d9..43fb9592d8
--- a/invokeai/frontend/webv2/src/features/video/core/settings.test.ts
+++ b/invokeai/frontend/webv2/src/features/video/core/settings.test.ts
@@@ -87,11 -128,16 +128,21 @@@ describe('normalizeVideoSettings', () =
expect(isVideoSettings(settings)).toBe(true);
});
+ it('folds a low-noise CFG below 1 back into reuse-primary', () => {
+ expect(normalizeVideoSettings({ ...createSettings(), cfgScaleLowNoise: 0.5 })?.cfgScaleLowNoise).toBeNull();
+ expect(normalizeVideoSettings({ ...createSettings(), cfgScaleLowNoise: 1 })?.cfgScaleLowNoise).toBe(1);
+ });
+
+ it('does not call a record with a garbage conditioning clip valid settings', () => {
+ // The guard's whole job is deciding whether a stored record can be used as-is; a slot it does
+ // not look at is a slot that reaches the graph builder unchecked.
+ const clip = { clip: CONDITIONING_CLIP, fpsKnown: true, role: 'audio' as const };
+
+ expect(isVideoSettings(createSettings({ conditioningClip: clip }))).toBe(true);
+ expect(isVideoSettings({ ...createSettings(), conditioningClip: { clip: CONDITIONING_CLIP } })).toBe(false);
+ expect(isVideoSettings({ ...createSettings(), conditioningClip: 'nonsense' })).toBe(false);
+ });
+
it('rejects non-records but heals partial records field-by-field, upscale-style', () => {
expect(normalizeVideoSettings(null)).toBeNull();
expect(normalizeVideoSettings(7)).toBeNull();
diff --cc invokeai/frontend/webv2/src/features/video/core/settings.ts
index 7776aa96ae,c4fa81cb7a..5ac062b29b
--- a/invokeai/frontend/webv2/src/features/video/core/settings.ts
+++ b/invokeai/frontend/webv2/src/features/video/core/settings.ts
@@@ -253,11 -345,19 +272,14 @@@ const areAcceleratorLorasPresent = (key
keys.length > 0 && keys.every((key) => loras.some((lora) => lora.model.key === key && lora.isEnabled));
/**
- * Which inputs are filled decides the mode; there is no mode selector. A first
- * frame and a source video never coexist (normalization and the setters both
- * enforce it), and a last frame refines whichever mode its partner implies:
- * with a first frame it becomes FLF2V interpolation, with a source video it is
- * the destination the extension should land on. References always win: with a
- * source video alongside them (Ref2VA reference-extend) the mode stays
- * `reference` and the graph appends the new clip to the source.
+ * Inputs determine mode. First frame/source are exclusive; references win and may coexist with source video for
+ * reference extension.
*/
export const resolveVideoMode = (
- settings: Pick<VideoSettings, 'firstFrameImage' | 'lastFrameImage' | 'sourceVideo' | 'references'>
+ settings: Pick<
+ VideoSettings,
+ 'firstFrameImage' | 'lastFrameImage' | 'sourceVideo' | 'references' | 'conditioningClip'
+ >
): VideoGenerationMode => {
if (settings.references.length > 0) {
return 'reference';
@@@ -311,9 -427,17 +339,15 @@@ export const normalizeVideoSettings = (
// A first frame and a source video are mutually exclusive; if a stale
// project somehow holds both, the first frame wins deterministically.
const sourceVideo = !firstFrameImage && isVideoSourceClip(values.sourceVideo) ? values.sourceVideo : null;
+ // One conditioning clip at a time, and never alongside a first frame or an initial video: those
+ // condition the same stream this one would hold, and the model samples exactly one modality.
+ const conditioningClip =
+ !firstFrameImage && !sourceVideo && isVideoConditioningClip(values.conditioningClip)
+ ? values.conditioningClip
+ : null;
const loras = Array.isArray(values.loras) ? values.loras.filter(isVideoLora) : [];
const acceleratorLoraKeys = getStringArray(values.acceleratorLoraKeys);
- // The flag means "the accelerator LoRAs the toggle added are active": if any
- // of them is gone (deleted from Concepts, dropped as incompatible), the flag
- // clears rather than claiming a fast path that has nothing behind it.
+ // Clear acceleration when any required accelerator LoRA disappears instead of claiming an inactive fast path.
const acceleratorEnabled =
values.acceleratorEnabled === true && areAcceleratorLorasPresent(acceleratorLoraKeys, loras);
@@@ -321,11 -445,13 +355,15 @@@
aspectRatioId: isVideoAspectRatioId(values.aspectRatioId) ? values.aspectRatioId : SETTINGS_FALLBACKS.aspectRatioId,
batchCount: sanitizeBatchCount(values.batchCount),
cfgScale: hasFiniteNumber(values, 'cfgScale') ? (values.cfgScale as number) : SETTINGS_FALLBACKS.cfgScale,
- cfgScaleLowNoise: hasFiniteNumber(values, 'cfgScaleLowNoise') ? (values.cfgScaleLowNoise as number) : null,
- // Null is the healed value for every per-family guidance scale: the model
- // selection transition fills in the family's own default, and a number
- // healed in here would be another family's.
+ // Below 1 the node falls back to the primary CFG, which the widget spells `null`.
+ cfgScaleLowNoise:
+ hasFiniteNumber(values, 'cfgScaleLowNoise') && (values.cfgScaleLowNoise as number) >= 1
+ ? (values.cfgScaleLowNoise as number)
+ : null,
++ // Null is the healed value for every per-family guidance scale; the model transition fills the family default.
+ audioCfgScale: hasFiniteNumber(values, 'audioCfgScale') ? (values.audioCfgScale as number) : null,
+ modalityScale: hasFiniteNumber(values, 'modalityScale') ? (values.modalityScale as number) : null,
+ stgScale: hasFiniteNumber(values, 'stgScale') ? (values.stgScale as number) : null,
firstFrameImage,
fps: hasFiniteNumber(values, 'fps') ? (values.fps as number) : SETTINGS_FALLBACKS.fps,
h3HybridBaseModel: isMainModelConfig(values.h3HybridBaseModel) ? values.h3HybridBaseModel : null,
@@@ -508,9 -662,47 +557,33 @@@ export const createVideoSourceClip = (i
export const getDefaultReferenceConditioning = (mediaOrigin: string | null | undefined): VideoReferenceConditioning =>
mediaOrigin === 'audio_upload' ? 'audio' : 'video_audio';
+ /**
- * Which stream a freshly dropped conditioning clip is taken for. An `audio_upload` record is a
- * bare soundtrack wrapped as a video and has no picture worth conditioning on, so it can only be
- * the audio side. Anything else defaults to `video` -- every clip has a picture, while asking for
- * the soundtrack of one that turns out to be silent fails at run time.
++ * An audio_upload record is a bare soundtrack, so it can only condition the audio side; every other clip
++ * defaults to video.
+ */
+ export const getDefaultConditioningRole = (mediaOrigin: string | null | undefined): VideoConditioningRole =>
+ mediaOrigin === 'audio_upload' ? 'audio' : 'video';
+
+ export const createVideoConditioningClip = (item: {
+ durationSeconds: number;
+ fps?: number;
+ height: number;
+ mediaOrigin?: string;
+ name: string;
+ width: number;
+ }): VideoConditioningClip => {
+ const { endFrame: _endFrame, startFrame: _startFrame, ...clip } = createVideoSourceClip(item);
+
+ return {
+ clip,
+ fpsKnown: typeof item.fps === 'number' && Number.isFinite(item.fps) && item.fps > 0,
+ role: getDefaultConditioningRole(item.mediaOrigin),
+ };
+ };
+
/**
- * Whether a video reference can serve as the reference-extend ANCHOR.
- *
- * The anchor carries the tail of the Initial Video across the seam, and that is what the
- * generated frames continue from. An 'audio' reference contributes soundtrack rows and no
- * visual rows at all — the backend decodes a reference's frames only when its packed kind
- * is `video` (`reference_kind`) — so it has nothing to offer the seam. Nor does it fail
- * loudly: the all-audio validation reason needs EVERY reference to be audio-only, so one
- * image reference alongside is enough to let a silently discontinuous seam queue.
- *
- * So an audio-only reference is never CHOSEN as the anchor. Adoption and the recall
- * re-derive both skip it, and the anchor is appended fresh instead — which keeps the
- * soundtrack the user actually asked for rather than overwriting it with a role it cannot
- * fill. Only an entry already claiming the flag is converted, by
- * {@link anchorReferenceConditioning}.
+ * Audio-only references cannot anchor visual continuity. Preserve them as user references and select or append a
+ * visual anchor instead.
*/
const canAnchorReferenceExtend = (entry: VideoReferenceItem): boolean =>
entry.kind === 'video' && entry.conditioning !== 'audio';
diff --cc invokeai/frontend/webv2/src/features/video/core/types.ts
index c1ea2e599e,2d1ec8f08c..964b1b6ffa
--- a/invokeai/frontend/webv2/src/features/video/core/types.ts
+++ b/invokeai/frontend/webv2/src/features/video/core/types.ts
@@@ -7,11 -7,22 +7,19 @@@ import type
} from '@features/generation/contracts';
import type { SeedMode } from '@platform/core/seed';
-/**
- * How a video generation is conditioned. There is no explicit mode selector:
- * the mode is inferred from which inputs are filled — see `resolveVideoMode`.
- */
+/** Infer conditioning mode from populated inputs through resolveVideoMode. */
- export type VideoGenerationMode = 'txt2vid' | 'first-frame' | 'last-frame' | 'first-last' | 'extend' | 'reference';
+ export type VideoGenerationMode =
+ | 'txt2vid'
+ | 'first-frame'
+ | 'last-frame'
+ | 'first-last'
+ | 'extend'
+ | 'reference'
+ | 'audio-to-video'
+ | 'video-to-audio';
- /** A gallery video selected as the clip to extend, with the trim range to keep. */
- export interface VideoSourceClip {
+ /** A gallery video's identity and geometry, as the panel stores it. */
+ export interface VideoClipRef {
video_name: string;
width: number;
height: number;
@@@ -22,7 -37,36 +34,22 @@@ export interface VideoSourceClip extend
endFrame: number;
}
+ /** Which stream of a conditioning clip the model is given, and which it therefore generates. */
+ export type VideoConditioningRole = 'audio' | 'video';
+
+ /**
- * A clip supplied as conditioning for the *other* modality: its soundtrack with the picture
- * generated (`audio`), or its picture with the soundtrack generated (`video`).
- *
- * One slot rather than two, because the two modes are mutually exclusive -- LTX-2 holds one
- * modality clean and samples the other, so a clip can only be given in one role at a time.
++ * A clip conditioning the opposite modality. One slot, because LTX-2 holds one modality clean and samples the
++ * other, so a clip can only be given in one role at a time.
+ */
+ export interface VideoConditioningClip {
- /**
- * Whole-clip, untrimmed: `ltx2_audio_conditioning` and `ltx2_video_conditioning` consume the
- * whole recording, so trim bounds here would be state the graph does not honour.
- */
++ /** Whole-clip and untrimmed: the conditioning nodes consume the whole recording. */
+ clip: VideoClipRef;
+ role: VideoConditioningRole;
- /**
- * Whether the gallery actually knew the clip's frame rate. A video record's `fps` is nullable,
- * and `clip.fps` then holds the panel's fallback -- a guess, which must not become the rate a
- * held picture is played and timed at. False leaves the frame-rate control to the user.
- */
++ /** False when the gallery record had no frame rate and `clip.fps` is the panel's guess. */
+ fpsKnown: boolean;
+ }
+
-/**
- * Which streams a Ref2VA video reference conditions. The graph-literal values of the
- * `minimax_h3_video_reference` node: 'audio' maps to upstream's standalone audio-reference
- * kind, sourced from the video's soundtrack.
- */
+/** Reference conditioning maps directly to graph literals; audio uses the clip's soundtrack without visual rows. */
export type VideoReferenceConditioning = 'video_audio' | 'video' | 'audio';
/** Ref2VA image-reference sizing: 'max' = 2048px short edge, 'match' = generation's pixel area. */
@@@ -54,9 -118,16 +81,11 @@@ export type VideoReferenceItem
export type WanTargetResolution = '480p' | '720p' | '1080p';
export type MiniMaxH3TargetResolution = '768 highres' | '768 lowres';
- export type VideoTargetResolution = WanTargetResolution | MiniMaxH3TargetResolution;
+ /** LTX-2 presets pin the canvas's SHORT edge; the long edge follows the aspect ratio. */
+ export type Ltx2TargetResolution = '512p' | '704p' | '768p' | '1024p' | '1536p';
+ export type VideoTargetResolution = WanTargetResolution | MiniMaxH3TargetResolution | Ltx2TargetResolution;
-/**
- * The preset ratios the video panel offers. No `Free` and no width/height
- * fields: pixel dimensions are always derived — from this ratio plus the
- * target-resolution preset in text-to-video, or from the conditioning media's
- * own ratio once a frame or source video is set.
- */
+/** Derive dimensions from preset ratio/resolution or conditioning media; no free-size fields are offered. */
export type VideoAspectRatioId = '21:9' | '16:9' | '3:2' | '4:3' | '1:1' | '3:4' | '2:3' | '9:16' | '9:21';
/** Project-persisted settings owned by the Video widget. */
@@@ -71,13 -142,26 +100,15 @@@ export interface VideoSettings
/** Image-to-video conditioning. Mutually exclusive with `sourceVideo`. */
firstFrameImage: ImageWithDims | null;
/**
- * The frame the clip should end on: FLF2V interpolation with a first frame,
- * or the destination image when extending a source video. Combines with
- * either `firstFrameImage` or `sourceVideo`.
+ * Last frame supplies interpolation's endpoint or an extension destination, paired with first frame or source
+ * video.
*/
lastFrameImage: ImageWithDims | null;
- /**
- * The clip to extend. Mutually exclusive with `firstFrameImage`. On an
- * FL2VA model this drives extend mode; on a Ref2VA model it coexists with
- * `references` (reference-extend: the new clip is appended to it, and a
- * linked tail reference provides continuity).
- */
+ /** Source excludes first frame; FL2VA uses extend mode while Ref2VA appends using a linked tail reference. */
sourceVideo: VideoSourceClip | null;
+ /** A clip conditioning the opposite modality; null unless the family offers a2v/v2a. */
+ conditioningClip: VideoConditioningClip | null;
- /**
- * Ref2VA references, in conditioning order (up to 3 videos and 9 images).
- * Mutually exclusive with `firstFrameImage`/`lastFrameImage`; `sourceVideo`
- * may coexist on a Ref2VA model (reference-extend). Only a Ref2VA
- * transformer consumes them — see `resolveVideoMode` and the `reference` mode.
- */
+ /** Ordered Ref2VA references exclude frame slots but may coexist with source video for reference extension. */
references: VideoReferenceItem[];
aspectRatioId: VideoAspectRatioId;
targetResolution: VideoTargetResolution;
@@@ -87,9 -171,29 +118,18 @@@
cfgScale: number;
/** Guidance for the low-noise half of a Wan A14B schedule; null reuses `cfgScale`. */
cfgScaleLowNoise: number | null;
+ /**
- * LTX-2 guides its audio stream separately from its video, and far harder
- * (the release uses 7 against video's 3). Null on a family with one guidance
- * scale, the way `cfgScaleLowNoise` is null outside Wan A14B.
++ * LTX-2 guides audio separately from video and far harder (7 against 3). Null on a family with one guidance
++ * scale, like `cfgScaleLowNoise` outside Wan A14B.
+ */
+ audioCfgScale: number | null;
- /**
- * LTX-2 spatio-temporal guidance: steers away from a pass whose self-attention
- * is skipped in one transformer block, which sharpens motion. 0 turns it off
- * and saves a forward per step. Null on families without it.
- */
++ /** LTX-2 spatio-temporal guidance; 0 turns it off and saves a forward per step. Null on families without it. */
+ stgScale: number | null;
- /**
- * LTX-2 modality-isolation guidance: steers away from a pass with the
- * audio/video cross-attention disabled, tightening the two streams'
- * agreement. 1 turns it off. Null on families without it.
- */
++ /** LTX-2 modality-isolation guidance; 1 turns it off. Null on families without it. */
+ modalityScale: number | null;
/**
- * The family's distillation fast path: the Lightning LoRA pair at 4 steps /
- * CFG 1 for Wan A14B, the Turbo LoRA at 6 steps for MiniMax H3. Toggling it
- * patches steps/CFG and the `loras` list — see `getAcceleratorToggleResult`
- * — so the flag records intent, not hidden state.
+ * Acceleration patches visible sampling settings and LoRAs; this flag records intent rather than hidden graph
+ * state.
*/
acceleratorEnabled: boolean;
/**
@@@ -115,9 -228,18 +155,13 @@@
h3TransformerModel: MainModelConfig | null;
/** Optional single-file MiniMax H3 Qwen3-VL text-encoder override. */
h3TextEncoderModel: ModelIdentifierConfig | null;
+ /**
- * LTX-2's Lightricks-tuned Gemma-4 text encoder. Required, not an override:
- * no LTX-2 main carries text-encoder weights, so a generation cannot run
- * without one selected.
++ * LTX-2's Gemma-4 text encoder. Required, not an override: no LTX-2 main carries text-encoder weights.
+ */
+ ltx2TextEncoderModel: ModelIdentifierConfig | null;
/**
- * MiniMax H3 hybrid: with a Ref2VA transformer selected, an FL2VA checkpoint
- * that supplies every weight except the AdaLN modulation projections from
- * `h3HybridStartBlock` onward, which stay Ref2VA's — FL2VA's output quality
- * with the references still routed. The loader loads this base; the
- * selected Ref2VA main rides the overlay node.
+ * Hybrid loads FL2VA base weights and overlays selected Ref2VA AdaLN from h3HybridStartBlock onward while
+ * retaining reference conditioning.
*/
h3HybridBaseModel: MainModelConfig | null;
/** First transformer block (0-49) whose AdaLN projection stays Ref2VA's under the hybrid. */
diff --cc invokeai/frontend/webv2/src/features/video/core/videoPolicies.ts
index e56e40e3b7,3e29ea2cbb..2fc5b99819
--- a/invokeai/frontend/webv2/src/features/video/core/videoPolicies.ts
+++ b/invokeai/frontend/webv2/src/features/video/core/videoPolicies.ts
@@@ -46,9 -66,13 +66,9 @@@ import
VIDEO_ASPECT_RATIO_IDS,
} from './settings';
-// Video capabilities registry keyed by model base AND variant: unlike still-image
-// generation, Wan's variants differ structurally (which conditioning modes exist,
-// the pixel grid, whether a second expert/CFG applies), so base alone is not
-// enough. Display identity stays in @features/models; graph topology will stay
-// explicit in graph.ts.
+// Wan variants differ in conditioning, pixel grid, and experts; key capabilities by base and variant.
- export type SupportedVideoBase = 'wan' | 'minimax-h3';
+ export type SupportedVideoBase = 'wan' | 'minimax-h3' | 'ltx-2';
export type VideoNegativePromptUsage = 'always' | 'cfg-gated' | 'never';
@@@ -231,7 -412,11 +388,10 @@@ export const VIDEO_GENERATION: Record
SupportedVideoBase,
{ variants: Record<string, VideoVariantConfig>; fallback: VideoVariantConfig }
> = {
- // ref2va is REGISTERED, never the fallback: an unknown future variant may fall back to
- // fl2va's config, but a known ref2va transformer must not silently get fl2va's modes.
- // Dev is the fallback: an unrecognised variant gets the guided schedule, which
- // is merely slow on a distilled checkpoint, where the reverse produces noise.
+ // Register Ref2VA explicitly so it never inherits FL2VA fallback modes.
++ // Dev is the fallback: an unrecognised variant gets the guided schedule, which is merely slow on a distilled
++ // checkpoint, where the reverse produces noise.
+ 'ltx-2': { fallback: LTX2_DEV, variants: { ltx2_dev: LTX2_DEV, ltx2_distilled: LTX2_DISTILLED } },
'minimax-h3': { fallback: MINIMAX_H3_FL2VA, variants: { fl2va: MINIMAX_H3_FL2VA, ref2va: MINIMAX_H3_REF2VA } },
wan: { fallback: WAN_FALLBACK_VARIANT, variants: WAN_VARIANTS },
};
@@@ -247,21 -436,37 +407,24 @@@ export const isSupportedVideoModel = <
): model is T & MainModelConfig =>
model.type === 'main' &&
(model.base === 'wan' ||
- (model.base === 'minimax-h3' && (model.format === 'diffusers' || model.format === 'checkpoint')));
+ ((model.base === 'minimax-h3' || model.base === 'ltx-2') &&
+ (model.format === 'diffusers' || model.format === 'checkpoint')));
/**
- * What the top model selector offers — like the image Generate panel, the top
- * pick is what decides the panel's UI, so it lists the identity-bearing models:
- * H3 single-file transformers (either task variant) and full Diffusers
- * installs. Excluded, though still "supported" for stored/recalled state:
- * a components-only folder (no transformer weights — it belongs in the Model
- * Components slot) and a Ref2VA Diffusers folder (its `transformer_ref`
- * weights are not folder-loadable; the single-file checkpoint is the runnable
- * form, with the folder serving as the component source).
+ * Select runnable identity-bearing models. Components-only and Ref2VA Diffusers folders remain supported for
+ * stored state but serve only as component sources, not selectable mains.
*/
export const isVideoModelSelectable = <T extends ModelConfig>(model: T): boolean =>
isSupportedVideoModel(model) &&
- !isComponentsOnlyH3Main(model) &&
+ !isComponentsOnlyVideoMain(model) &&
!(model.base === 'minimax-h3' && model.format === 'diffusers' && model.variant === 'ref2va');
-/**
- * A slim MiniMax H3 folder install: tokenizer/processor/VAEs only, no
- * transformer or text-encoder weights. The backend probe records
- * `components_only` on the config precisely so the UI can require the
- * single-file overrides up front instead of failing mid-generation.
- */
+/** components_only folders contain tokenizer/processor/VAEs but require transformer and text-encoder overrides. */
- export const isComponentsOnlyH3Main = (model: MainModelConfig): boolean =>
+ export const isComponentsOnlyVideoMain = (model: MainModelConfig): boolean =>
- // Demand the full config, not a Pick: a narrowed object would type-check
- // here but silently read `components_only` as absent — a false negative
- // that re-opens the fail-mid-generation hole this helper exists to close.
+ // Require full configs so narrowing cannot silently omit components_only.
- model.base === 'minimax-h3' && model.format === 'diffusers' && model.components_only === true;
+ (model.base === 'minimax-h3' || model.base === 'ltx-2') &&
+ model.format === 'diffusers' &&
+ model.components_only === true;
const getVideoVariantConfig = (
model: Pick<MainModelConfig, 'base' | 'type' | 'variant' | 'format'> | undefined
@@@ -374,12 -622,61 +574,59 @@@ export const getVideoDimensions =
return dimensions ? { ...dimensions, source: inputs.source } : null;
};
+ /**
+ * The frame count and frame rate a run will actually use. A conditioning clip decides both for
+ * the modality it holds clean: its picture is as long as it is, and its soundtrack covers as many
+ * frames as the chosen rate spans. The panel's own stored values are left untouched underneath, so
+ * clearing the clip restores what the user had set.
+ *
+ * Only ever the clip's when the model supports the mode -- a clip left behind by a model switch is
+ * stale state the panel offers to clear, not a timing source.
+ */
+ export interface EffectiveVideoTiming {
+ numFrames: number;
+ fps: number;
+ /** True when the conditioning clip decided the value, i.e. the control is showing a derived number. */
+ numFramesFromClip: boolean;
+ fpsFromClip: boolean;
+ }
+
+ export const getEffectiveVideoTiming = (
+ model: MainModelConfig | undefined,
+ settings: Pick<
+ VideoSettings,
+ 'conditioningClip' | 'firstFrameImage' | 'fps' | 'lastFrameImage' | 'numFrames' | 'references' | 'sourceVideo'
+ >
+ ): EffectiveVideoTiming => {
+ const conditioning = settings.conditioningClip;
+
+ if (!conditioning || !getVideoConfig(model).modes.includes(resolveVideoMode(settings))) {
+ return { fps: settings.fps, fpsFromClip: false, numFrames: settings.numFrames, numFramesFromClip: false };
+ }
+
+ // The picture is the given one, so its own rate is the run's -- but only when the gallery knew
+ // that rate. A generated picture is made at whatever rate the panel asks for, and only the
+ // length follows from the soundtrack.
+ const fpsFromClip = conditioning.role === 'video' && conditioning.fpsKnown;
+ const fps = fpsFromClip ? conditioning.clip.fps : settings.fps;
+
+ return {
+ fps,
+ fpsFromClip,
+ numFrames: ltx2FramesForClip(conditioning, fps),
+ numFramesFromClip: true,
+ };
+ };
+
export const getVideoPromptPolicy = (
model: MainModelConfig | undefined,
- settings: Pick<VideoSettings, 'cfgScale' | 'cfgScaleLowNoise' | 'negativePromptEnabled' | 'wanLowNoiseModel'>
+ settings: Pick<
+ VideoSettings,
+ 'audioCfgScale' | 'cfgScale' | 'cfgScaleLowNoise' | 'negativePromptEnabled' | 'wanLowNoiseModel'
+ >
) => {
const config = getVideoConfig(model);
- // Mirrors wan_video_denoise's do_cfg: negative conditioning is also consumed
- // when the LOW-noise half runs CFG (> 1) — which needs a second expert, i.e.
- // a Diffusers dual-expert main or a wired low-noise transformer.
+ // Match wan_video_denoise.do_cfg: a second expert using CFG > 1 also consumes negative conditioning.
const lowNoiseCfgActive =
config.cfg.lowNoiseVisible &&
(model?.format === 'diffusers' || settings.wanLowNoiseModel !== null) &&
@@@ -450,7 -764,12 +712,8 @@@ export const getVideoModelPolicy = (mod
targetResolutions: config.targetResolutions,
ui: {
accelerator: config.accelerator,
+ audioCfgVisible: config.guidance.audioVisible,
- // The step count the help text quotes is the one the *running*
- // accelerator LoRA was distilled for — with the 8-step LightX2V Turbo
- // LoRA on, "6 steps" would be a lie. It is deliberately NOT folded into
- // `accelerator`: that stays the family config, so callers can keep using
- // it as the reference other counts are resolved against.
+ // Show the active LoRA's schedule while retaining accelerator as the family reference config.
acceleratorSteps: config.accelerator
? getAcceleratorSteps(config.accelerator, getRecordedAcceleratorLoras(settings))
: null,
@@@ -989,12 -1402,58 +1257,46 @@@ export const getVideoComponentSectionPo
return createComponentPolicy(model.format !== 'diffusers', slots);
}
- // LTX-2 is distributed as separate files, so a generation is assembled from up
- // to three records: the transformer (the top selection), the component folder
- // that supplies the VAEs, vocoder and text connectors, and the Gemma-4 encoder
- // — which no LTX-2 main carries, making its slot required rather than an
- // override.
++ // LTX-2 ships as separate files: the transformer, a component folder (VAEs, vocoder, connectors), and the
++ // Gemma-4 encoder that no LTX-2 main carries, so its slot is required rather than an override.
+ if (model.base === 'ltx-2') {
+ const needsComponentSource = model.format !== 'diffusers' || isComponentsOnlyVideoMain(model);
+
+ return createComponentPolicy(needsComponentSource, [
+ ...(needsComponentSource
+ ? [
+ {
+ filter: (candidate: ModelConfig, ctx: VideoComponentPolicyContext) =>
+ isDiffusersMainForBase('ltx-2')(candidate) && candidate.key !== ctx.model.key,
+ helpTextKey: 'widgets.video.componentSlots.ltx2ComponentSourceHelp',
+ key: 'componentSourceModel',
+ label: 'Model components',
+ missingMessage: `${model.name} is a single-file transformer — select an LTX-2 components install under Model Components.`,
+ modelTypes: ['main'],
+ required: () => true,
+ valueKind: 'main',
+ } satisfies VideoComponentSlotPolicy,
+ ]
+ : []),
+ {
+ filter: (candidate) => candidate.type === 'gemma4_encoder' && candidate.base === 'ltx-2',
+ helpTextKey: 'widgets.video.componentSlots.ltx2TextEncoderHelp',
+ key: 'ltx2TextEncoderModel',
+ label: 'Gemma-4 encoder',
+ missingMessage: 'LTX-2 needs its Gemma-4 text encoder — no LTX-2 model carries one.',
+ modelTypes: ['gemma4_encoder'],
+ required: () => true,
+ valueKind: 'component',
+ },
+ ]);
+ }
+
- // MiniMax H3. The top model selection carries the task identity (its variant
- // decides the panel's generation mode); this section supplies what that
- // selection does not bundle:
- // - a single-file transformer checkpoint at top REQUIRES a Diffusers H3
- // install in the Model Components slot (tokenizer/processor/VAEs come from
- // it — full and components-only installs both qualify), plus the
- // single-file Qwen3-VL encoder when that install is components-only;
- // - a full Diffusers install at top bundles everything, so only the optional
- // text-encoder override is offered.
+ // H3 checkpoint mains require a Diffusers component source; components-only sources also require a Qwen3-VL
+ // override. Full Diffusers mains bundle both.
if (model.format === 'diffusers') {
- // A components-only install can still sit at top as legacy stored state
- // (it is no longer selectable); validation steers the user to pick a
- // single-file transformer as the model, and the encoder slot stays
- // required so the panel keeps showing what the install cannot provide.
+ // Legacy components-only mains remain visible; require the missing encoder while validation requests a
+ // single-file transformer main.
- const componentsOnly = isComponentsOnlyH3Main(model);
+ const componentsOnly = isComponentsOnlyVideoMain(model);
return createComponentPolicy(componentsOnly, [
{
@@@ -1176,8 -1662,17 +1490,15 @@@ export const getDefaultVideoSettings =
batchCount: 1,
cfgScale: config.defaults.cfgScale,
cfgScaleLowNoise: config.defaults.cfgScaleLowNoise,
+ conditioningClip: null,
- // A single-file H3 main cannot run without a Diffusers install in the
- // Model Components slot, so defaults (and reset, which reuses them) seed
- // one from the catalog instead of starting un-invokable.
+ audioCfgScale: config.defaults.audioCfgScale,
++ // Seed a component source from the catalog so a single-file main starts invokable; reset reuses defaults.
componentSourceModel:
- model && model.base === 'minimax-h3' && model.format === 'checkpoint' ? findH3ComponentSource(models) : null,
+ model && model.base === 'minimax-h3' && model.format === 'checkpoint'
+ ? findH3ComponentSource(models)
+ : model && model.base === 'ltx-2' && model.format !== 'diffusers'
+ ? findLtx2ComponentSource(models)
+ : null,
firstFrameImage: null,
fps: config.fps.defaultValue,
h3HybridBaseModel: null,
@@@ -1229,7 -1730,10 +1554,8 @@@ export const getVideoSettingsWithModelD
...settings,
acceleratorEnabled: modelDefaults.acceleratorEnabled,
acceleratorLoraKeys: modelDefaults.acceleratorLoraKeys,
- // The default-bearing layout/component choices reset too: a mispicked
- // VAE or expert is exactly what a user reaches for reset to undo.
aspectRatioId: modelDefaults.aspectRatioId,
+ audioCfgScale: modelDefaults.audioCfgScale,
cfgScale: modelDefaults.cfgScale,
cfgScaleLowNoise: modelDefaults.cfgScaleLowNoise,
componentSourceModel: modelDefaults.componentSourceModel,
@@@ -1244,11 -1748,17 +1570,14 @@@
),
...modelDefaults.loras,
].map((lora) => (isLoraCompatibleWithModel(lora.model, model) ? lora : { ...lora, isEnabled: false })),
+ ltx2TextEncoderModel: modelDefaults.ltx2TextEncoderModel,
+ modalityScale: modelDefaults.modalityScale,
modelKey: model.key,
numFrames: modelDefaults.numFrames,
- // A reset clears the references list along with the components: on an
- // FL2VA model the orphaned list would otherwise linger for the widget
- // sync to sweep away silently. (Frame/source conditioning media stay
- // untouched: they remain valid under the FL2VA policy.)
+ // Reset references with components while preserving valid frame/source conditioning.
references: modelDefaults.references,
steps: modelDefaults.steps,
+ stgScale: modelDefaults.stgScale,
targetResolution: modelDefaults.targetResolution,
vae: modelDefaults.vae,
wanLowNoiseModel: modelDefaults.wanLowNoiseModel,
@@@ -1300,8 -1816,18 +1629,14 @@@ export const getVideoModelSelectionResu
addClearedLabel(clearedLabels, 'Initial video');
}
+ if (next.conditioningClip && !modes.includes(resolveVideoMode(next))) {
- // Left behind, this is the one slot that still drives the canvas on a family that cannot run
- // it -- and it disables the aspect-ratio control while doing so, so the panel could not be
- // corrected from the panel.
++ // Left behind, this slot would keep driving the canvas and disable the aspect-ratio control.
+ next.conditioningClip = null;
+ addClearedLabel(clearedLabels, 'Conditioning clip');
+ }
+
- // The frame count is snapped BEFORE the tail reference is derived: the window
- // is budgeted against it, and deriving first left a Wan panel's count (as low
- // as 5) sizing a window for a 90-frame H3 generation — under the 13 frames
- // text conditioning needs, so Generate failed outright.
+ // Snap frame count before deriving reference context so cross-family switches cannot retain an undersized Wan
+ // budget.
const snappedFrames = snapVideoNumFrames(model, next.numFrames);
const framesChanged = snappedFrames !== next.numFrames;
@@@ -1414,7 -2055,11 +1849,8 @@@
return { clearedLabels, settings: next };
};
-// ---------------------------------------------------------------------------
-// Validation
-
const VIDEO_MODE_DESCRIPTIONS: Record<VideoGenerationMode, string> = {
+ 'audio-to-video': 'generating video for an existing soundtrack',
extend: 'extending a video',
'first-frame': 'starting from a first frame',
'first-last': 'first-to-last-frame interpolation',
@@@ -1459,10 -2105,13 +1896,12 @@@ export const getVideoValidationReasons
return ['Video needs a supported video model before it can be invoked.'];
}
- // Give repair guidance for stored supported-but-unselectable H3 configurations.
- if (isComponentsOnlyH3Main(model)) {
- // Supported-but-not-selectable H3 shapes can reach the model slot as stored
- // or recalled state; name the actual fix instead of failing downstream.
++ // Give repair guidance for stored supported-but-unselectable configurations.
+ if (isComponentsOnlyVideoMain(model)) {
+ const family = model.base === 'ltx-2' ? 'LTX-2' : 'MiniMax H3';
+
return [
- `${model.name} is a components-only install. Select a single-file MiniMax H3 transformer as the model; this install then provides its components.`,
+ `${model.name} is a components-only install. Select a single-file ${family} transformer as the model; this install then provides its components.`,
];
}
if (model.base === 'minimax-h3' && model.format === 'diffusers' && model.variant === 'ref2va') {
@@@ -1563,10 -2265,24 +2054,24 @@@
reasons.push('CFG must be at least 1.');
}
- if (config.cfg.lowNoiseVisible && settings.cfgScaleLowNoise !== null && settings.cfgScaleLowNoise < 0) {
- reasons.push('CFG (Low Noise) must be at least 0.');
+ if (config.cfg.lowNoiseVisible && settings.cfgScaleLowNoise !== null && settings.cfgScaleLowNoise < 1) {
+ reasons.push('CFG (Low Noise) must be at least 1.');
}
+ // The floors are the denoise node's own `ge`: a value below one fails
+ // pydantic validation at enqueue, after the graph has been built.
+ const guidanceBounds = [
+ { floor: 1, label: 'Audio CFG', value: config.guidance.audioVisible ? settings.audioCfgScale : null },
+ { floor: 0, label: 'STG', value: config.guidance.stgVisible ? settings.stgScale : null },
+ { floor: 1, label: 'Modality guidance', value: config.guidance.modalityVisible ? settings.modalityScale : null },
+ ];
+
+ for (const { floor, label, value } of guidanceBounds) {
+ if (value !== null && (!Number.isFinite(value) || value < floor)) {
+ reasons.push(`${label} must be at least ${floor}.`);
+ }
+ }
+
if (settings.acceleratorEnabled && !config.accelerator) {
reasons.push(`${model.name} has no distillation fast path. Turn the accelerator off to generate with it.`);
}
diff --cc invokeai/frontend/webv2/src/features/video/ui/VideoWidgetView.tsx
index 624994086a,49234d7f30..6f359ec420
--- a/invokeai/frontend/webv2/src/features/video/ui/VideoWidgetView.tsx
+++ b/invokeai/frontend/webv2/src/features/video/ui/VideoWidgetView.tsx
@@@ -238,12 -292,32 +250,27 @@@ export const VideoWidgetView = () =>
const maxVideoReferences = policy.references?.maxVideos ?? 3;
const setFirstFrame = useCallback(
(firstFrameImage: ImageWithDims | null) =>
- patch({ firstFrameImage, ...(firstFrameImage ? { sourceVideo: null } : {}) }),
+ patch({ firstFrameImage, ...(firstFrameImage ? { conditioningClip: null, sourceVideo: null } : {}) }),
+ [patch]
+ );
+ const setLastFrame = useCallback(
+ (lastFrameImage: ImageWithDims | null) =>
+ patch({ lastFrameImage, ...(lastFrameImage ? { conditioningClip: null } : {}) }),
+ [patch]
+ );
+ // A conditioning clip claims a whole modality, so it excludes every other conditioning slot --
+ // and each of those clears it in turn. The role a dropped clip arrives in comes from the gallery
+ // record: an uploaded soundtrack has no picture to condition on.
+ const setConditioningClip = useCallback(
+ (conditioningClip: VideoConditioningClip | null) =>
+ patch({
+ conditioningClip,
+ ...(conditioningClip ? { firstFrameImage: null, lastFrameImage: null, references: [], sourceVideo: null } : {}),
+ }),
[patch]
);
- const setLastFrame = useCallback((lastFrameImage: ImageWithDims | null) => patch({ lastFrameImage }), [patch]);
- // Not part of `set`: that object is memoized on `patch` alone so the field
- // setters keep the children's `memo` intact, and this one has to track the
- // reference list. The linked tail reference's window is budgeted against the
- // generated frame count — the backend discards an ill-fitting window at its
- // SEAM end — so the count and the window move together. The re-derive is
- // idempotent: this fires once per keystroke of the Frames input, unclamped,
- // so typing "345" arrives as 3, then 34, then 345.
+ // This setter tracks references separately from patch-only field setters. Rebudget the linked tail with frame
+ // count so backend truncation cannot discard its seam end; derivation must tolerate intermediate input values.
const setNumFrames = useCallback(
(numFrames: number) =>
patch(
@@@ -367,16 -506,43 +428,32 @@@
const supportsLastFrame = policy.modes.includes('first-last') || policy.modes.includes('last-frame');
const supportsExtend = policy.modes.includes('extend');
const supportsReferences = policy.modes.includes('reference');
+ const supportsConditioningClip = policy.modes.includes('audio-to-video') || policy.modes.includes('video-to-audio');
const supportsInitialVideo = supportsExtend || referenceExtend;
- // Setting an Initial Video on a reference-extend panel has to place a linked
- // tail reference, which needs a free video slot -- unless an existing entry
- // can be adopted, which consumes none. Deferring to the same predicate the
- // setter's refusal uses keeps the two from drifting: gating on the flag alone
- // disabled the field after a recall, which restores references UNFLAGGED
- // beside the source video, and `disabled` reaches the clip's trim sliders too
- // -- so the cutpoint could not be moved on a clip that was legitimately set.
+ // Use the setter's capacity predicate: recalled unflagged references can be adopted without consuming a slot,
+ // and must not disable clip trimming.
const initialVideoCapBlocked =
referenceExtend &&
!canPlaceReferenceExtendAnchor(values.references, values.sourceVideo?.video_name, maxVideoReferences);
- const hasConditioningMedia = Boolean(values.firstFrameImage || values.lastFrameImage || values.sourceVideo);
+ // The aspect-ratio control is locked by media that pins the frame. A clip in the `audio` role
+ // does not: its picture is what gets generated, so the ratio is still the user's to choose.
+ const hasConditioningMedia = Boolean(
+ values.firstFrameImage || values.lastFrameImage || values.sourceVideo || values.conditioningClip?.role === 'video'
+ );
+ const otherMediaSet = Boolean(
+ values.firstFrameImage || values.lastFrameImage || values.sourceVideo || values.references.length > 0
+ );
+ const conditioningDerivedText = values.conditioningClip
+ ? t(
+ values.conditioningClip.role === 'audio'
+ ? 'widgets.video.conditioningDerivedAudio'
+ : 'widgets.video.conditioningDerivedVideo',
+ { fps: timing.fps, frames: timing.numFrames }
+ )
+ : undefined;
const derivedSourceText = dimensions ? t(`widgets.video.dimensionSource.${dimensions.source}`) : undefined;
- // Media pins the canvas to its own proportions, so the stored preset is not what the output will
- // be: leaving it on the trigger of a disabled control states a ratio the render will not use. The
- // preset itself is kept, not rewritten -- it is what the panel goes back to when the media is
- // removed -- and the trigger names the source instead. Deliberately not the nearest standard
- // preset: media rarely lands exactly on one, so that would swap one wrong ratio for another.
- // Truncating, like the Generate panel's own aspect-ratio trigger: the slot clips its value text
- // rather than wrapping it, so a phrase wider than the control ends mid-word in a docked panel
- // instead of in an ellipsis.
+ // Media determines output proportions. Show its ratio source while disabled, preserving the saved preset for
+ // when media is removed.
const dimensionSource = dimensions?.source;
const derivedSourceValueText = useMemo(
() =>
diff --cc invokeai/frontend/webv2/src/workbench/image-actions/videoRecall.ts
index db7947d43a,114f357c3f..4aa187bbcb
--- a/invokeai/frontend/webv2/src/workbench/image-actions/videoRecall.ts
+++ b/invokeai/frontend/webv2/src/workbench/image-actions/videoRecall.ts
@@@ -446,9 -502,12 +477,10 @@@ export const buildVideoRecallSettings
const fields: VideoRecalledField[] = [];
let values: VideoWidgetValues = { ...currentValues };
- // Held aside rather than folded into `values` where it is read: the model
- // transition below rebuilds `values` from the recalled family's defaults, and
- // recalled prompts must survive that. Merged in at each return instead.
+ // Hold prompts outside values until return so model-default transitions cannot overwrite them.
let promptPatch: Partial<VideoWidgetValues> | null = null;
const mediaNames: VideoRecallMediaNames = {
+ conditioningClip: null,
firstFrameName: null,
lastFrameName: null,
references: [],
@@@ -547,9 -617,31 +588,29 @@@
fields.push('cfg');
}
+ // The per-modality scales ride with CFG: they are the same run's guidance,
+ // and a family that does not offer a control must not be handed a number.
+ const guidanceRecall = [
+ { floor: 1, key: 'audioCfgScale', metadataKey: 'ltx2_audio_cfg_scale', visible: policy.ui.audioCfgVisible },
+ { floor: 0, key: 'stgScale', metadataKey: 'ltx2_stg_scale', visible: policy.ui.stgVisible },
+ { floor: 1, key: 'modalityScale', metadataKey: 'ltx2_modality_scale', visible: policy.ui.modalityVisible },
+ ] as const;
+
+ for (const { floor, key, metadataKey, visible } of guidanceRecall) {
+ const recalled = getNumber(metadata, metadataKey);
+
+ if (visible && recalled !== null && recalled >= floor) {
+ values = { ...values, [key]: recalled };
+
+ if (!fields.includes('cfg')) {
+ fields.push('cfg');
+ }
+ }
+ }
+
const fps = getInteger(metadata, 'fps');
- // Wan records the delivered frame rate (H3 records its fixed 24, which its
- // policy never lets the panel edit). Recalling it into an extend-mode panel is harmless: the fps field
- // is display-only there and the compiled graph re-inherits the clip's rate.
+ // Wan records delivered fps; extend compilation still inherits clip fps, and H3 fixes it at 24.
if (policy.fps.editable && fps !== null && fps >= 1 && fps <= 120) {
if (fps !== values.fps) {
values = { ...values, fps };
@@@ -663,12 -772,26 +726,24 @@@
currentValues.references.length > 0
);
- // Media selects the graph family (t2v vs i2v vs extend vs reference), so an all/remix
- // recall must reproduce the recorded media EXACTLY: whatever the panel held
- // is cleared, and the executor re-hydrates the recorded names on top.
+ // All/remix recall clears current media before restoring recorded names because media determines graph family.
if (hadMedia) {
- values = { ...values, firstFrameImage: null, lastFrameImage: null, references: [], sourceVideo: null };
+ values = {
+ ...values,
+ conditioningClip: null,
+ firstFrameImage: null,
+ lastFrameImage: null,
+ references: [],
+ sourceVideo: null,
+ };
}
- if (references.length > 0) {
+ if (conditioningClip) {
+ // First, and alone: the clip holds a whole modality clean, so no other slot could have been
+ // filled on the run being recalled.
+ mediaNames.conditioningClip = conditioningClip;
+ fields.push('media');
+ } else if (references.length > 0) {
// References replace the frame slots, but a recorded source video rides
// ALONGSIDE them: Ref2VA reference-extend appends the new clip to it.
mediaNames.references = references;