- Third-party
Pruna 的 P-Video-Replace 接收一段源视频和一张或多张身份参考图像,然后将所参考的一个或多个人物置入视频中,同时保留源视频的动作和音频。
| 模型信息 | |
|---|---|
| 更多信息 | 链接 ↗ |
| 定价 | 在 Cloudflare 仪表板中查看定价 ↗ |
用法
const response = await env.AI.run(
'pruna/p-video-replace',
{
video: 'https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/360/Big_Buck_Bunny_360_10s_1MB.mp4',
images: ['https://huggingface.co/spaces/yisol/IDM-VTON/resolve/main/example/human/00121_00.jpg'],
resolution: '720p',
target_fps: 'original',
},
)
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": "pruna/p-video-replace",
"input": {
"video": "https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/360/Big_Buck_Bunny_360_10s_1MB.mp4",
"images": [
"https://huggingface.co/spaces/yisol/IDM-VTON/resolve/main/example/human/00121_00.jpg"
],
"resolution": "720p",
"target_fps": "original"
}
}'{
"state": "Completed",
"result": {
"video": "https://examples.aig.cloudflare.com/pruna/p-video-replace/character-swap.mp4"
},
"gatewayMetadata": {
"keySource": "Unified"
}
}参数
video
stringrequired用作动作和音频来源的源 RGB 视频(.mp4)。HTTP(S) URL 或 data URI。▶images[]
arrayrequiredminItems: 1maxItems: 3要置入视频的身份参考图像,1 到 3 张。每一项为 HTTP(S) URL 或 data URI。turbo
booleanrequireddefault: falseTurbo 模式:生成速度更快,质量略低。resolution
stringrequireddefault: 720penum: 720p, 1080p目标分辨率。save_audio
booleanrequireddefault: true保存带音频的视频。ignore_audio
booleanrequireddefault: false生成过程中忽略源音频。target_fps
stringrequireddefault: originalenum: 24, 48, original工作视频的目标帧率(FPS)。instruction_prompt
stringrequireddefault: 关于如何将参考图像中的人物置入场景的进一步指令。seed
integerminimum: -9007199254740991maximum: 9007199254740991用于结果可复现生成的随机种子。disable_safety_checker
booleanrequireddefault: false对生成的视频禁用安全检查器。video
stringformat: uri替换后视频的预签名 URL。