P-Video-Replace
Image-to-Video • Pruna AIPruna's P-Video-Replace takes a source video and one or more identity reference images, then places the referenced person or people into the video while preserving the source motion and audio.
| Model Info | |
|---|---|
| More information | link ↗ |
| Pricing | View pricing in the Cloudflare dashboard ↗ |
Usage
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" }}Parameters
booleanrequireddefault: falseDisable safety checker for generated videos.booleanrequireddefault: falseIgnore source audio during generation.arrayrequiredmaxItems: 3minItems: 1Identity reference image(s), 1 to 3, to place into the video. Each entry is an HTTP(S) URL or a data URI.stringrequireddefault: Further instruction on how to place people from the reference images into the scene.stringrequireddefault: 720penum: 720p, 1080pTarget resolution.booleanrequireddefault: trueSave the video with audio.integermaximum: 9007199254740991minimum: -9007199254740991Random seed for reproducible generation.stringrequireddefault: originalenum: 24, 48, originalTarget FPS for the working video.booleanrequireddefault: falseTurbo mode: faster generation for slightly lower quality.stringrequiredSource RGB video (.mp4) used as the motion and audio source. HTTP(S) URL or data URI.stringformat: uriPresigned URL for the replacement video.