curl -X POST 'https://devapi.pika.art/generate/pikaswaps' \
-H 'X-API-KEY: your_api_key' \
-H 'Accept: multipart/form-data' \
-F 'video=@video.mp4;type=video/mp4' \
-F 'image=@image.jpg;type=image/jpg' \
-F 'modifyRegionMask=@mask.jpg;type=image/jpg' \
-F 'promptText=Replace the background with a beautiful beach' \
-F 'negativePrompt=blurry, low quality' \
-F 'seed=12345'{
"video_id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Endpoints
Pikaswaps
Swap out any object or region of your video with a new image or object. Define areas to replace either with a mask or coordinates.
POST
/
generate
/
pikaswaps
curl -X POST 'https://devapi.pika.art/generate/pikaswaps' \
-H 'X-API-KEY: your_api_key' \
-H 'Accept: multipart/form-data' \
-F 'video=@video.mp4;type=video/mp4' \
-F 'image=@image.jpg;type=image/jpg' \
-F 'modifyRegionMask=@mask.jpg;type=image/jpg' \
-F 'promptText=Replace the background with a beautiful beach' \
-F 'negativePrompt=blurry, low quality' \
-F 'seed=12345'{
"video_id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Body
multipart/form-data
A mask image that specifies the region to modify, where the mask is white and the background is black
Plaintext description of the object / region to modify
Response
Successful Response