- サードパーティ
Pruna の P-Video-Replace は、ソース動画と 1 枚以上の人物参照画像を受け取り、ソースの動きと音声を保ったまま、参照した人物を動画に配置します。
| モデル情報 | |
|---|---|
| 詳細情報 | リンク ↗ |
| 料金 | 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
string必須動きと音声のソースにする RGB 動画(.mp4)です。HTTP(S) URL または data URI です。▶images[]
array必須minItems: 1maxItems: 3動画に配置するアイデンティティ参照画像です(1〜3 枚)。各要素は HTTP(S) URL または data URI です。turbo
boolean必須デフォルト: falseTurbo モードです。品質は少し下がりますが、生成が速くなります。resolution
string必須デフォルト: 720penum: 720p, 1080p目標の解像度です。save_audio
boolean必須デフォルト: true音声付きで動画を保存します。ignore_audio
boolean必須デフォルト: false生成時にソース音声を無視します。target_fps
string必須デフォルト: originalenum: 24, 48, original作業用動画の目標 FPS です。instruction_prompt
string必須デフォルト: 参照画像の人物をシーンにどう配置するかの追加指示です。seed
integerminimum: -9007199254740991maximum: 9007199254740991生成結果を再現するための乱数シードです。disable_safety_checker
boolean必須デフォルト: false生成動画のセーフティチェッカーを無効にします。video
stringformat: uri差し替え動画の署名付き URL です。