Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion schemas/imagetovideoasset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
24 changes: 17 additions & 7 deletions schemas/videoasset.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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: >-
Expand Down
29 changes: 22 additions & 7 deletions tests/smoke.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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" });
Expand All @@ -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" })
);
Expand Down
Loading