- Third-party
RunwayML 的视频编辑模型。编辑一帧即可更新整段视频,可跨多个镜头进行修改,并支持最长 30 秒的视频。支持关键帧引导编辑,可精确控制片段中的特定时刻。
| 模型信息 | |
|---|---|
| 条款和许可证 | 链接 ↗ |
| 更多信息 | 链接 ↗ |
| 定价 | 在 Cloudflare 仪表板中查看定价 ↗ |
用法
const response = await env.AI.run(
'runwayml/aleph-2',
{
prompt: 'Transform the scene into a golden-hour sunset with warm lighting',
video_uri: 'https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/runwayml__gen-4.5/cinematic-scene.mp4',
},
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "runwayml/aleph-2",
"input": {
"prompt": "Transform the scene into a golden-hour sunset with warm lighting",
"video_uri": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/runwayml__gen-4.5/cinematic-scene.mp4"
}
}'{
"state": "Completed",
"result": {
"video": "https://dnznrvs05pmza.cloudfront.net/7449093b-e574-41a5-8308-05e4692fa652.mp4"
},
"gatewayMetadata": {
"keySource": "Unified"
}
}示例
关键帧引导编辑 — 使用锚定到输出首帧的参考图像编辑视频
const response = await env.AI.run(
'runwayml/aleph-2',
{
prompt: 'Edit the video to match the provided reference frame',
video_uri: 'https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/runwayml__gen-4.5/nature-close-up.mp4',
prompt_images: [
{
uri: 'https://upload.wikimedia.org/wikipedia/commons/8/85/Tour_Eiffel_Wikimedia_Commons_(cropped).jpg',
position: 'first',
},
],
},
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "runwayml/aleph-2",
"input": {
"prompt": "Edit the video to match the provided reference frame",
"video_uri": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/runwayml__gen-4.5/nature-close-up.mp4",
"prompt_images": [
{
"uri": "https://upload.wikimedia.org/wikipedia/commons/8/85/Tour_Eiffel_Wikimedia_Commons_(cropped).jpg",
"position": "first"
}
]
}
}'{
"state": "Completed",
"result": {
"video": "https://dnznrvs05pmza.cloudfront.net/cd7388fe-09d6-4b16-afc5-24bb315eaf14.mp4"
},
"gatewayMetadata": {
"keySource": "Unified"
}
}定时关键帧编辑 — 使用 keyframes[].seconds 在输入视频的特定时间戳处放置引导图像
const response = await env.AI.run(
'runwayml/aleph-2',
{
prompt: 'Change the background to a futuristic cityscape at night',
video_uri: 'https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/runwayml__gen-4.5/simple-text-to-video.mp4',
keyframes: [
{
uri: 'https://upload.wikimedia.org/wikipedia/commons/8/85/Tour_Eiffel_Wikimedia_Commons_(cropped).jpg',
seconds: 2.0,
},
],
},
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "runwayml/aleph-2",
"input": {
"prompt": "Change the background to a futuristic cityscape at night",
"video_uri": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/runwayml__gen-4.5/simple-text-to-video.mp4",
"keyframes": [
{
"uri": "https://upload.wikimedia.org/wikipedia/commons/8/85/Tour_Eiffel_Wikimedia_Commons_(cropped).jpg",
"seconds": 2.0
}
]
}
}'{
"state": "Completed",
"result": {
"video": "https://dnznrvs05pmza.cloudfront.net/a7e054fa-1cf2-4265-a35c-518b8c4d6a1a.mp4"
},
"gatewayMetadata": {
"keySource": "Unified"
}
}内容审核覆盖 — 在放宽内容审核的情况下编辑包含公众人物的视频
const response = await env.AI.run(
'runwayml/aleph-2',
{
prompt: 'Make the background a dramatic stormy sky',
video_uri: 'https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/runwayml__gen-4.5/cinematic-scene.mp4',
content_moderation: {
public_figure_threshold: 'low',
},
},
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "runwayml/aleph-2",
"input": {
"prompt": "Make the background a dramatic stormy sky",
"video_uri": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/runwayml__gen-4.5/cinematic-scene.mp4",
"content_moderation": {
"public_figure_threshold": "low"
}
}
}'{
"state": "Completed",
"result": {
"video": "https://dnznrvs05pmza.cloudfront.net/ea5b1ccd-3dd6-43c3-86e3-5ed720849e92.mp4"
},
"gatewayMetadata": {
"keySource": "Unified"
}
}参数
prompt
stringrequiredminLength: 1maxLength: 1000描述要应用于输入视频的编辑的文本提示词video_uri
stringrequired要编辑的源视频的 HTTPS URL、Runway URI 或 data URI(≤30 秒)▶keyframes[]
arrayminItems: 1maxItems: 5放置在输入视频特定位置的定时引导图像。每一项包含一个 uri,以及 seconds(绝对时间戳)或 at(相对位置比例)之一。最多 5 项。▶prompt_images[]
arrayminItems: 1maxItems: 5用于在输出视频特定位置引导编辑的图像关键帧。最多 5 项。seed
integerminimum: 0maximum: 4294967295用于结果可复现的随机种子▶content_moderation{}
object影响内容审核系统行为的设置duration
numberexclusiveMinimum: 0源视频的时长(秒)。仅用于计费——不会发送给 RunwayML。请提供此值,以便网关准确计算按秒计费的视频费用。video
stringformat: uri编辑后视频的 URL