API Reference (Legacy)
Swap Face

Swap Face

Action GenerateSwapFace



This interface is no longer maintained.

This interface is used for Swapping Face


Parameter NameTypeDescriptionRequired
ActionStringThe corresponding API command name, the current API is GenerateSwapFace
PublicKeyStringUser's public key, can be obtained from User Center (opens in a new tab)
SignatureStringUser signature generated based on public key and API command, see Signature
request_uuidStringRequest UUID, randomly generated using UUID generation method
ModelTypeStringModel type, reference value: combined_modelcustom_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
MainModelIdIntMain model ID, if ModelType is combined_model, fill in the Id of SystemPreInstallModels, otherwise fill in the Id of SelfMainModels
StepsIntIteration steps 1~150
ReferenceImageStringReference image base64
FaceImageStringFace image base64
FaceIndexIntIndex of faces in pictures, start with 1
UseCustomMainModelVaeBoolUsing main model VAE ,true means use main model VAE,default false

Request Example



Parameter NameTypeDescriptionRequired
RetCodeIntReturn status code, 0 for successful return, non-zero for failure
ActionStringOperation command name
MessageStringReturn error message, provide detailed description when RetCode is non-zero
TaskUIDStringTask UID, used to query task details and get results

Response Example