跳转到主要内容
POST
cURL
使用 aleph2 通过文本 Prompt 编辑源视频。该请求会返回一个 任务 id;检索任务详细信息以获取完成的输出。

准备请求

  • 使用您的 CometAPI API 密钥进行身份验证。
  • 将 model 设置为 aleph2,并为最长 30 秒的视频提供 videoUri。
  • 可选:添加 promptText 以描述编辑内容,长度为 1 到 1,000 个 字符。使用关键帧时,也可以省略它。
  • 将示例媒体 URL 替换为可访问的 HTTPS URL。媒体字段 也接受编码大小最高为 5 MB 的 Base64 数据 URI。

添加定时引导图像

若要引导特定时刻,请在 keyframes 中提供一到五个对象。 每个对象包含一个图像 uri 和且仅包含以下一种位置: 关键帧时间戳必须位于其编辑窗口内。如果使用 range, 请在每个关键帧中设置它。否则,请从每个关键帧中省略 range。 不需要引导图像时,请省略 keyframes。空数组或 null 会被视为省略。

选择帧形状和格式

使用 targetAspectRatio 请求扩展为 16:9、4:3、3:2、1:1 2:3, 3:4, 9:16或 21:9。生成前,输入视频和引导图像会被添加黑边以适配此形状。 已弃用的 ratio 字段 是可选的;请使用 targetAspectRatio 控制宽高比。 如果 outputFormat 为 prores,可以将 proresProfile 设置为 422、4444 422 Proxy, 422 LT, 422 HQ或 4444 XQ。默认配置文件为 4444。 4444 和 4444 XQ 中的 Alpha 通道为不透明。请省略 proresProfile 以使用其他输出格式。 如需指定采样种子,请使用 1 到 4294967295。请省略 seed 以使用随机种子;0 会被视为省略。

检索结果

保存返回的 id 并使用 获取 Runway 任务 检索任务状态。 当 status 为 SUCCEEDED 时,从 output 读取结果 URL。如果任务 失败,请在存在时检查 failure 和 failureCode。

授权

Authorization
string
header
必填

Your CometAPI API key.

请求体

application/json

Aleph 2 video-editing request.

model
enum<string>
必填

Model ID for this request.

可用选项:
aleph2
videoUri
必填

Input video to edit, with a maximum duration of 30 seconds. Use an accessible HTTPS URL or a Base64 data URI with an encoded size of up to 5 MB.

Required string length: 13 - 2048
Pattern: ^https://
promptText
string

Optional instruction describing the edit, from 1 to 1,000 characters. Can be omitted when using keyframes.

Required string length: 1 - 1000
keyframes
object[] | null

One to five timed guidance images. Each image uses exactly one of seconds or at. Omit when no guidance images are needed; an empty array or null is treated as omission.

Maximum array length: 5

Guidance image positioned using seconds.

targetAspectRatio
enum<string>

Target aspect ratio for expansion. The input video and keyframes are letterboxed to this shape before generation.

可用选项:
16:9,
4:3,
3:2,
1:1,
2:3,
3:4,
9:16,
21:9
ratio
string
已弃用

Deprecated aspect-ratio field. Use targetAspectRatio instead.

seed
integer

Sampling seed. Omit for a random seed; 0 is treated as omission.

必填范围: 0 <= x <= 4294967295
outputFormat
enum<string>
必填 if proresProfile is set

Output format: mp4 for H.264 MP4, prores for ProRes MOV, png_sequence for a ZIP of PNG frames, or sdr_rec709_10bit for 10-bit Rec.709 HEVC MP4. Omit for mp4.

可用选项:
mp4,
prores,
png_sequence,
sdr_rec709_10bit
proresProfile
enum<string>

ProRes profile. Include only with outputFormat set to prores; omit for 4444. The 4444 and 4444 XQ profiles have an opaque alpha channel.

可用选项:
422,
4444,
422 Proxy,
422 LT,
422 HQ,
4444 XQ
contentModeration
object

Content moderation settings. Omit to use the standard settings.

响应

The task was created. Save its id for task retrieval.

id
string
必填

Task ID for GET /runwayml/v1/tasks/{id}.

status
string

Task state, when returned.

createdAt
string<date-time>

Task submission timestamp, when returned.

output
string<uri>[]

Result URLs, when returned.

failure
string

Failure explanation, when returned.

failureCode
string

Machine-readable failure code, when returned.

estimatedCost
object

Task estimate metadata, when returned.

cost
object

Task cost metadata, when returned.

最后修改于 2026年9月22日