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.

fix(architectures): declare the Wan video modes upstream added

Alexander Eichhorn692ad1e60df7
diff --git a/invokeai/backend/architectures/defs/wan.py b/invokeai/backend/architectures/defs/wan.py
index 1cea381e21..0a14b36d4e 100644
--- a/invokeai/backend/architectures/defs/wan.py
+++ b/invokeai/backend/architectures/defs/wan.py
@@ -24,8 +24,12 @@ register(
None: MainModelDefaultSettings(steps=40, cfg_scale=4.0, width=1024, height=1024),
}
),
- # Plus image-to-video. Wan generates images at num_frames=1 and video above that.
- ModalityFacet(frozenset({"txt2img", "img2img", "inpaint", "outpaint", "i2v"}), metadata_slug="wan"),
+ # Wan generates images at num_frames=1 and video above that, from text or from one or two
+ # given frames -- `interpolate` fills between two, `extend_video` continues an existing clip.
+ ModalityFacet(
+ frozenset({"txt2img", "img2img", "inpaint", "outpaint", "t2v", "i2v", "interpolate", "extend_video"}),
+ metadata_slug="wan",
+ ),
FeaturesFacet(
negative_prompt=NegativePrompt(visible=True, usage="always"),
dimension_grid=16,
diff --git a/invokeai/backend/architectures/facets/modality.py b/invokeai/backend/architectures/facets/modality.py
index 28836a80f6..aedef2f601 100644
--- a/invokeai/backend/architectures/facets/modality.py
+++ b/invokeai/backend/architectures/facets/modality.py
@@ -18,12 +18,14 @@ from typing import ClassVar, Literal
from invokeai.backend.architectures.facet import Facet
from invokeai.backend.architectures.registry import generative_bases, get
-GenerationModeKind = Literal["txt2img", "img2img", "inpaint", "outpaint", "t2v", "i2v", "lf2v", "flf2v", "extend_video"]
+GenerationModeKind = Literal[
+ "txt2img", "img2img", "inpaint", "outpaint", "t2v", "i2v", "lf2v", "flf2v", "interpolate", "extend_video"
+]
"""The kinds of generation a mode string names.
-`t2v`/`i2v` produce video, as do the three MiniMax H3 conditioning variants: `lf2v` (last frame to
-video), `flf2v` (first and last frame to video) and `extend_video` (continue an existing clip). The
-rest produce images."""
+`t2v`/`i2v` produce video, as do the conditioning variants: `lf2v` (last frame to video), `flf2v`
+(first and last frame to video), `interpolate` (between two given images) and `extend_video`
+(continue an existing clip). The rest produce images."""
@dataclass(frozen=True)
diff --git a/invokeai/frontend/web/openapi.json b/invokeai/frontend/web/openapi.json
index 494a3127a3..e9dc358f0a 100644
--- a/invokeai/frontend/web/openapi.json
+++ b/invokeai/frontend/web/openapi.json
@@ -16530,7 +16530,18 @@
"modes": {
"items": {
"type": "string",
- "enum": ["txt2img", "img2img", "inpaint", "outpaint", "t2v", "i2v", "lf2v", "flf2v", "extend_video"]
+ "enum": [
+ "txt2img",
+ "img2img",
+ "inpaint",
+ "outpaint",
+ "t2v",
+ "i2v",
+ "lf2v",
+ "flf2v",
+ "interpolate",
+ "extend_video"
+ ]
},
"type": "array",
"title": "Modes",
diff --git a/invokeai/frontend/web/src/services/api/schema.ts b/invokeai/frontend/web/src/services/api/schema.ts
index 8715a27843..875b37fa74 100644
--- a/invokeai/frontend/web/src/services/api/schema.ts
+++ b/invokeai/frontend/web/src/services/api/schema.ts
@@ -4851,7 +4851,7 @@ export type components = {
* Modes
* @description Sorted. Empty means it generates nothing on its own.
*/
- modes: ("txt2img" | "img2img" | "inpaint" | "outpaint" | "t2v" | "i2v" | "lf2v" | "flf2v" | "extend_video")[];
+ modes: ("txt2img" | "img2img" | "inpaint" | "outpaint" | "t2v" | "i2v" | "lf2v" | "flf2v" | "interpolate" | "extend_video")[];
/**
* Metadata Slug
* @description Prefix its mode strings carry in image metadata; null means unprefixed.
diff --git a/invokeai/frontend/webv2/.oxfmtrc.json b/invokeai/frontend/webv2/.oxfmtrc.json
index a261d81626..d53c375361 100644
--- a/invokeai/frontend/webv2/.oxfmtrc.json
+++ b/invokeai/frontend/webv2/.oxfmtrc.json
@@ -4,7 +4,12 @@
"bracketSameLine": false,
"bracketSpacing": true,
"endOfLine": "lf",
- "ignorePatterns": ["dist/**", "node_modules/**", "stats.html"],
+ "ignorePatterns": [
+ "dist/**",
+ "node_modules/**",
+ "stats.html",
+ "src/features/generation/core/__snapshots__/generateGraphNodeTypes.json"
+ ],
"printWidth": 120,
"semi": true,
"singleQuote": true,
diff --git a/invokeai/frontend/webv2/src/features/generation/core/__snapshots__/generateGraphNodeTypes.json b/invokeai/frontend/webv2/src/features/generation/core/__snapshots__/generateGraphNodeTypes.json
index 3c1c73027c..1942f85a46 100644
--- a/invokeai/frontend/webv2/src/features/generation/core/__snapshots__/generateGraphNodeTypes.json
+++ b/invokeai/frontend/webv2/src/features/generation/core/__snapshots__/generateGraphNodeTypes.json
@@ -1,5 +1,5 @@
{
- "_comment": "Generated by src/features/generation/core/graphCoverage.test.ts. Update with `vitest -u`. Consumed by tests/app/invocations/test_frontend_graph_node_types.py, which checks every node type and field below against the backend invocation registry.",
+ "_comment": "Generated by src/features/generation/core/graphCoverage.test.ts; regenerate with `vitest -u`. Excluded from oxfmt so the test alone owns its layout. Consumed by tests/app/invocations/test_frontend_graph_node_types.py, which checks every node type and field below against the backend invocation registry.",
"byBase": {
"sd-1": {
"componentsFilled": {
diff --git a/invokeai/frontend/webv2/src/features/generation/core/graphCoverage.test.ts b/invokeai/frontend/webv2/src/features/generation/core/graphCoverage.test.ts
index a7ad5376d7..9357826fda 100644
--- a/invokeai/frontend/webv2/src/features/generation/core/graphCoverage.test.ts
+++ b/invokeai/frontend/webv2/src/features/generation/core/graphCoverage.test.ts
@@ -7,10 +7,15 @@
* the moment it is registered, and asserts the properties that hold for *all* of them: the
* component policy is satisfiable, the builder runs, and the resulting graph is structurally sound.
*
- * It also writes the node types each base emits to a file snapshot. That file is the frontend half
- * of a cross-stack contract — `tests/app/invocations/test_frontend_graph_node_types.py` reads it and
- * checks every type against the backend's `InvocationRegistry`. A node moved between modules and
- * accidentally renamed shows up there, which no frontend-only assertion can see.
+ * It also checks the node types and edge fields each base emits against a committed fixture. That
+ * fixture is the frontend half of a cross-stack contract — `tests/app/invocations/
+ * test_frontend_graph_node_types.py` reads it and checks every type and field against the backend's
+ * `InvocationRegistry`. A node moved between modules and accidentally renamed shows up there, which
+ * no frontend-only assertion can see.
+ *
+ * The snapshot file is written by this test and by nothing else — `.oxfmtrc.json` excludes it for
+ * that reason. Letting the formatter reflow a generated file too would leave both in charge of the
+ * same bytes, and `format:check` would fail on whichever layout the other one wrote last.
*/
import type { BackendGraphContract } from '@features/generation/core/contracts';
@@ -254,9 +259,10 @@ describe('generate graph coverage', () => {
const contract = {
_comment:
- 'Generated by src/features/generation/core/graphCoverage.test.ts. Update with `vitest -u`. ' +
- 'Consumed by tests/app/invocations/test_frontend_graph_node_types.py, which checks every ' +
- 'node type and field below against the backend invocation registry.',
+ 'Generated by src/features/generation/core/graphCoverage.test.ts; regenerate with ' +
+ '`vitest -u`. Excluded from oxfmt so the test alone owns its layout. Consumed by ' +
+ 'tests/app/invocations/test_frontend_graph_node_types.py, which checks every node type and ' +
+ 'field below against the backend invocation registry.',
byBase,
fieldsByNodeType: Object.fromEntries(
Object.entries(fields)