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.

feat(video): add lower-resolution MiniMax H3 draft presets (#10259)

rnshineb9023d3d4fa4
diff --git a/docs/src/content/docs/Users Guide/05.Video Generation/introduction.mdx b/docs/src/content/docs/Users Guide/05.Video Generation/introduction.mdx
index 9327ebb4b8..4045ee5003 100644
--- a/docs/src/content/docs/Users Guide/05.Video Generation/introduction.mdx
+++ b/docs/src/content/docs/Users Guide/05.Video Generation/introduction.mdx
@@ -113,7 +113,7 @@ for more details.
* **Aspect Ratio** presets (21:9 through 9:21) drive text-to-video output. As soon as conditioning media is set, **its aspect ratio takes over** and the preset locks — the readout names the source ("from the first frame").
* **Target Resolution** picks the size tier within that ratio:
* Wan — **480p** and **720p** (native), **1080p** (extrapolated beyond the training distribution; expect softer results).
- * MiniMax H3 — **768 highres** (native: short edge 768) and **768 lowres** (fast preview: long edge 768).
+ * MiniMax H3 — **768 highres** (native: short edge 768) and **768 lowres** (fast preview: long edge 768), plus **480p** and **544p** draft presets (target short edge, under the native area cap).
* LTX-2 — **512p**, **704p** (default) and **768p** in one pass; **1024p** and **1536p** are [two-stage](/users-guide/video-generation/ltx-2/#two-stage-presets), and much slower.
The panel derives exact pixel dimensions automatically, snapped to each model's grid — you never do the multiple-of-16/32 math yourself.
* **Frames** sets clip length:
diff --git a/docs/src/content/docs/Users Guide/05.Video Generation/minimax-h3.mdx b/docs/src/content/docs/Users Guide/05.Video Generation/minimax-h3.mdx
index 883688a1bf..49b931c90b 100644
--- a/docs/src/content/docs/Users Guide/05.Video Generation/minimax-h3.mdx
+++ b/docs/src/content/docs/Users Guide/05.Video Generation/minimax-h3.mdx
@@ -32,9 +32,13 @@ What makes it different from Wan in practice:
* **Fixed 24 fps** and a fixed frame grid: 90–345 frames
in steps of 17 (about 3.8 to 14.4 seconds), default 124.
-* **Two fixed resolutions** "768 highres" pins the short edge to 768
+* **Resolution presets** "768 highres" pins the short edge to 768
(native quality); "768 lowres" pins the *long* edge to 768 for fast
- previews.
+ previews. **480p** and **544p** target a shorter edge for drafts; at 16:9
+ they produce 864×480 and 960×544. All presets keep the 32-pixel grid and
+ native area cap, so extreme aspect ratios may reduce the target short edge.
+ Drafts run below the training resolution and may lose detail; speed and
+ memory use depend on the model, hardware, and conditioning.
* **Aspect ratios** from 1:4 to 4:1 are supported, wider than the
preset list.
diff --git a/invokeai/app/invocations/minimax_h3/minimax_h3_ideal_dimensions.py b/invokeai/app/invocations/minimax_h3/minimax_h3_ideal_dimensions.py
index c543397a71..3e5963be34 100644
--- a/invokeai/app/invocations/minimax_h3/minimax_h3_ideal_dimensions.py
+++ b/invokeai/app/invocations/minimax_h3/minimax_h3_ideal_dimensions.py
@@ -8,7 +8,8 @@ the released pipeline's canvas resolution). This node wraps it for workflow grap
image-to-video workflows can derive the canvas from the uploaded keyframe instead of
asking the user to type matching width/height values, and adds a reduced "768 lowres"
preset (:func:`~invokeai.backend.minimax_h3.presets.resolve_lowres_canvas_size`) that
-pins the LONG edge to 768 for cheaper preview/test renders.
+pins the LONG edge to 768 for cheaper preview/test renders. Draft presets target
+480 or 544 px short edges under the same native area cap.
"""
from typing import Literal
@@ -18,11 +19,13 @@ from invokeai.app.invocations.fields import InputField
from invokeai.app.invocations.ideal_size import IdealSizeOutput
from invokeai.app.services.shared.invocation_context import InvocationContext
from invokeai.backend.minimax_h3.packing import resolve_canvas_size
-from invokeai.backend.minimax_h3.presets import resolve_lowres_canvas_size
+from invokeai.backend.minimax_h3.presets import resolve_lowres_canvas_size, resolve_reduced_canvas_size
-MiniMaxH3TargetResolution = Literal["768 highres", "768 lowres"]
+MiniMaxH3TargetResolution = Literal["768 highres", "768 lowres", "480p", "544p"]
MINIMAX_H3_TARGET_RESOLUTION_LABELS: dict[str, str] = {
+ "480p": "480p draft (target short edge 480)",
+ "544p": "544p draft (target short edge 544)",
"768 highres": "768 highres (native: short edge 768, cap 768x1344)",
"768 lowres": "768 lowres (long edge 768 — smaller, faster)",
}
@@ -33,7 +36,7 @@ MINIMAX_H3_TARGET_RESOLUTION_LABELS: dict[str, str] = {
title="MiniMax H3 Ideal Dimensions",
tags=["minimax", "video", "dimensions", "math"],
category="video",
- version="1.1.0",
+ version="1.2.0",
classification=Classification.Prototype,
)
class MiniMaxH3IdealDimensionsInvocation(BaseInvocation):
@@ -43,7 +46,8 @@ class MiniMaxH3IdealDimensionsInvocation(BaseInvocation):
area cap of 768x1344. "768 lowres" pins the LONG edge to 768 instead, giving a
canvas with roughly half the pixels for non-square ratios (e.g. a 2:3 source becomes
512x768 instead of 768x1152) — faster and cheaper, at some cost in fidelity since it
- is below the model's training resolution. Both presets round each axis to the
+ is below the model's training resolution. "480p" and "544p" target shorter edges
+ under the native area cap (16:9 gives 864x480 and 960x544). All presets round each axis to the
nearest multiple of 32. Only the aspect ratio of the inputs matters. Aspect ratios
beyond 1:4 / 4:1 are rejected. Wire from ``Image Primitive``'s width/height outputs
and into the width/height of ``Prompt - MiniMax H3``, ``Frame Conditioning - MiniMax
@@ -65,13 +69,17 @@ class MiniMaxH3IdealDimensionsInvocation(BaseInvocation):
description=(
"Canvas preset. '768 highres' is H3's native policy (short edge 768, soft cap "
"768x1344). '768 lowres' pins the long edge to 768 for smaller, faster test "
- "renders (e.g. 512x768 from a 2:3 source) at some cost in fidelity."
+ "renders (e.g. 512x768 from a 2:3 source) at some cost in fidelity. "
+ "480p and 544p target a shorter edge under the same area cap for draft renders."
),
ui_choice_labels=MINIMAX_H3_TARGET_RESOLUTION_LABELS,
)
def invoke(self, context: InvocationContext) -> IdealSizeOutput:
- resolver = resolve_lowres_canvas_size if self.target_resolution == "768 lowres" else resolve_canvas_size
- # Both resolvers return (height, width).
- h, w = resolver(float(self.width), float(self.height))
+ if self.target_resolution in ("480p", "544p"):
+ short_edge = 480 if self.target_resolution == "480p" else 544
+ h, w = resolve_reduced_canvas_size(float(self.width), float(self.height), short_edge)
+ else:
+ resolver = resolve_lowres_canvas_size if self.target_resolution == "768 lowres" else resolve_canvas_size
+ h, w = resolver(float(self.width), float(self.height))
return IdealSizeOutput(width=w, height=h)
diff --git a/invokeai/app/services/workflow_records/default_workflows/Extend Video - MiniMax H3.json b/invokeai/app/services/workflow_records/default_workflows/Extend Video - MiniMax H3.json
index 081492ccc1..160c8f6e70 100644
--- a/invokeai/app/services/workflow_records/default_workflows/Extend Video - MiniMax H3.json
+++ b/invokeai/app/services/workflow_records/default_workflows/Extend Video - MiniMax H3.json
@@ -502,7 +502,7 @@
"type": "invocation",
"data": {
"id": "9e8d7c6b-5a4f-4e3d-9c2b-1a0f9e8d7c6b",
- "version": "1.1.0",
+ "version": "1.2.0",
"nodePack": "invokeai",
"label": "",
"notes": "Derives the H3 canvas from the source video's aspect ratio.",
diff --git a/invokeai/app/services/workflow_records/default_workflows/First Frame to Video - MiniMax H3.json b/invokeai/app/services/workflow_records/default_workflows/First Frame to Video - MiniMax H3.json
index 94ee4b997d..1b03fd6f2e 100644
--- a/invokeai/app/services/workflow_records/default_workflows/First Frame to Video - MiniMax H3.json
+++ b/invokeai/app/services/workflow_records/default_workflows/First Frame to Video - MiniMax H3.json
@@ -410,7 +410,7 @@
"type": "invocation",
"data": {
"id": "9e8d7c6b-5a4f-4e3d-9c2b-1a0f9e8d7c6b",
- "version": "1.1.0",
+ "version": "1.2.0",
"nodePack": "invokeai",
"label": "",
"notes": "Derives an H3 canvas from the keyframe's aspect ratio, and feeds it to the prompt, frame conditioning and denoise nodes together -- they are required to agree.",
diff --git a/invokeai/app/services/workflow_records/default_workflows/First and Last Frame to Video - MiniMax H3.json b/invokeai/app/services/workflow_records/default_workflows/First and Last Frame to Video - MiniMax H3.json
index 5bbcf7bb6b..93efdb2f38 100644
--- a/invokeai/app/services/workflow_records/default_workflows/First and Last Frame to Video - MiniMax H3.json
+++ b/invokeai/app/services/workflow_records/default_workflows/First and Last Frame to Video - MiniMax H3.json
@@ -414,7 +414,7 @@
"type": "invocation",
"data": {
"id": "9e8d7c6b-5a4f-4e3d-9c2b-1a0f9e8d7c6b",
- "version": "1.1.0",
+ "version": "1.2.0",
"nodePack": "invokeai",
"label": "",
"notes": "Derives an H3 canvas from the keyframe's aspect ratio, and feeds it to the prompt, frame conditioning and denoise nodes together -- they are required to agree.",
diff --git a/invokeai/app/services/workflow_records/default_workflows/Last Frame to Video - MiniMax H3.json b/invokeai/app/services/workflow_records/default_workflows/Last Frame to Video - MiniMax H3.json
index 7526f93d04..eed129b47c 100644
--- a/invokeai/app/services/workflow_records/default_workflows/Last Frame to Video - MiniMax H3.json
+++ b/invokeai/app/services/workflow_records/default_workflows/Last Frame to Video - MiniMax H3.json
@@ -410,7 +410,7 @@
"type": "invocation",
"data": {
"id": "9e8d7c6b-5a4f-4e3d-9c2b-1a0f9e8d7c6b",
- "version": "1.1.0",
+ "version": "1.2.0",
"nodePack": "invokeai",
"label": "",
"notes": "Derives an H3 canvas from the keyframe's aspect ratio, and feeds it to the prompt, frame conditioning and denoise nodes together -- they are required to agree.",
diff --git a/invokeai/app/services/workflow_records/default_workflows/Reference to Video - MiniMax H3.json b/invokeai/app/services/workflow_records/default_workflows/Reference to Video - MiniMax H3.json
index 7905978e4f..2419e5d01c 100644
--- a/invokeai/app/services/workflow_records/default_workflows/Reference to Video - MiniMax H3.json
+++ b/invokeai/app/services/workflow_records/default_workflows/Reference to Video - MiniMax H3.json
@@ -427,7 +427,7 @@
"type": "invocation",
"data": {
"id": "9e8d7c6b-5a4f-4e3d-9c2b-1a0f9e8d7c6b",
- "version": "1.1.0",
+ "version": "1.2.0",
"nodePack": "invokeai",
"label": "",
"notes": "Type the aspect ratio you want as width/height; the node snaps it onto a canvas H3 can render. '768 lowres' pins the long edge to 768 for fast renders -- switch to '768 highres' for the model's native canvas.",
diff --git a/invokeai/app/services/workflow_records/default_workflows/Text to Video - MiniMax H3.json b/invokeai/app/services/workflow_records/default_workflows/Text to Video - MiniMax H3.json
index 19ab7bec7a..55be944528 100644
--- a/invokeai/app/services/workflow_records/default_workflows/Text to Video - MiniMax H3.json
+++ b/invokeai/app/services/workflow_records/default_workflows/Text to Video - MiniMax H3.json
@@ -381,7 +381,7 @@
"type": "invocation",
"data": {
"id": "9e8d7c6b-5a4f-4e3d-9c2b-1a0f9e8d7c6b",
- "version": "1.1.0",
+ "version": "1.2.0",
"nodePack": "invokeai",
"label": "",
"notes": "Type the aspect ratio you want as width/height; the node snaps it onto a canvas H3 can render. '768 lowres' pins the long edge to 768 for fast renders -- switch to '768 highres' for the model's native canvas.",
diff --git a/invokeai/backend/minimax_h3/presets.py b/invokeai/backend/minimax_h3/presets.py
index e2d11fbb8a..c4c6d15734 100644
--- a/invokeai/backend/minimax_h3/presets.py
+++ b/invokeai/backend/minimax_h3/presets.py
@@ -14,6 +14,8 @@ Two additions:
- :func:`resolve_lowres_canvas_size`, a reduced-size canvas family for fast preview renders.
"""
+from typing import Literal
+
from invokeai.backend.minimax_h3.packing import (
MINIMAX_H3_CANVAS_MULTIPLE,
MINIMAX_H3_FPS,
@@ -21,6 +23,7 @@ from invokeai.backend.minimax_h3.packing import (
MINIMAX_H3_LATENTS_PER_CHUNK,
MINIMAX_H3_MAX_ASPECT_RATIO,
MINIMAX_H3_MAX_DURATION,
+ MINIMAX_H3_MAX_PIXELS,
MINIMAX_H3_MIN_ASPECT_RATIO,
MINIMAX_H3_SHORT_EDGE,
)
@@ -76,3 +79,31 @@ def resolve_lowres_canvas_size(aspect_width: float, aspect_height: float) -> tup
multiple = MINIMAX_H3_CANVAS_MULTIPLE
return max(multiple, round(height / multiple) * multiple), max(multiple, round(width / multiple) * multiple)
+
+
+def resolve_reduced_canvas_size(
+ aspect_width: float, aspect_height: float, short_edge: Literal[480, 544]
+) -> tuple[int, int]:
+ """Resolve a draft canvas on the 32-pixel grid, retaining H3's native aspect and area bounds.
+
+ The short edge is a target, not a guarantee: extreme ratios are scaled down to the
+ native area cap before rounding. These are below-training-resolution preview presets.
+ Returns (height, width), like the native and legacy lowres resolvers.
+ """
+ if short_edge not in (480, 544):
+ raise ValueError("MiniMax-H3 draft short edge must be 480 or 544 pixels.")
+ if aspect_width <= 0 or aspect_height <= 0:
+ raise ValueError(f"The aspect ratio must be positive, got {aspect_width}:{aspect_height}.")
+ ratio = aspect_width / aspect_height
+ if not MINIMAX_H3_MIN_ASPECT_RATIO <= ratio <= MINIMAX_H3_MAX_ASPECT_RATIO:
+ raise ValueError(f"MiniMax-H3 supports aspect ratios from 1:4 to 4:1, got {aspect_width}:{aspect_height}.")
+ # Match the frontend/native operation order at half-grid rounding boundaries.
+ if ratio >= 1.0:
+ width, height = short_edge * ratio, float(short_edge)
+ else:
+ width, height = float(short_edge), short_edge / ratio
+ if width * height > MINIMAX_H3_MAX_PIXELS:
+ scale = (MINIMAX_H3_MAX_PIXELS / (width * height)) ** 0.5
+ width, height = width * scale, height * scale
+ multiple = MINIMAX_H3_CANVAS_MULTIPLE
+ return max(multiple, round(height / multiple) * multiple), max(multiple, round(width / multiple) * multiple)
diff --git a/invokeai/frontend/api/openapi.json b/invokeai/frontend/api/openapi.json
index 60fb886125..b00dddf91e 100644
--- a/invokeai/frontend/api/openapi.json
+++ b/invokeai/frontend/api/openapi.json
@@ -94390,7 +94390,7 @@
"category": "video",
"class": "invocation",
"classification": "prototype",
- "description": "Ideal dimensions for MiniMax H3 from a source image's aspect ratio.\n\n\"768 highres\" applies the released pipeline's canvas policy: short edge 768, soft\narea cap of 768x1344. \"768 lowres\" pins the LONG edge to 768 instead, giving a\ncanvas with roughly half the pixels for non-square ratios (e.g. a 2:3 source becomes\n512x768 instead of 768x1152) \u2014 faster and cheaper, at some cost in fidelity since it\nis below the model's training resolution. Both presets round each axis to the\nnearest multiple of 32. Only the aspect ratio of the inputs matters. Aspect ratios\nbeyond 1:4 / 4:1 are rejected. Wire from ``Image Primitive``'s width/height outputs\nand into the width/height of ``Prompt - MiniMax H3``, ``Frame Conditioning - MiniMax\nH3`` and ``Denoise - MiniMax H3`` (all three must share the same canvas).",
+ "description": "Ideal dimensions for MiniMax H3 from a source image's aspect ratio.\n\n\"768 highres\" applies the released pipeline's canvas policy: short edge 768, soft\narea cap of 768x1344. \"768 lowres\" pins the LONG edge to 768 instead, giving a\ncanvas with roughly half the pixels for non-square ratios (e.g. a 2:3 source becomes\n512x768 instead of 768x1152) \u2014 faster and cheaper, at some cost in fidelity since it\nis below the model's training resolution. \"480p\" and \"544p\" target shorter edges\nunder the native area cap (16:9 gives 864x480 and 960x544). All presets round each axis to the\nnearest multiple of 32. Only the aspect ratio of the inputs matters. Aspect ratios\nbeyond 1:4 / 4:1 are rejected. Wire from ``Image Primitive``'s width/height outputs\nand into the width/height of ``Prompt - MiniMax H3``, ``Frame Conditioning - MiniMax\nH3`` and ``Denoise - MiniMax H3`` (all three must share the same canvas).",
"node_pack": "invokeai",
"properties": {
"id": {
@@ -94441,8 +94441,8 @@
},
"target_resolution": {
"default": "768 highres",
- "description": "Canvas preset. '768 highres' is H3's native policy (short edge 768, soft cap 768x1344). '768 lowres' pins the long edge to 768 for smaller, faster test renders (e.g. 512x768 from a 2:3 source) at some cost in fidelity.",
- "enum": ["768 highres", "768 lowres"],
+ "description": "Canvas preset. '768 highres' is H3's native policy (short edge 768, soft cap 768x1344). '768 lowres' pins the long edge to 768 for smaller, faster test renders (e.g. 512x768 from a 2:3 source) at some cost in fidelity. 480p and 544p target a shorter edge under the same area cap for draft renders.",
+ "enum": ["768 highres", "768 lowres", "480p", "544p"],
"field_kind": "input",
"input": "any",
"orig_default": "768 highres",
@@ -94450,6 +94450,8 @@
"title": "Target Resolution",
"type": "string",
"ui_choice_labels": {
+ "480p": "480p draft (target short edge 480)",
+ "544p": "544p draft (target short edge 544)",
"768 highres": "768 highres (native: short edge 768, cap 768x1344)",
"768 lowres": "768 lowres (long edge 768 \u2014 smaller, faster)"
}
@@ -94466,7 +94468,7 @@
"tags": ["minimax", "video", "dimensions", "math"],
"title": "MiniMax H3 Ideal Dimensions",
"type": "object",
- "version": "1.1.0",
+ "version": "1.2.0",
"output": {
"$ref": "#/components/schemas/IdealSizeOutput"
}
diff --git a/invokeai/frontend/api/schema.ts b/invokeai/frontend/api/schema.ts
index 92c1bc31a2..9e1d99f179 100644
--- a/invokeai/frontend/api/schema.ts
+++ b/invokeai/frontend/api/schema.ts
@@ -40619,7 +40619,8 @@ export type components = {
* area cap of 768x1344. "768 lowres" pins the LONG edge to 768 instead, giving a
* canvas with roughly half the pixels for non-square ratios (e.g. a 2:3 source becomes
* 512x768 instead of 768x1152) — faster and cheaper, at some cost in fidelity since it
- * is below the model's training resolution. Both presets round each axis to the
+ * is below the model's training resolution. "480p" and "544p" target shorter edges
+ * under the native area cap (16:9 gives 864x480 and 960x544). All presets round each axis to the
* nearest multiple of 32. Only the aspect ratio of the inputs matters. Aspect ratios
* beyond 1:4 / 4:1 are rejected. Wire from ``Image Primitive``'s width/height outputs
* and into the width/height of ``Prompt - MiniMax H3``, ``Frame Conditioning - MiniMax
@@ -40657,11 +40658,11 @@ export type components = {
height?: number;
/**
* Target Resolution
- * @description Canvas preset. '768 highres' is H3's native policy (short edge 768, soft cap 768x1344). '768 lowres' pins the long edge to 768 for smaller, faster test renders (e.g. 512x768 from a 2:3 source) at some cost in fidelity.
+ * @description Canvas preset. '768 highres' is H3's native policy (short edge 768, soft cap 768x1344). '768 lowres' pins the long edge to 768 for smaller, faster test renders (e.g. 512x768 from a 2:3 source) at some cost in fidelity. 480p and 544p target a shorter edge under the same area cap for draft renders.
* @default 768 highres
* @enum {string}
*/
- target_resolution?: "768 highres" | "768 lowres";
+ target_resolution?: "768 highres" | "768 lowres" | "480p" | "544p";
/**
* type
* @default minimax_h3_ideal_dimensions
diff --git a/invokeai/frontend/webv2/src/features/video/core/dimensions.test.ts b/invokeai/frontend/webv2/src/features/video/core/dimensions.test.ts
index e130f7e0d0..19b402e6b0 100644
--- a/invokeai/frontend/webv2/src/features/video/core/dimensions.test.ts
+++ b/invokeai/frontend/webv2/src/features/video/core/dimensions.test.ts
@@ -94,6 +94,24 @@ describe('resolveMiniMaxH3Canvas', () => {
expect(resolveMiniMaxH3Canvas(1, 1, '768 lowres')).toEqual({ height: 768, width: 768 });
});
+ it.each([
+ ['480p', 864, 480],
+ ['544p', 960, 544],
+ ] as const)('resolves %s drafts without changing aspect or the 32-pixel grid', (preset, width, height) => {
+ expect(resolveMiniMaxH3Canvas(16, 9, preset)).toEqual({ width, height });
+ expect(resolveMiniMaxH3Canvas(9, 16, preset)).toEqual({ width: height, height: width });
+ expect(resolveMiniMaxH3Canvas(1, 1, preset)).toEqual({ width: height, height });
+ expect(resolveMiniMaxH3Canvas(5, 1, preset)).toBeNull();
+ expect(resolveMiniMaxH3Canvas(0, 1, preset)).toBeNull();
+ expect(resolveMiniMaxH3Canvas(Number.NaN, 1, preset)).toBeNull();
+ });
+
+ it('keeps extreme draft ratios under the native area cap before snapping', () => {
+ expect(resolveMiniMaxH3Canvas(4, 1, '544p')).toEqual({ width: 2016, height: 512 });
+ expect(resolveMiniMaxH3Canvas(1, 4, '544p')).toEqual({ width: 512, height: 2016 });
+ expect(resolveMiniMaxH3Canvas(4, 1, '480p')).toEqual({ width: 1920, height: 480 });
+ });
+
it('only the ratio matters, not the absolute pixels', () => {
expect(resolveMiniMaxH3Canvas(1920, 1080, '768 highres')).toEqual(resolveMiniMaxH3Canvas(16, 9, '768 highres'));
});
diff --git a/invokeai/frontend/webv2/src/features/video/core/dimensions.ts b/invokeai/frontend/webv2/src/features/video/core/dimensions.ts
index f847c22abc..9b3bbed2d8 100644
--- a/invokeai/frontend/webv2/src/features/video/core/dimensions.ts
+++ b/invokeai/frontend/webv2/src/features/video/core/dimensions.ts
@@ -70,7 +70,10 @@ export const MINIMAX_H3_CANVAS_MULTIPLE = 32;
export const MINIMAX_H3_MIN_ASPECT_RATIO = 1 / 4;
export const MINIMAX_H3_MAX_ASPECT_RATIO = 4;
-/** Highres: 768 short edge, soft 768x1344 area cap, 32-px rounding; lowres caps the long edge at 768. 1:4–4:1. */
+/**
+ * Highres: 768 short edge, soft 768x1344 area cap, 32-px rounding; lowres caps the long edge at 768. Draft presets
+ * target a 480/544 short edge under the same area cap. 1:4–4:1.
+ */
export const resolveMiniMaxH3Canvas = (
width: number,
height: number,
@@ -99,12 +102,14 @@ export const resolveMiniMaxH3Canvas = (
rawHeight = MINIMAX_H3_SHORT_EDGE;
}
} else {
+ const shortEdge = targetResolution === '480p' ? 480 : targetResolution === '544p' ? 544 : MINIMAX_H3_SHORT_EDGE;
+
if (ratio >= 1) {
- rawWidth = MINIMAX_H3_SHORT_EDGE * ratio;
- rawHeight = MINIMAX_H3_SHORT_EDGE;
+ rawWidth = shortEdge * ratio;
+ rawHeight = shortEdge;
} else {
- rawWidth = MINIMAX_H3_SHORT_EDGE;
- rawHeight = MINIMAX_H3_SHORT_EDGE / ratio;
+ rawWidth = shortEdge;
+ rawHeight = shortEdge / ratio;
}
const area = rawWidth * rawHeight;
diff --git a/invokeai/frontend/webv2/src/features/video/core/graph.test.ts b/invokeai/frontend/webv2/src/features/video/core/graph.test.ts
index 3fcd9d6953..5f8ba7515d 100644
--- a/invokeai/frontend/webv2/src/features/video/core/graph.test.ts
+++ b/invokeai/frontend/webv2/src/features/video/core/graph.test.ts
@@ -280,6 +280,21 @@ describe('compileVideoGraph — Wan 2.2', () => {
describe('compileVideoGraph — MiniMax H3', () => {
const model = h3Model();
+ it.each(['480p', '544p'] as const)('wires %s into text, keyframe, denoise, and metadata', (targetResolution) => {
+ const settings = settingsFor(model, { firstFrameImage: FIRST_FRAME, targetResolution });
+ const { backendGraph } = compileVideoGraph(settings, model);
+ const size = targetResolution === '480p' ? { width: 864, height: 480 } : { width: 960, height: 544 };
+
+ for (const type of [
+ 'minimax_h3_text_encoder',
+ 'minimax_h3_frame_conditioning',
+ 'minimax_h3_denoise',
+ 'core_metadata',
+ ]) {
+ expect(nodeOfType(backendGraph, type)).toMatchObject(size);
+ }
+ });
+
it('builds a text-to-video graph with audio, no negative prompt, and string frame counts', () => {
const settings = settingsFor(model, { aspectRatioId: '16:9' });
const { backendGraph } = compileVideoGraph(settings, model);
@@ -358,6 +373,18 @@ describe('compileVideoGraph — MiniMax H3 Ref2VA', () => {
],
});
+ it('uses the draft canvas for reference conditioning, text, denoise, and metadata', () => {
+ const { backendGraph } = compileVideoGraph({ ...referenceSettings, targetResolution: '544p' }, model);
+ for (const type of [
+ 'minimax_h3_text_encoder',
+ 'minimax_h3_reference_conditioning',
+ 'minimax_h3_denoise',
+ 'core_metadata',
+ ]) {
+ expect(nodeOfType(backendGraph, type)).toMatchObject({ width: 960, height: 544 });
+ }
+ });
+
it('passes an explicit override only for an overridden job', () => {
const catalogModel = { ...model, variant: 'fl2va' };
const { backendGraph } = compileVideoGraph({ ...referenceSettings, h3TaskOverride: 'ref2va' }, catalogModel);
diff --git a/invokeai/frontend/webv2/src/features/video/core/settings.ts b/invokeai/frontend/webv2/src/features/video/core/settings.ts
index 5852b5e9f1..eb12d9f41a 100644
--- a/invokeai/frontend/webv2/src/features/video/core/settings.ts
+++ b/invokeai/frontend/webv2/src/features/video/core/settings.ts
@@ -65,7 +65,12 @@ export const isVideoAspectRatioId = (value: unknown): value is VideoAspectRatioI
typeof value === 'string' && (VIDEO_ASPECT_RATIO_IDS as readonly string[]).includes(value);
export const WAN_TARGET_RESOLUTIONS: readonly WanTargetResolution[] = ['480p', '720p', '1080p'];
-export const MINIMAX_H3_TARGET_RESOLUTIONS: readonly MiniMaxH3TargetResolution[] = ['768 highres', '768 lowres'];
+export const MINIMAX_H3_TARGET_RESOLUTIONS: readonly MiniMaxH3TargetResolution[] = [
+ '768 highres',
+ '768 lowres',
+ '480p',
+ '544p',
+];
export const LTX2_TARGET_RESOLUTIONS: readonly Ltx2TargetResolution[] = ['512p', '704p', '768p', '1024p', '1536p'];
export const isVideoTargetResolution = (value: unknown): value is VideoTargetResolution =>
diff --git a/invokeai/frontend/webv2/src/features/video/core/types.ts b/invokeai/frontend/webv2/src/features/video/core/types.ts
index ccc9178136..be55e622a8 100644
--- a/invokeai/frontend/webv2/src/features/video/core/types.ts
+++ b/invokeai/frontend/webv2/src/features/video/core/types.ts
@@ -66,7 +66,7 @@ export type VideoReferenceItem =
| { kind: 'image'; image: ImageWithDims; detail: VideoReferenceImageDetail };
export type WanTargetResolution = '480p' | '720p' | '1080p';
-export type MiniMaxH3TargetResolution = '768 highres' | '768 lowres';
+export type MiniMaxH3TargetResolution = '768 highres' | '768 lowres' | '480p' | '544p';
/** 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;
diff --git a/invokeai/frontend/webv2/src/features/video/core/videoPolicies.test.ts b/invokeai/frontend/webv2/src/features/video/core/videoPolicies.test.ts
index da5cc559c5..ff38e4f795 100644
--- a/invokeai/frontend/webv2/src/features/video/core/videoPolicies.test.ts
+++ b/invokeai/frontend/webv2/src/features/video/core/videoPolicies.test.ts
@@ -494,7 +494,7 @@ describe('getVideoModelSelectionResult', () => {
const from = settingsFor(wan, {
...lightningOn,
loras: [...lightningOn.loras, { isEnabled: true, model: lora('Style LoRA') as never, weight: 0.5 }],
- targetResolution: '480p',
+ targetResolution: '720p',
vae: { base: 'wan', key: 'wan-vae', name: 'Wan VAE', type: 'vae' },
wanT5EncoderModel: { base: 'any', key: 'umt5', name: 'UMT5-XXL', type: 'wan_t5_encoder' },
});
diff --git a/invokeai/frontend/webv2/src/features/video/core/videoPolicies.ts b/invokeai/frontend/webv2/src/features/video/core/videoPolicies.ts
index 857f330eb6..7e452c5999 100644
--- a/invokeai/frontend/webv2/src/features/video/core/videoPolicies.ts
+++ b/invokeai/frontend/webv2/src/features/video/core/videoPolicies.ts
@@ -19,6 +19,7 @@ import { SEED_MAX } from '@platform/core/seed';
import type {
Ltx2TargetResolution,
+ MiniMaxH3TargetResolution,
VideoAspectRatioId,
VideoGenerationMode,
VideoSettings,
@@ -217,6 +218,8 @@ const WAN_TARGET_RESOLUTION_OPTIONS: readonly VideoTargetResolutionOption[] = [
const MINIMAX_H3_TARGET_RESOLUTION_OPTIONS: readonly VideoTargetResolutionOption[] = [
{ id: '768 highres', label: '768 highres (H3 native)' },
{ id: '768 lowres', label: '768 lowres (fast preview)' },
+ { id: '480p', label: '480p draft (short edge 480)' },
+ { id: '544p', label: '544p draft (short edge 544)' },
];
const WAN_FRAMES: VideoFramesGridPolicy = {
@@ -544,7 +547,7 @@ export const getVideoDimensions = (
const dimensions =
model?.base === 'minimax-h3'
- ? resolveMiniMaxH3Canvas(inputs.width, inputs.height, targetResolution as '768 highres' | '768 lowres')
+ ? resolveMiniMaxH3Canvas(inputs.width, inputs.height, targetResolution as MiniMaxH3TargetResolution)
: model?.base === 'ltx-2'
? resolveLtx2Canvas(inputs.width, inputs.height, targetResolution as Ltx2TargetResolution)
: scaleAndSnapWanDimensions(
diff --git a/invokeai/frontend/webv2/src/workbench/image-actions/videoRecall.test.ts b/invokeai/frontend/webv2/src/workbench/image-actions/videoRecall.test.ts
index c9ca5694fb..a2c0fee8a8 100644
--- a/invokeai/frontend/webv2/src/workbench/image-actions/videoRecall.test.ts
+++ b/invokeai/frontend/webv2/src/workbench/image-actions/videoRecall.test.ts
@@ -823,6 +823,49 @@ describe('legacy H3 duration recall', () => {
});
});
+describe('H3 draft size recall', () => {
+ it.each([
+ [864, 480, '16:9', '480p'],
+ [960, 544, '16:9', '544p'],
+ [544, 960, '9:16', '544p'],
+ [480, 480, '1:1', '480p'],
+ ] as const)('recalls %sx%s as %s %s', (width, height, aspectRatioId, targetResolution) => {
+ expect(getVideoSizeRecalls(h3Model(), width, height)).toContainEqual({ aspectRatioId, targetResolution });
+ });
+});
+
+describe('equivalent H3 media-sized presets', () => {
+ const model = h3Model();
+ const frame = { width: 1000, height: 700, image_name: 'legacy-frame.png' };
+
+ it.each(['768 highres', '768 lowres', '544p'] as const)(
+ 'recalls the original 768x544 canvas from %s without increasing its size',
+ (targetResolution) => {
+ const values = { ...createDefaultVideoWidgetValues([model]), firstFrameImage: frame, targetResolution };
+ const result = buildVideoRecallSettings({
+ currentValues: values,
+ kind: 'all',
+ metadata: {
+ generation_mode: 'minimax_h3_i2v',
+ width: 768,
+ height: 544,
+ first_frame_image: { image_name: frame.image_name },
+ },
+ models: [model],
+ });
+ expect(result).not.toBeNull();
+ const settled = settleMediaSizedRecall({ ...result!, values: { ...result!.values, firstFrameImage: frame } });
+ expect(settled.values.targetResolution).toBe(targetResolution === '544p' ? '544p' : '768 lowres');
+ expect(getVideoDimensions(model, settled.values)).toMatchObject({ width: 768, height: 544 });
+ const sizeOnly = resolveVideoSizeRecall(values, 768, 544);
+ expect(sizeOnly).toEqual({
+ outcome: 'fits',
+ sizeRecall: { targetResolution: targetResolution === '544p' ? '544p' : '768 lowres' },
+ });
+ }
+ );
+});
+
describe('Wan LoRA expert target recall', () => {
const highLora = { ...LIGHTNING_HIGH, key: 'wan-expert-high' };
const lowLora = { ...LIGHTNING_LOW, key: 'wan-expert-low' };
diff --git a/invokeai/frontend/webv2/src/workbench/image-actions/videoRecall.ts b/invokeai/frontend/webv2/src/workbench/image-actions/videoRecall.ts
index a7b0d9c2ff..cc999a8fb8 100644
--- a/invokeai/frontend/webv2/src/workbench/image-actions/videoRecall.ts
+++ b/invokeai/frontend/webv2/src/workbench/image-actions/videoRecall.ts
@@ -448,23 +448,25 @@ export const getVideoSizeRecalls = (
return recalls;
};
-/** The one target resolution at which `media` size the canvas to exactly `width` x `height`; null when none or several do. */
+/** Resolve equivalent canvas presets without changing the recorded size; retain the current choice when it fits. */
const getMediaSizedResolution = (
model: MainModelConfig,
media: Pick<
VideoWidgetValues,
- 'aspectRatioId' | 'conditioningClip' | 'firstFrameImage' | 'lastFrameImage' | 'sourceVideo'
+ 'aspectRatioId' | 'conditioningClip' | 'firstFrameImage' | 'lastFrameImage' | 'sourceVideo' | 'targetResolution'
>,
width: number,
height: number
): Pick<VideoSizePreset, 'targetResolution'> | null => {
- const [match, ...others] = getVideoTargetResolutionOptions(model).filter((option) => {
+ const matches = getVideoTargetResolutionOptions(model).filter((option) => {
const canvas = getVideoDimensions(model, { ...media, targetResolution: option.id });
return canvas?.width === width && canvas.height === height;
});
- return match && others.length === 0 ? { targetResolution: match.id } : null;
+ const match = matches.find((option) => option.id === media.targetResolution) ?? matches[0];
+
+ return match ? { targetResolution: match.id } : null;
};
const isCanvasFromRecordedMedia = ({ conditioningClip, media }: VideoRecallRecord): boolean =>
diff --git a/invokeai/frontend/webv2/src/workbench/image-actions/videoRecallContract.test.ts b/invokeai/frontend/webv2/src/workbench/image-actions/videoRecallContract.test.ts
index 0772d272a6..0404bbf12b 100644
--- a/invokeai/frontend/webv2/src/workbench/image-actions/videoRecallContract.test.ts
+++ b/invokeai/frontend/webv2/src/workbench/image-actions/videoRecallContract.test.ts
@@ -447,6 +447,9 @@ const tunedValuesFor = (testCase: Case, model: MainModelConfig): VideoWidgetValu
// the grid, so a media-sized canvas there cannot be resolved from its own shape.
targetResolution:
testCase.targetResolution ??
+ // At this fixture's 10:7 media ratio, 544p and legacy 768 lowres both yield 768x544.
+ // Dimensions alone cannot distinguish those presets; use the unambiguous 480p draft.
+ (model.base === 'minimax-h3' ? '480p' : undefined) ??
targetResolutions
.filter((option) => option.id !== defaults.targetResolution && option.stages === undefined)
.at(-1)!.id,
diff --git a/tests/app/invocations/test_minimax_h3_ideal_dimensions.py b/tests/app/invocations/test_minimax_h3_ideal_dimensions.py
index 5b9abba9f1..1632030816 100644
--- a/tests/app/invocations/test_minimax_h3_ideal_dimensions.py
+++ b/tests/app/invocations/test_minimax_h3_ideal_dimensions.py
@@ -82,3 +82,42 @@ class TestRejection:
def test_extreme_aspect_ratio_rejected(self, w: int, h: int) -> None:
with pytest.raises(ValueError, match="aspect ratio"):
_resolve(w, h)
+
+
[email protected]("preset, expected", [("480p", (864, 480)), ("544p", (960, 544))])
+def test_draft_landscape_and_portrait(preset, expected):
+ assert _resolve(16, 9, target_resolution=preset) == expected
+ assert _resolve(9, 16, target_resolution=preset) == expected[::-1]
+ assert _resolve(1920, 1080, target_resolution=preset) == expected
+
+
[email protected]("preset, edge", [("480p", 480), ("544p", 544)])
+def test_draft_square_and_four_three(preset, edge):
+ assert _resolve(1, 1, target_resolution=preset) == (edge, edge)
+ assert _resolve(4, 3, target_resolution=preset) == ((640 if edge == 480 else 736), edge)
+
+
[email protected]("preset", ["480p", "544p"])
[email protected]("width,height", [(4, 1), (1, 4), (21, 9), (9, 21), (1, 1)])
+def test_draft_canvases_pass_sampling_validation(preset, width, height):
+ from invokeai.backend.minimax_h3.sampling import validate_canvas
+
+ w, h = _resolve(width, height, target_resolution=preset)
+ validate_canvas(h, w)
+ native_w, native_h = _resolve(width, height)
+ assert w * h <= native_w * native_h
+
+
[email protected]("preset", ["480p", "544p", "768 lowres", "768 highres"])
+def test_presets_reject_invalid_ratios(preset):
+ with pytest.raises(ValueError, match="aspect ratio"):
+ _resolve(5, 1, target_resolution=preset)
+
+
+ "preset, source, equivalent, expected",
+ [("544p", (21, 14), (3, 2), (832, 544)), ("480p", (187, 110), (17, 10), (832, 480))],
+)
+def test_draft_rounding_is_independent_of_source_scale(preset, source, equivalent, expected):
+ assert _resolve(*source, target_resolution=preset) == expected
+ assert _resolve(*equivalent, target_resolution=preset) == expected