From db8e75ad60243744c626d05459134c1c2b809403 Mon Sep 17 00:00:00 2001 From: Kratos2k7 Date: Tue, 16 Jun 2026 22:38:48 +0500 Subject: [PATCH] fix: update references from 'seed' to 'inputSrc' in video asset schemas and tests --- schemas/imagetovideoasset.yaml | 2 +- schemas/videoasset.yaml | 24 +++++++++++++++++------- tests/smoke.cjs | 29 ++++++++++++++++++++++------- 3 files changed, 40 insertions(+), 15 deletions(-) diff --git a/schemas/imagetovideoasset.yaml b/schemas/imagetovideoasset.yaml index e6c02b0..6ca510c 100644 --- a/schemas/imagetovideoasset.yaml +++ b/schemas/imagetovideoasset.yaml @@ -2,7 +2,7 @@ ImageToVideoAsset: deprecated: true description: | **Notice: ImageToVideoAsset is deprecated. Use [VideoAsset](#tocs_videoasset) - with `prompt` and `seed` instead.** This type continues to function and is + with `prompt` and `inputSrc` instead.** This type continues to function and is internally rewritten to VideoAsset; no behaviour change for existing integrations. diff --git a/schemas/videoasset.yaml b/schemas/videoasset.yaml index 9eb7c43..84ac542 100644 --- a/schemas/videoasset.yaml +++ b/schemas/videoasset.yaml @@ -1,12 +1,12 @@ VideoAsset: description: | The VideoAsset adds a video to a Clip. The video can be sourced from a URL - (`src`) or generated from a text prompt (`prompt`), optionally seeded from a - starting image (`seed`). Exactly one of `src` or `prompt` must be provided. + (`src`) or generated from a text prompt (`prompt`), optionally from a + starting image (`inputSrc`). Exactly one of `src` or `prompt` must be provided. - **Source URL:** set `src` to the URL of an mp4 (or compatible) video file. - - **Generated:** set `prompt` to describe the motion. Optionally set `seed` to - a starting image URL (image-to-video). Use `model` to choose the generator + - **Generated:** set `prompt` to describe the motion. Optionally set `inputSrc` + to a starting image URL (image-to-video). Use `model` to choose the generator (e.g. `luma-ray-3`, `runpod-itv-mini`). The generated `src` is filled in automatically. type: object @@ -28,17 +28,27 @@ description: >- A text prompt to generate the video from. When set without `src`, the engine generates a video and fills `src` automatically. Optionally pair - with `seed` for image-to-video. Use `model` to choose the generator. + with `inputSrc` for image-to-video. Use `model` to choose the generator. type: string maxLength: 4000 example: Slowly zoom out and orbit left around the object. - seed: + inputSrc: description: >- - Seed image URL for image-to-video generation. The image is used as the + Input image URL for image-to-video generation. The image is used as the starting frame; `prompt` describes the motion. Has no effect unless `prompt` is set. type: string minLength: 1 + example: https://s3-ap-northeast-1.amazonaws.com/my-bucket/input-image.jpg + seed: + deprecated: true + description: >- + **Deprecated — use `inputSrc`.** Legacy alias for the image-to-video + input image URL, accepted and normalised to `inputSrc` on ingest. The + name is misleading — industry-wide `seed` means an integer RNG sampling + seed — and will be removed in a future major version. + type: string + minLength: 1 example: https://s3-ap-northeast-1.amazonaws.com/my-bucket/seed-image.jpg model: description: >- diff --git a/tests/smoke.cjs b/tests/smoke.cjs index de3c923..fc36af3 100644 --- a/tests/smoke.cjs +++ b/tests/smoke.cjs @@ -198,26 +198,35 @@ async function run() { assert.strictEqual(result.model, "flux-schnell"); }); - check("Parse videoAsset with prompt + seed", () => { + check("Parse videoAsset with prompt + inputSrc", () => { const result = zodCjs.videoAssetSchema.parse({ type: "video", prompt: "Slowly zoom out and orbit left around the object", - seed: "https://example.com/seed-image.jpg", + inputSrc: "https://example.com/input-image.jpg", }); assert.strictEqual(result.prompt, "Slowly zoom out and orbit left around the object"); - assert.strictEqual(result.seed, "https://example.com/seed-image.jpg"); + assert.strictEqual(result.inputSrc, "https://example.com/input-image.jpg"); }); - check("Parse videoAsset with prompt + seed + model", () => { + check("Parse videoAsset with prompt + inputSrc + model", () => { const result = zodCjs.videoAssetSchema.parse({ type: "video", prompt: "Camera pans right", - seed: "https://example.com/seed.jpg", + inputSrc: "https://example.com/input.jpg", model: "luma-ray-3", }); assert.strictEqual(result.model, "luma-ray-3"); }); + check("Parse videoAsset with deprecated seed alias (still accepted for back-compat)", () => { + const result = zodCjs.videoAssetSchema.parse({ + type: "video", + prompt: "Camera pans right", + seed: "https://example.com/seed.jpg", + }); + assert.strictEqual(result.seed, "https://example.com/seed.jpg"); + }); + check("Parse audioAsset with prompt + voice", () => { const result = zodCjs.audioAssetSchema.parse({ type: "audio", @@ -280,7 +289,7 @@ async function run() { console.log("\n--- Unified asset: src-or-prompt rule (ADR 0001) ---\n"); // At-least-one: src OR prompt required on image/video/audio. Both allowed. - // Neither → rejected. seed/voice are modifiers and never satisfy the rule. + // Neither → rejected. inputSrc/voice are modifiers and never satisfy the rule. check("image with src only is valid", () => { zodCjs.imageAssetSchema.parse({ type: "image", src: "https://example.com/a.jpg" }); @@ -306,7 +315,13 @@ async function run() { assert.throws(() => zodCjs.videoAssetSchema.parse({ type: "video" })); }); - check("REJECT video with seed but no src and no prompt (seed is a modifier)", () => { + check("REJECT video with inputSrc but no src and no prompt (inputSrc is a modifier)", () => { + assert.throws(() => + zodCjs.videoAssetSchema.parse({ type: "video", inputSrc: "https://example.com/input.jpg" }) + ); + }); + + check("REJECT video with deprecated seed but no src and no prompt (alias is a modifier)", () => { assert.throws(() => zodCjs.videoAssetSchema.parse({ type: "video", seed: "https://example.com/seed.jpg" }) );