Video Face Swap API リファレンス
クリップの全フレームを、同じ顔のまま通す
PopNow の API キー 1 つで、Video Face Swap を自分のコードから呼び出せます。送るモデル ID、受け付ける入力フィールド、1 回あたりのクレジット、ターミナルに貼ってそのまま動くリクエストをこのページにまとめました。
パラメーターの説明はモデルの入力 schema から取っているため、英語のみです。
概要
- 開発元
- PopNow
- 出力
- 動画
- 最安
- 3.9 クレジット 出力 1 秒あたり ($0.039)
- 目安の所要時間
- 約 37 秒
1 クレジット = 0.01 米ドル。タスクの受付時に上限額を確保し、完了時に実際の使用量で精算します(整数クレジットに切り上げ、差額は返却)。失敗したタスクには課金されません。実行前に正確な金額を知りたいときは POST /api/v1/jobs/quote を呼んでください。
人物の入れ替え
popnow/face-swap-video-v1/video-edit
料金
| オプション | クレジット (出力 1 秒あたり) | 米ドル |
|---|---|---|
既定 | 3.9 | $0.039 |
パラメーター
| フィールド | 型 | 既定値 | 指定できる値 | 説明 |
|---|---|---|---|---|
video_url必須 | string | — | — | Target video. The face of the person in this clip is the one that gets replaced. |
reference_image_url必須 | string | — | — | Reference face image. The facial features from this image are carried onto the person in the video. |
face_mapping任意 | array<object> | — | 10 件まで | Multi-person swap: which face in the reference image goes onto which face in the target, one entry per face. Faces are numbered from 0 in detection order. Leave it out to swap a single face. |
face_enhance任意 | boolean | false | — | Run a face-enhancement pass on the swapped face for a sharper, more detailed result. |
style任意 | string | realistic | realistic, beautify, lossless | Finish applied to the swapped face: realistic keeps natural skin tone and texture, beautify smooths and brightens the skin, lossless holds on to the most facial detail. |
リクエスト例
このリクエストはそのまま実行できます。省略したフィールドには既定値が入ります。先にキーを環境変数 POPNOW_API_KEY に設定してください。
例の reference_image_url, video_url には PopNow のサンプル素材を使っています。自分の公開 HTTPS リンク、アップロードしたファイル、保存済みアセットに置き換えてください。
curl -X POST "https://api.popnow.ai/api/v1/jobs/createTask?wait=60" \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "popnow/face-swap-video-v1/video-edit",
"input": {
"video_url": "https://media.popnow.ai/effects/flower-bloom-1abd6efb.mp4",
"reference_image_url": "https://media.popnow.ai/influencer/examples/ava.webp"
}
}'レスポンスにはすぐに taskId が入ります。結果は GET /api/v1/jobs/recordInfo で取得するか、callBackUrl を付けて通知を受け取ります。
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
-H "Authorization: Bearer $POPNOW_API_KEY"
