API Reference
Switch Face

Switch Face

API SwitchFace


This interface is used for face replacement


Parameter NameTypeDescriptionRequired
ActionstringThe corresponding API command name, the current API is SwitchFace
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
RestoreStrengthfloatRedraw strength (0~1), default value: 0.5
RawImagestringBase64 of the picture that needs to be replaced
NewFaceImagestringBase64 of new face images
RawFaceIndexintWhich face needs to be replaced (1~100), default value: 1
StepsintStep size (6~100), default value: 10

Request Example

	"Action": "SwitchFace",
	"PublicKey": "ALLak9M4cNdHXKOJAJJ4k8Hh1hZS2EgJF1D0FlPwfl",
	"Signature": "e5f881d1b60b8fbcbdfb0621c4f25834f24121dd",
	"request_uuid": "0ec48649-44d1-49ed-80ab-9c905dd7a65b",
	"RawImage": "data:image/jpeg;base64,xxx",
	"NewFaceImage": "data:image/jpeg;base64,bbb",
	"RawFaceIndex": 1,
	"Steps": 10


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
request_uuidstringReturns the requested uuid
TaskUIDstringTask UID, used to query task details and get results

Response Example

	"Action": "RestoreFaces",
	"RetCode": 0,
	"Message": "",
	"request_uuid": "8482d350-04f9-421b-817b-1d98b3a4dcfa",
	"TaskUID": "cktlm6lrh4miq8ng9nf0"