The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.
TypeScript ai-videocomfyuicreative-toolsgenerative-aiideogramimage-generationimage-to-3dimage-to-videoltx-videominimax-h3nextjsopen-sourceopen-weightsqwen-imagetext-to-imagevideo-generationwan
Video: an end frame alone runs on H3, H3 Max and H3 Max Turbo
Adarsh06f71c2ddb12
diff --git a/scripts/gen-cloud-models.py b/scripts/gen-cloud-models.pyindex 0046e109..91719624 100644--- a/scripts/gen-cloud-models.py+++ b/scripts/gen-cloud-models.py@@ -610,17 +610,20 @@ model("wan-2-6", "Wan 2.6", "Alibaba Wan", "wan", "video", "Multi-shot Wan withmodel("wan-2-5", "Wan 2.5", "Alibaba Wan", "wan", "video", "Audio-driven video up to 1080p",[("t2v", "fal-ai/wan-25-preview/text-to-video"), ("i2v", "fal-ai/wan-25-preview/image-to-video")],badges=["audio"], pricing=("second", 0.15, "1080p"), defaults={"aspectRatio": "16:9", "duration": 5, "resolution": "1080p"})+# fal's H3, H3 Max and H3 Max Turbo image to video take an end frame alone ("It may be provided alone for end-only keyframe+# generation; in that case the output canvas follows this image"): FieldMap.endAlone, so a run with only an end frame goes there.+END_ALONE = {"flf2v": True, "endAlone": True}# Hosted MiniMax H3 makes its own sound. fal takes a whole number of seconds from 5 to 15 and bills each second by the# resolution (its pricing record, docs/research/new-models-7.json): 480P $0.05, 768P $0.06, 2K $0.13, 4K $0.16. Without# a resolution fal renders 2K, so 768P is set as the default (H3's native size, the open model's too).model("minimax-h3", "MiniMax H3", "MiniMax", "hailuo", "video", "Video with its own synchronized sound, 5–15 s, from words, a start frame, start and end frames, or references",- [("t2v", "minimax/h3/text-to-video"), ("i2v", "minimax/h3/image-to-video", "fal", "+flf2v"), ("ref2v", "minimax/h3/reference-to-video")],+ [("t2v", "minimax/h3/text-to-video"), ("i2v", "minimax/h3/image-to-video", "fal", END_ALONE), ("ref2v", "minimax/h3/reference-to-video")],badges=["top", "audio", "new"], defaults={"aspectRatio": "16:9", "duration": 5, "resolution": "768P"}, ranged_durations=True,# "Reference images, videos, and audio clips must add up to at most 12 files" (reference-to-video).options={"maxReferences": 12},pricing=("second", 0.06, "768P; 480P $0.05, 2K $0.13, 4K $0.16", {"byResolution": {"480P": 0.05, "768P": 0.06, "2K": 0.13, "4K": 0.16}}))model("minimax-h3-max", "MiniMax H3 Max", "MiniMax", "hailuo", "video", "Top-tier MiniMax with extend",- [("t2v", "minimax/h3-max/text-to-video"), ("i2v", "minimax/h3-max/image-to-video", "fal", "+flf2v"), ("ref2v", "minimax/h3-max/reference-to-video"),+ [("t2v", "minimax/h3-max/text-to-video"), ("i2v", "minimax/h3-max/image-to-video", "fal", END_ALONE), ("ref2v", "minimax/h3-max/reference-to-video"),("extend", "minimax/h3-max/extend-video")],# 2K and "auto" are extend's alone: each route lists what it takes (fit_values), so a 2K text, picture or reference run# is made (and priced) at 1080P, and "auto" is left out where the route has no such value.@@ -693,7 +696,7 @@ for _slug, _id, _name, _tag in (("16bit-pixel", "pixel", "16-bit Pixel", "16-bit# then the list rates. Its reference and extend routes are billed differently, so they are models of their own.model("minimax-h3-max-turbo", "MiniMax H3 Max Turbo", "MiniMax", "hailuo", "video","Fast, cheap H3 Max with sound — drafts and quick takes from words or frames, 1–15 s",- [("t2v", "minimax/h3-max-turbo/text-to-video"), ("i2v", "minimax/h3-max-turbo/image-to-video", "fal", "+flf2v")],+ [("t2v", "minimax/h3-max-turbo/text-to-video"), ("i2v", "minimax/h3-max-turbo/image-to-video", "fal", END_ALONE)],badges=["new", "fast", "audio"], defaults={"aspectRatio": "16:9", "duration": 5, "resolution": "768P"}, ranged_durations=True, fit_values=True,pricing=("second", 0.04, "768P; 480P $0.025, 1080P $0.08 — $0.028 (480P $0.0175, 1080P $0.056) until 2026-11-15",{"byResolution": {"480P": 0.025, "768P": 0.04, "1080P": 0.08},@@ -2635,6 +2638,12 @@ def build_route(op, ep, provider, m, opts, ropts=None):# FieldMap.publicLinks, so the server sends each file as a public https link, never a data: URI or a Files API link.if ropts.get("publicLinks"):fmap["publicLinks"] = True+ # An end frame the endpoint takes without a start frame (FieldMap.endAlone).+ if ropts.get("endAlone"):+ if "endImage" in fmap:+ fmap["endAlone"] = True+ else:+ warn(f"{m['id']}: {ep} has no end frame field; no endAlone")route = {"op": op, "provider": provider, "endpoint": f"{ep}:{version}" if ropts.get("pin") else ep, "map": fmap}if ropts.get("note"):route["note"] = ropts["note"]diff --git a/src/components/studio/composer.tsx b/src/components/studio/composer.tsxindex 12438098..821d9579 100644--- a/src/components/studio/composer.tsx+++ b/src/components/studio/composer.tsx@@ -28,6 +28,7 @@ import { useSetRunOn } from "@/lib/run-on";import { RunOnChip } from "./run-on";import { PlaceIntro } from "./place-intro";import { PoolNote } from "./pool-note";+import { EndFrameNote } from "./end-frame-note";import { modelOwnSetup, pickerRules, poolRunsModel } from "@/lib/pool-rules";import { controlSetup, keyOnlySetup } from "@/lib/own-setup-controls";import { ownSetupDetail, ownSetupLabel, ownSetupShort } from "@/lib/own-setup";@@ -2262,6 +2263,7 @@ export function Composer({ docked }: { docked: boolean }) {{sketched.note && <p className="px-2 pt-1 text-[12px] text-muted-foreground">{sketched.note}</p>}{signed.notes.length > 0 && <p className="px-2 pt-1 text-[12px] text-muted-foreground">{signed.notes.join(" · ")}</p>}{smallGpuNote && <p className="px-2 pt-1 text-[12px] text-muted-foreground">{smallGpuNote}</p>}+ {model && !framesOn && <EndFrameNote model={model} start={draft.slots.image} end={draft.slots.endImage} hasStartSlot={slots.some((s) => s.key === "image")} setSlot={setSlot} />}{model && op && model.options.endFrame === undefined && draft.slots.endImage?.ref && (<p className="px-2 pt-1 text-[12px] text-warning">{model.name} ignores the end frame — pick Kling 2.5, Veo 3.1, Seedance or Wan 2.2 to use it.</p>)}diff --git a/src/components/studio/end-frame-note.tsx b/src/components/studio/end-frame-note.tsxnew file mode 100644index 00000000..019b0675--- /dev/null+++ b/src/components/studio/end-frame-note.tsx@@ -0,0 +1,44 @@+"use client";++import { UnavailableNote } from "@/components/ui/unavailable";+import { endFrameAloneProblem } from "@/lib/catalog/plan";+import type { ModelDef } from "@/lib/catalog/types";+import type { SlotValue } from "./media-slot";++/**+ * An end frame with no start frame, on a model that uses an end frame only after a start frame (endFrameAloneProblem): said+ * before the run in the shared unavailable note, with the one tap that keeps the picture in the clip ("Use it as the start+ * frame"). A model that takes an end frame alone (fal's H3 family) runs it as it is, so there is nothing to say.+ */+export function EndFrameNote({+ model,+ start,+ end,+ hasStartSlot,+ setSlot,+}: {+ model: ModelDef;+ start: SlotValue | null | undefined;+ end: SlotValue | null | undefined;+ /** The studio has a start frame slot to move the picture into. */+ hasStartSlot: boolean;+ setSlot: (key: "image" | "endImage", v: SlotValue | null) => void;+}) {+ if (!end?.ref || start?.ref) return null;+ const why = endFrameAloneProblem(model, { endImage: end.ref });+ if (!why) return null;+ const fix = hasStartSlot+ ? {+ label: "Use it as the start frame",+ run: () => {+ setSlot("image", end);+ setSlot("endImage", null);+ },+ }+ : undefined;+ return (+ <div className="px-1">+ <UnavailableNote reason={{ why, ...(fix && { fix }) }} onClose={() => undefined} />+ </div>+ );+}diff --git a/src/lib/catalog/cloud-models.generated.ts b/src/lib/catalog/cloud-models.generated.tsindex 301525df..b09f1605 100644--- a/src/lib/catalog/cloud-models.generated.ts+++ b/src/lib/catalog/cloud-models.generated.ts@@ -8299,7 +8299,8 @@ export const CLOUD_MODELS: ModelDef[] = ["key": "duration","type": "number"},- "promptMax": 50000+ "promptMax": 50000,+ "endAlone": true}},{@@ -8315,7 +8316,8 @@ export const CLOUD_MODELS: ModelDef[] = ["key": "duration","type": "number"},- "promptMax": 50000+ "promptMax": 50000,+ "endAlone": true}},{@@ -8456,7 +8458,8 @@ export const CLOUD_MODELS: ModelDef[] = ["defaults": {"prompt_expansion_mode": "balanced"},- "promptMax": 50000+ "promptMax": 50000,+ "endAlone": true}},{@@ -8482,7 +8485,8 @@ export const CLOUD_MODELS: ModelDef[] = ["defaults": {"prompt_expansion_mode": "balanced"},- "promptMax": 50000+ "promptMax": 50000,+ "endAlone": true}},{@@ -9564,7 +9568,8 @@ export const CLOUD_MODELS: ModelDef[] = ["defaults": {"prompt_expansion_mode": "balanced"},- "promptMax": 50000+ "promptMax": 50000,+ "endAlone": true}},{@@ -9590,7 +9595,8 @@ export const CLOUD_MODELS: ModelDef[] = ["defaults": {"prompt_expansion_mode": "balanced"},- "promptMax": 50000+ "promptMax": 50000,+ "endAlone": true}}],diff --git a/src/lib/catalog/plan.ts b/src/lib/catalog/plan.tsindex 31deef7b..7763f9e9 100644--- a/src/lib/catalog/plan.ts+++ b/src/lib/catalog/plan.ts@@ -55,6 +55,8 @@ export function inferOperation(model: ModelDef, req: Pick<GenerationRequest, "opif (req.inputs?.video && imgs && has("video-swap")) return "video-swap";if (req.inputs?.video && has("remove-object")) return "remove-object";if (imgs && req.inputs?.endImage && has("flf2v")) return "flf2v";+ // An end frame alone goes to the start-and-end route that takes it alone (fal's H3 image to video), not to text to video.+ if (!imgs && req.inputs?.endImage && takesEndAlone(model)) return "flf2v";// Several stills are keyframes when they have times, or when the model takes no references. The open// chain (a film of several clips) only with times: stills left over from references stay a start frame.if (imgs > 1 && has("keyframes") && (req.params?.keyframeTimes?.length || (!has("ref2v") && !keyframeChain(model)))) return "keyframes";@@ -80,6 +82,22 @@ export function inferOperation(model: ModelDef, req: Pick<GenerationRequest, "opreturn model.routes[0].op;}+/** Every start-and-end route of the model takes the end frame without a start frame (FieldMap.endAlone: fal's H3 family). */+export function takesEndAlone(model: Pick<ModelDef, "routes">): boolean {+ const routes = model.routes.filter((r) => r.op === "flf2v");+ return routes.length > 0 && routes.every((r) => !!r.map?.endAlone);+}++/**+ * An end frame with no start frame, on a model that uses an end frame only after a start frame (Kling, Veo, H3 Lite, H3 on+ * your GPU): the words the composer says before the run (with "Use it as the start frame") and the run's note. Null when+ * there is no such end frame, or the model takes it alone.+ */+export function endFrameAloneProblem(model: Pick<ModelDef, "name" | "kind" | "options" | "routes">, inputs: GenerationRequest["inputs"]): string | null {+ if (model.kind !== "video" || !model.options.endFrame || !inputs?.endImage || inputs.images?.length) return null;+ return takesEndAlone(model) ? null : `${model.name} uses an end frame only after a start frame`;+}+/*** Why a clip is too long for a model that takes clips up to a length (ModelOptions.maxSourceSeconds: Kandinsky VSR's 121* frames at 24 fps), in the words the composer shows and the server refuses with; null when it fits or isn't known.@@ -623,6 +641,9 @@ export function planGeneration(throw new Error("Reference clips and sound can't go with an end frame. Remove the end frame, or the clips and sound");}}+ // An end frame alone that this model can't take is never left out without a word.+ const endAlone = op === "t2v" || op === "ref2v" ? endFrameAloneProblem(model, req.inputs) : null;+ if (endAlone) notes.push(`${endAlone}: this clip is made without it`);// Reference clips and video elements on a model that bills them with the output (Kling 4.0, Pricing.clipInput): priced// at the least they bill (twice the output) until the server reads their length (params.clipSeconds).if (model.pricing?.clipInput && req.inputs?.videos?.length && params.clipSeconds === undefined) params = { ...params, clipSeconds: 0 };@@ -746,7 +767,7 @@ export function planGeneration(throw new Error(op === "remove-object" ? "Say what to remove, e.g. “the coffee cup in her hand”" : "Write a prompt first");}- const missing = missingInputs(op, req) ?? unreadInputs(model, op, req) ?? missingImages(model, req);+ const missing = missingInputs(op, req, model) ?? unreadInputs(model, op, req) ?? missingImages(model, req);if (missing) throw new Error(missing);// Watermark Remover: the kept marks are checked and rebuilt here (never passed on as sent); a brushed run takes none.if (op === "watermark-remove" && params.extra && "boxes" in params.extra) {@@ -1063,11 +1084,13 @@ const NEEDS: Partial<const given = (v: unknown) => (Array.isArray(v) ? v.length > 0 : !!v);/** Human message for the first missing input of an operation, or null. */-export function missingInputs(op: Operation, req: Pick<GenerationRequest, "inputs">): string | null {+export function missingInputs(op: Operation, req: Pick<GenerationRequest, "inputs">, model?: Pick<ModelDef, "routes">): string | null {const n = NEEDS[op];if (!n) return null;const i = req.inputs ?? {};- if (n.images && (i.images?.length ?? 0) < n.images) return n.msg;+ // A start-and-end run with only the end frame, on routes that take it alone (FieldMap.endAlone).+ const endAlone = op === "flf2v" && !!i.endImage && !i.images?.length && !!model && takesEndAlone(model);+ if (n.images && (i.images?.length ?? 0) < n.images && !endAlone) return n.msg;if (n.video && !i.video) return n.msg;// A join may also be one clip and a still appended after it (an ad and its end card).const clips = (i.videos?.length ?? 0) + (op === "concat" && i.video && i.images?.length ? 2 : 0);diff --git a/src/lib/catalog/types.ts b/src/lib/catalog/types.tsindex fe3f0da6..440164d3 100644--- a/src/lib/catalog/types.ts+++ b/src/lib/catalog/types.ts@@ -391,6 +391,12 @@ export interface FieldMap {/** Array of images field, e.g. "image_urls" (receives every reference image). */images?: string;endImage?: string;+ /**+ * The endpoint takes the end frame without a start frame (fal's H3, H3 Max and H3 Max Turbo image to video: "It may be+ * provided alone"; the clip then takes the end frame's shape). A run with only an end frame goes to its start-and-end+ * route; on a model without it, the end frame needs a start frame (endFrameAloneProblem in plan.ts).+ */+ endAlone?: boolean;mask?: string;/** What the mask's paint means to this API: white (default), black or transparent = change. */maskFormat?: "white" | "black" | "alpha";diff --git a/tests/end-frame-alone.test.ts b/tests/end-frame-alone.test.tsnew file mode 100644index 00000000..a2f4b421--- /dev/null+++ b/tests/end-frame-alone.test.ts@@ -0,0 +1,119 @@+import { describe, expect, it } from "vitest";+import { getModel, getPreset, MODELS } from "@/lib/catalog";+import { endFrameAloneProblem, inferOperation, planGeneration, routesFor, takesEndAlone } from "@/lib/catalog/plan";+import type { GenerationRequest } from "@/lib/catalog/types";+import { bodyProblems, END, handOverInput, IMG, inputSchema, PROMPT, routeRequest, SCHEMA_INDEX } from "./helpers/provider-schemas";++/**+ * A video run with only an end frame (no start frame). fal's H3, H3 Max and H3 Max Turbo image to video take one alone+ * ("It may be provided alone for end-only keyframe generation; in that case the output canvas follows this image"), so+ * the run goes there with the frame as end_image_url. Before, it was planned as text to video and the frame was left out+ * without a word. A model that uses an end frame only after a start frame says so: before the run in the composer (with+ * "Use it as the start frame") and in the run's notes.+ */++const H3_FAMILY = ["minimax-h3", "minimax-h3-max", "minimax-h3-max-turbo"];++function plan(modelId: string, inputs: GenerationRequest["inputs"], op?: GenerationRequest["op"]) {+ return planGeneration({ feature: "video", modelId, op, prompt: PROMPT, inputs, params: {} }, getModel, getPreset);+}++describe("an end frame alone on fal's H3 family", () => {+ it("goes to the image-to-video route as end_image_url, with no start frame and no text-to-video", () => {+ for (const id of H3_FAMILY) {+ const model = getModel(id)!;+ expect(takesEndAlone(model), id).toBe(true);+ const p = plan(id, { endImage: END });+ expect(p.op, id).toBe("flf2v");+ expect(p.notes ?? [], id).not.toContainEqual(expect.stringContaining("end frame"));+ const route = routesFor(p.model, p.op, p.params)[0];+ expect(route.endpoint, id).toMatch(/\/image-to-video$/);+ const { body } = routeRequest(route, handOverInput(p, { inputs: { endImage: END } }));+ expect(body.end_image_url, id).toBe(END);+ expect(body, id).not.toHaveProperty("image_url");+ expect(endFrameAloneProblem(model, { endImage: END }), id).toBeNull();+ }+ });++ it("the request fits the endpoint's saved schema", () => {+ for (const id of H3_FAMILY) {+ const p = plan(id, { endImage: END });+ const { endpoint, body } = routeRequest(routesFor(p.model, p.op, p.params)[0], handOverInput(p, { inputs: { endImage: END } }));+ expect(bodyProblems("fal", endpoint, body), `${id} ${JSON.stringify(body)}`).toEqual([]);+ }+ });++ it("an API caller's start-and-end op with only the end frame runs too", () => {+ expect(plan("minimax-h3-max-turbo", { endImage: END }, "flf2v").op).toBe("flf2v");+ });++ it("a start and an end frame still go together", () => {+ const p = plan("minimax-h3-max-turbo", { images: [IMG], endImage: END });+ expect(p.op).toBe("flf2v");+ const { body } = routeRequest(routesFor(p.model, p.op, p.params)[0], handOverInput(p, { inputs: { images: [IMG], endImage: END } }));+ expect(body).toMatchObject({ image_url: IMG, end_image_url: END });+ });++ it("reference clips beside an end frame alone are refused with the same words as beside both frames", () => {+ expect(() => plan("minimax-h3", { endImage: END, videos: ["https://v3b.fal.media/files/in/ref.mp4"] })).toThrow(/can't go with an end frame/);+ });+});++describe("conformance: a route that takes an end frame alone (FieldMap.endAlone)", () => {+ const flagged = MODELS.flatMap((m) => m.routes.filter((r) => r.map?.endAlone).map((r) => ({ id: m.id, route: r })));++ it("is fal's H3 family's image to video, and nothing else", () => {+ expect([...new Set(flagged.map((f) => f.route.endpoint))].sort()).toEqual(["minimax/h3-max-turbo/image-to-video", "minimax/h3-max/image-to-video", "minimax/h3/image-to-video"]);+ });++ it("has a saved schema whose start frame is optional and whose end frame may go alone", () => {+ for (const { id, route } of flagged) {+ expect(SCHEMA_INDEX.fal, `${id} ${route.endpoint}`).toContain(route.endpoint);+ const schema = inputSchema("fal", route.endpoint);+ const start = route.map!.image!;+ const end = route.map!.endImage!;+ expect(schema.properties, route.endpoint).toHaveProperty(end);+ expect((schema as { required?: string[] }).required ?? [], route.endpoint).not.toContain(start);+ expect((schema.properties![end] as { description?: string }).description, route.endpoint).toMatch(/provided alone/i);+ }+ });+});++describe("an end frame alone on a model that uses it only after a start frame", () => {+ const others = MODELS.filter((m) => m.kind === "video" && m.options.endFrame && !takesEndAlone(m) && routesFor(m, "t2v").length);++ it("covers hosted and open models (H3 Lite, Kling, H3 on your GPU)", () => {+ const ids = others.map((m) => m.id);+ for (const id of ["minimax-h3-lite", "kling-3", "oss-minimax-h3"]) expect(ids, id).toContain(id);+ });++ it("is said before the run, and the run's notes say it was made without it", () => {+ for (const m of others) {+ const why = endFrameAloneProblem(m, { endImage: END });+ expect(why, m.id).toBe(`${m.name} uses an end frame only after a start frame`);+ // With a start frame there is nothing to say.+ expect(endFrameAloneProblem(m, { images: [IMG], endImage: END }), m.id).toBeNull();+ expect(inferOperation(m, { inputs: { endImage: END } }), m.id).not.toBe("flf2v");+ let p: ReturnType<typeof plan>;+ try {+ p = plan(m.id, { endImage: END });+ } catch {+ // A model whose text-to-video needs more than words (a refusal says why, and the composer note comes first).+ continue;+ }+ expect(p.notes, m.id).toContain(`${why}: this clip is made without it`);+ }+ });++ it("H3 Lite and Kling make the clip from the words, and say the end frame wasn't used", () => {+ for (const id of ["minimax-h3-lite", "kling-3"]) {+ const p = plan(id, { endImage: END });+ expect(p.op, id).toBe("t2v");+ expect(p.notes, id).toContain(`${getModel(id)!.name} uses an end frame only after a start frame: this clip is made without it`);+ }+ });++ it("an explicit start-and-end op still asks for both frames", () => {+ expect(() => plan("kling-3", { endImage: END }, "flf2v")).toThrow("Add a start and an end frame");+ });+});diff --git a/tests/fixtures/provider-schemas/fal/minimax__h3-max__image-to-video.json b/tests/fixtures/provider-schemas/fal/minimax__h3-max__image-to-video.jsonnew file mode 100644index 00000000..e60f36a2--- /dev/null+++ b/tests/fixtures/provider-schemas/fal/minimax__h3-max__image-to-video.json@@ -0,0 +1,446 @@+{+ "components": {+ "schemas": {+ "File": {+ "properties": {+ "content_type": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ],+ "description": "The mime type of the file.",+ "examples": [+ "image/png"+ ],+ "title": "Content Type"+ },+ "file_name": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ],+ "description": "The name of the file. It will be auto-generated if not provided.",+ "examples": [+ "z9RV14K95DvU.png"+ ],+ "title": "File Name"+ },+ "file_size": {+ "anyOf": [+ {+ "type": "integer"+ },+ {+ "type": "null"+ }+ ],+ "description": "The size of the file in bytes.",+ "examples": [+ 4404019+ ],+ "title": "File Size"+ },+ "url": {+ "description": "The URL where the file can be downloaded from.",+ "title": "Url",+ "type": "string"+ }+ },+ "required": [+ "url"+ ],+ "title": "File",+ "type": "object",+ "x-fal-order-properties": [+ "url",+ "content_type",+ "file_name",+ "file_size"+ ]+ },+ "H3MaxImageToVideoInput": {+ "properties": {+ "duration": {+ "default": 5,+ "description": "Video length in seconds. The output can run up to about 0.7 s longer than requested. Use at least 2 s with target_audio_url.",+ "maximum": 15,+ "minimum": 0.92,+ "title": "Duration",+ "type": "number"+ },+ "enable_safety_checker": {+ "default": true,+ "description": "If set to true, the safety checker will be enabled.",+ "title": "Enable Safety Checker",+ "type": "boolean"+ },+ "end_image_url": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ],+ "description": "Optional URL of the image to use as the last frame. It may be provided alone for end-only keyframe generation; in that case the output canvas follows this image.",+ "title": "End Image URL"+ },+ "image_url": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ],+ "description": "Optional URL of the image to use as the first frame. When provided, the output canvas follows this image. If only end_image_url is provided, the canvas follows that last frame instead. If both images are omitted, the request is handled as text-to-video (16:9 by default).",+ "examples": [+ "https://storage.googleapis.com/falserverless/example_inputs/hailuo23/pro_i2v_in.jpg"+ ],+ "title": "Image URL"+ },+ "prompt": {+ "description": "Text prompt for video generation",+ "examples": [+ "The camera slowly pulls back from the scene, revealing the full landscape as clouds drift overhead and light shifts across the terrain."+ ],+ "maxLength": 50000,+ "minLength": 1,+ "title": "Prompt",+ "type": "string"+ },+ "prompt_expansion_mode": {+ "default": "balanced",+ "description": "How much effort to spend rewriting the prompt before generation. 'disabled' skips prompt expansion. 'balanced' returns in about a second. 'quality' spends up to ~30s on a richer prompt.",+ "examples": [+ "disabled",+ "balanced",+ "quality"+ ],+ "title": "Prompt Expansion Mode",+ "type": "string"+ },+ "resolution": {+ "default": "768P",+ "description": "The native generation resolution, or 1080P latent refinement from a native 768P source.",+ "enum": [+ "480P",+ "768P",+ "1080P"+ ],+ "title": "Resolution",+ "type": "string"+ },+ "seed": {+ "anyOf": [+ {+ "type": "integer"+ },+ {+ "type": "null"+ }+ ],+ "description": "Random seed. A random seed is selected when omitted.",+ "title": "Seed"+ },+ "sync_mode": {+ "default": false,+ "description": "Return the generated video as base64 instead of a CDN URL.",+ "title": "Sync Mode",+ "type": "boolean"+ },+ "target_audio_url": {+ "anyOf": [+ {+ "minLength": 1,+ "pattern": "\\S",+ "type": "string"+ },+ {+ "type": "null"+ }+ ],+ "description": "Optional URL of an audio clip at least 2 seconds long (maximum 15 MB) to pin to the generated soundtrack. Longer clips are trimmed to the generated video's length, keeping the beginning. The original audio replaces the output soundtrack, padded with silence if shorter than the video, without changing playback speed. Exceptionally high sample rates may be resampled to 96 kHz. Accepts an HTTP(S) URL or a base64 data URI.",+ "title": "Target Audio URL"+ }+ },+ "required": [+ "prompt",+ "prompt_expansion_mode"+ ],+ "title": "TurboImageToVideoHailuo03Input",+ "type": "object",+ "x-fal-order-properties": [+ "prompt",+ "duration",+ "resolution",+ "seed",+ "enable_safety_checker",+ "sync_mode",+ "prompt_expansion_mode",+ "target_audio_url",+ "image_url",+ "end_image_url"+ ]+ },+ "H3MaxImageToVideoOutput": {+ "properties": {+ "expanded_prompt": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ],+ "description": "The prompt after expansion, as sent to the model. Null when prompt expansion was disabled, left the prompt unchanged, or was performed internally by MiniMax's hosted API.",+ "title": "Expanded Prompt"+ },+ "timings": {+ "anyOf": [+ {+ "additionalProperties": {+ "type": "number"+ },+ "type": "object"+ },+ {+ "type": "null"+ }+ ],+ "description": "Timing breakdown in seconds. 'inference' is the DiT denoising time on the GPU backend. Null on routes that do not report backend timings.",+ "title": "Timings"+ },+ "video": {+ "$ref": "#/components/schemas/File",+ "description": "The generated video"+ }+ },+ "required": [+ "video"+ ],+ "title": "TurboImageToVideoHailuo03Output",+ "type": "object",+ "x-fal-order-properties": [+ "video",+ "expanded_prompt",+ "timings"+ ]+ },+ "QueueStatus": {+ "properties": {+ "cancel_url": {+ "description": "The cancel url.",+ "type": "string"+ },+ "logs": {+ "additionalProperties": true,+ "description": "The logs.",+ "type": "object"+ },+ "metrics": {+ "additionalProperties": true,+ "description": "The metrics.",+ "type": "object"+ },+ "queue_position": {+ "description": "The queue position.",+ "type": "integer"+ },+ "request_id": {+ "description": "The request id.",+ "type": "string"+ },+ "response_url": {+ "description": "The response url.",+ "type": "string"+ },+ "status": {+ "enum": [+ "IN_QUEUE",+ "IN_PROGRESS",+ "COMPLETED"+ ],+ "type": "string"+ },+ "status_url": {+ "description": "The status url.",+ "type": "string"+ }+ },+ "required": [+ "status",+ "request_id"+ ],+ "type": "object"+ }+ },+ "securitySchemes": {+ "apiKeyAuth": {+ "description": "Fal Key",+ "in": "header",+ "name": "Authorization",+ "type": "apiKey"+ }+ }+ },+ "info": {+ "description": "The OpenAPI schema for the minimax/h3-max/image-to-video queue.",+ "title": "Queue OpenAPI for minimax/h3-max/image-to-video",+ "version": "1.0.0",+ "x-fal-metadata": {+ "about": "Image-text-to-video: ``image_url`` optional; text-only routes to t2v.",+ "category": "image-to-video",+ "documentationUrl": "https://fal.ai/models/minimax/h3-max/image-to-video/api",+ "endpointId": "minimax/h3-max/image-to-video",+ "playgroundUrl": "https://fal.ai/models/minimax/h3-max/image-to-video",+ "thumbnailUrl": "https://v3b.fal.media/files/b/0aa7658f/fSQlWMcduHn4_abgJ7qhQ.jpg"+ }+ },+ "openapi": "3.1.0",+ "paths": {+ "/minimax/h3-max/image-to-video": {+ "post": {+ "requestBody": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/H3MaxImageToVideoInput"+ }+ }+ },+ "required": true+ },+ "responses": {+ "200": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/QueueStatus"+ }+ }+ },+ "description": "The request status."+ }+ }+ }+ },+ "/minimax/h3-max/image-to-video/requests/{request_id}": {+ "get": {+ "parameters": [+ {+ "in": "path",+ "name": "request_id",+ "required": true,+ "schema": {+ "description": "Request ID",+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/H3MaxImageToVideoOutput"+ }+ }+ },+ "description": "Result of the request."+ }+ }+ }+ },+ "/minimax/h3-max/image-to-video/requests/{request_id}/cancel": {+ "put": {+ "parameters": [+ {+ "in": "path",+ "name": "request_id",+ "required": true,+ "schema": {+ "description": "Request ID",+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "content": {+ "application/json": {+ "schema": {+ "properties": {+ "success": {+ "description": "Whether the request was cancelled successfully.",+ "type": "boolean"+ }+ },+ "type": "object"+ }+ }+ },+ "description": "The request was cancelled."+ }+ }+ }+ },+ "/minimax/h3-max/image-to-video/requests/{request_id}/status": {+ "get": {+ "parameters": [+ {+ "in": "path",+ "name": "request_id",+ "required": true,+ "schema": {+ "description": "Request ID",+ "type": "string"+ }+ },+ {+ "in": "query",+ "name": "logs",+ "required": false,+ "schema": {+ "description": "Whether to include logs (`1`) in the response or not (`0`).",+ "type": "number"+ }+ }+ ],+ "responses": {+ "200": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/QueueStatus"+ }+ }+ },+ "description": "The request status."+ }+ }+ }+ }+ },+ "security": [+ {+ "apiKeyAuth": []+ }+ ],+ "servers": [+ {+ "url": "https://queue.fal.run"+ }+ ]+}diff --git a/tests/fixtures/provider-schemas/fal/minimax__h3__image-to-video.json b/tests/fixtures/provider-schemas/fal/minimax__h3__image-to-video.jsonnew file mode 100644index 00000000..d4b79fc1--- /dev/null+++ b/tests/fixtures/provider-schemas/fal/minimax__h3__image-to-video.json@@ -0,0 +1,438 @@+{+ "components": {+ "schemas": {+ "File": {+ "properties": {+ "content_type": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ],+ "description": "The mime type of the file.",+ "examples": [+ "image/png"+ ],+ "title": "Content Type"+ },+ "file_name": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ],+ "description": "The name of the file. It will be auto-generated if not provided.",+ "examples": [+ "z9RV14K95DvU.png"+ ],+ "title": "File Name"+ },+ "file_size": {+ "anyOf": [+ {+ "type": "integer"+ },+ {+ "type": "null"+ }+ ],+ "description": "The size of the file in bytes.",+ "examples": [+ 4404019+ ],+ "title": "File Size"+ },+ "url": {+ "description": "The URL where the file can be downloaded from.",+ "title": "Url",+ "type": "string"+ }+ },+ "required": [+ "url"+ ],+ "title": "File",+ "type": "object",+ "x-fal-order-properties": [+ "url",+ "content_type",+ "file_name",+ "file_size"+ ]+ },+ "H3ImageToVideoInput": {+ "properties": {+ "duration": {+ "default": 5,+ "description": "The duration of the video in seconds.",+ "maximum": 15,+ "minimum": 5,+ "title": "Duration",+ "type": "integer"+ },+ "enable_safety_checker": {+ "default": true,+ "description": "If set to true, the safety checker will be enabled.",+ "title": "Enable Safety Checker",+ "type": "boolean"+ },+ "end_image_url": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ],+ "description": "Optional URL of the image to use as the last frame. It may be provided alone for end-only keyframe generation; in that case the output canvas follows this image.",+ "title": "End Image URL"+ },+ "image_url": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ],+ "description": "Optional URL of the image to use as the first frame. When provided, the output canvas follows this image. If only end_image_url is provided, the canvas follows that last frame instead. If both images are omitted, the request is handled as text-to-video (16:9 by default).",+ "examples": [+ "https://storage.googleapis.com/falserverless/example_inputs/hailuo23/pro_i2v_in.jpg"+ ],+ "title": "Image URL"+ },+ "prompt": {+ "description": "Text prompt for video generation",+ "examples": [+ "The camera slowly pulls back from the scene, revealing the full landscape as clouds drift overhead and light shifts across the terrain."+ ],+ "maxLength": 50000,+ "minLength": 1,+ "title": "Prompt",+ "type": "string"+ },+ "prompt_expansion_mode": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ],+ "default": "balanced",+ "description": "How much effort to spend rewriting the prompt before generation. 'disabled' skips prompt expansion. 'fast' returns in about a second. 'balanced' picks per request. 'quality' spends up to ~30s on a richer prompt.",+ "examples": [+ "disabled",+ "fast",+ "balanced",+ "quality"+ ],+ "title": "Prompt Expansion Mode"+ },+ "resolution": {+ "default": "2K",+ "description": "The resolution of the generated video. 480P and 768P are native generation modes; 2K and 4K upscale a 768P base result.",+ "enum": [+ "480P",+ "768P",+ "2K",+ "4K"+ ],+ "title": "Resolution",+ "type": "string"+ },+ "seed": {+ "anyOf": [+ {+ "type": "integer"+ },+ {+ "type": "null"+ }+ ],+ "description": "Random seed. A random seed is selected when omitted.",+ "title": "Seed"+ },+ "sync_mode": {+ "default": false,+ "description": "Return the generated video as base64 instead of a CDN URL.",+ "title": "Sync Mode",+ "type": "boolean"+ },+ "target_audio_url": {+ "anyOf": [+ {+ "minLength": 1,+ "pattern": "\\S",+ "type": "string"+ },+ {+ "type": "null"+ }+ ],+ "description": "Optional URL of an audio clip at least 2 seconds long (maximum 15 MB) to pin to the generated soundtrack. Longer clips are trimmed to the generated video's length, keeping the beginning. The original audio replaces the output soundtrack, padded with silence if shorter than the video, without changing playback speed. Exceptionally high sample rates may be resampled to 96 kHz. Accepts an HTTP(S) URL or a base64 data URI.",+ "title": "Target Audio URL"+ }+ },+ "required": [+ "prompt"+ ],+ "title": "ImageToVideoHailuo03Input",+ "type": "object",+ "x-fal-order-properties": [+ "prompt",+ "duration",+ "resolution",+ "seed",+ "enable_safety_checker",+ "sync_mode",+ "prompt_expansion_mode",+ "target_audio_url",+ "image_url",+ "end_image_url"+ ]+ },+ "H3ImageToVideoOutput": {+ "properties": {+ "expanded_prompt": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ],+ "description": "The prompt after expansion, as sent to the model. Null when prompt expansion was disabled, left the prompt unchanged, or was performed internally by MiniMax's hosted API.",+ "title": "Expanded Prompt"+ },+ "video": {+ "$ref": "#/components/schemas/File",+ "description": "The generated video"+ }+ },+ "required": [+ "video"+ ],+ "title": "ImageToVideoHailuo03Output",+ "type": "object",+ "x-fal-order-properties": [+ "video",+ "expanded_prompt"+ ]+ },+ "QueueStatus": {+ "properties": {+ "cancel_url": {+ "description": "The cancel url.",+ "type": "string"+ },+ "logs": {+ "additionalProperties": true,+ "description": "The logs.",+ "type": "object"+ },+ "metrics": {+ "additionalProperties": true,+ "description": "The metrics.",+ "type": "object"+ },+ "queue_position": {+ "description": "The queue position.",+ "type": "integer"+ },+ "request_id": {+ "description": "The request id.",+ "type": "string"+ },+ "response_url": {+ "description": "The response url.",+ "type": "string"+ },+ "status": {+ "enum": [+ "IN_QUEUE",+ "IN_PROGRESS",+ "COMPLETED"+ ],+ "type": "string"+ },+ "status_url": {+ "description": "The status url.",+ "type": "string"+ }+ },+ "required": [+ "status",+ "request_id"+ ],+ "type": "object"+ }+ },+ "securitySchemes": {+ "apiKeyAuth": {+ "description": "Fal Key",+ "in": "header",+ "name": "Authorization",+ "type": "apiKey"+ }+ }+ },+ "info": {+ "description": "The OpenAPI schema for the minimax/h3/image-to-video queue.",+ "title": "Queue OpenAPI for minimax/h3/image-to-video",+ "version": "1.0.0",+ "x-fal-metadata": {+ "about": "Image-text-to-video: ``image_url`` optional; text-only routes to t2v.",+ "category": "image-to-video",+ "documentationUrl": "https://fal.ai/models/minimax/h3/image-to-video/api",+ "endpointId": "minimax/h3/image-to-video",+ "playgroundUrl": "https://fal.ai/models/minimax/h3/image-to-video",+ "thumbnailUrl": "https://v3b.fal.media/files/b/0aa42dac/wjm-S2eWgG8vU2uJoRwPx.jpg"+ }+ },+ "openapi": "3.1.0",+ "paths": {+ "/minimax/h3/image-to-video": {+ "post": {+ "requestBody": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/H3ImageToVideoInput"+ }+ }+ },+ "required": true+ },+ "responses": {+ "200": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/QueueStatus"+ }+ }+ },+ "description": "The request status."+ }+ }+ }+ },+ "/minimax/h3/image-to-video/requests/{request_id}": {+ "get": {+ "parameters": [+ {+ "in": "path",+ "name": "request_id",+ "required": true,+ "schema": {+ "description": "Request ID",+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/H3ImageToVideoOutput"+ }+ }+ },+ "description": "Result of the request."+ }+ }+ }+ },+ "/minimax/h3/image-to-video/requests/{request_id}/cancel": {+ "put": {+ "parameters": [+ {+ "in": "path",+ "name": "request_id",+ "required": true,+ "schema": {+ "description": "Request ID",+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "content": {+ "application/json": {+ "schema": {+ "properties": {+ "success": {+ "description": "Whether the request was cancelled successfully.",+ "type": "boolean"+ }+ },+ "type": "object"+ }+ }+ },+ "description": "The request was cancelled."+ }+ }+ }+ },+ "/minimax/h3/image-to-video/requests/{request_id}/status": {+ "get": {+ "parameters": [+ {+ "in": "path",+ "name": "request_id",+ "required": true,+ "schema": {+ "description": "Request ID",+ "type": "string"+ }+ },+ {+ "in": "query",+ "name": "logs",+ "required": false,+ "schema": {+ "description": "Whether to include logs (`1`) in the response or not (`0`).",+ "type": "number"+ }+ }+ ],+ "responses": {+ "200": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/QueueStatus"+ }+ }+ },+ "description": "The request status."+ }+ }+ }+ }+ },+ "security": [+ {+ "apiKeyAuth": []+ }+ ],+ "servers": [+ {+ "url": "https://queue.fal.run"+ }+ ]+}diff --git a/tests/fixtures/provider-schemas/index.json b/tests/fixtures/provider-schemas/index.jsonindex 2bb27e6a..0323bacd 100644--- a/tests/fixtures/provider-schemas/index.json+++ b/tests/fixtures/provider-schemas/index.json@@ -23,6 +23,7 @@"minimax/h3-max-turbo/image-to-video","minimax/h3-max-turbo/reference-to-video","minimax/h3-max-turbo/text-to-video",+ "minimax/h3-max/image-to-video","minimax/h3-max/insert-video","minimax/h3-max/lip-sync/image-to-video","minimax/h3-max/relight",@@ -31,6 +32,7 @@"minimax/h3-max/styles/low-poly","minimax/h3-max/styles/retro-toon-70s","minimax/h3-max/styles/vhs",+ "minimax/h3/image-to-video","minimax/music-3","mureka/api/files/upload","mureka/api/song/stem",diff --git a/tests/h3max-tools-fields.test.ts b/tests/h3max-tools-fields.test.tsindex a08a6a7d..d89a264d 100644--- a/tests/h3max-tools-fields.test.ts+++ b/tests/h3max-tools-fields.test.ts@@ -81,6 +81,15 @@ describe("H3 Max relight, insert and looks take no field their schema doesn't naexpect(sent).not.toHaveProperty("tape_speed");});+ it("lip sync sends no enable_transcription of its own, so fal's default (on) applies", () => {+ const route = getModel("minimax-h3-max-lipsync")!.routes[0];+ expect(route.map!.fixed ?? {}).not.toHaveProperty("enable_transcription");+ expect(route.map!.defaults ?? {}).not.toHaveProperty("enable_transcription");+ for (const resolution of [undefined, "480P", "768P", "1080P", "2K"]) {+ expect(body("minimax-h3-max-lipsync", { ...(resolution && { resolution }) }), String(resolution)).not.toHaveProperty("enable_transcription");+ }+ });+it("an open schema (lip sync) still takes any key, as fal ignores it there", () => {expect(getModel("minimax-h3-max-lipsync")!.routes[0].map!.closedFields).toBeUndefined();expect(body("minimax-h3-max-lipsync", { extra: { enable_transcription: false } }).enable_transcription).toBe(false);