Swap Face
Action
GenerateSwapFace
Introduction
⚠️
This interface is no longer maintained.
This interface is used for Swapping Face
Request
Parameter Name | Type | Description | Required |
---|---|---|---|
Action | String | The corresponding API command name, the current API is GenerateSwapFace | ✓ |
PublicKey | String | User's public key, can be obtained from User Center (opens in a new tab) | ✓ |
Signature | String | User signature generated based on public key and API command, see Signature | ✓ |
request_uuid | String | Request UUID, randomly generated using UUID generation method | |
ModelType | String | Model type, reference value: combined_model 、custom_model . To use the official model provided by PICPIK, you need to fill in combined_model , and to use a self-trained or uploaded model, you need to fill in custom_model | ✓ |
MainModelId | Int | Main model ID, if ModelType is combined_model , fill in the Id of SystemPreInstallModels , otherwise fill in the Id of SelfMainModels | ✓ |
Steps | Int | Iteration steps 1~150 | ✓ |
ReferenceImage | String | Reference image base64 | ✓ |
FaceImage | String | Face image base64 | ✓ |
FaceIndex | Int | Index of faces in pictures, start with 1 | ✓ |
UseCustomMainModelVae | Bool | Using main model VAE ,true means use main model VAE,default false |
Request Example
{
"Action":"GenerateSwapFace",
"PublicKey":"ALLak9M4cNdHXKOJAJJ4k8Hh1hZS2EgJF1D0FlPwfl",
"request_uuid":"b91fcfbe-bb35-47ce-a168-bd6252c75270",
"Signature":"4b0e2666680e03641c1ad2eb3863d2089e67995b",
"ModelType":"combined_model",
"MainModelId":1,
"Steps":20,
"ReferenceImage":"data:image/jpeg;base64,xxx",
"FaceImage":"data:image/jpeg;base64,xxx",
"FaceIndex":1
}
Response
Parameter Name | Type | Description | Required |
---|---|---|---|
RetCode | Int | Return status code, 0 for successful return, non-zero for failure | ✓ |
Action | String | Operation command name | ✓ |
Message | String | Return error message, provide detailed description when RetCode is non-zero | |
TaskUID | String | Task UID, used to query task details and get results | ✓ |
Response Example
{
"Action":"",
"RetCode":0,
"Message":"",
"TaskUID":"cjr997tleg738lelk3n0"
}