API Reference
Style Conversion

Style Conversion

Action ApplyReferenceStyle

Introduction

This interface redraws the raw image by referencing the style reference image.

Request

Parameter NameTypeDescriptionRequired
ActionStringThe corresponding API instruction name
PublicKeyStringUser's public key, which can be obtained from the PICPIK User Center (opens in a new tab)
SignatureStringUser's signature generated based on the public key and API instruction, see Signature for details
request_uuidStringRequest UUID, randomly generated by using the UUID generation method. This parameter can be utilized to manage the requests of your business and clients.
Parameter NameTypeDescriptionRequired
MainModelModelMain model for generating images
SubModelList[]ModelThe submodel list for generating images includes LoRA, Embedding, and HyperNetwork.
PositivePrompts[]StringContent description of what you want to appear in the image.
NegativePrompts[]StringContent description of what you do not want to appear in the image.
TranslatePromptsBoolTranslate other languages to English, see support language list here. Default value: true
SeedIntThe number of a seed (-1~2147483647), -1 represents a ramdom seed. Default value: -1
WidthIntImage width (64~2560). Default value: 1024
HeightIntImage height (64~2560). Default value: 1024
BatchSizeIntBatch size for generating images (1~16). Default value: 1
UseMainModelVAEBoolWhether to use the codec that comes with the main model. Default value: false
Parameter NameTypeDescriptionRequired
RawImageIndexIntThe index of the raw image in ImageList, starting from 0.
StyleImageIndexIntThe index of the style refenrence image in ImageList, starting from 0.
StyleReferStrengthFloatThe reference strength of the style refenrence image (0~1). Default value: 0.5
ImageList[]Base64A list of reference images encoded in Base64.

Intro to Complex Data Types

Model

Field NameTypeDescriptionRequired
NameStringModel name
ModelCodeStringModel code
IsOfficialBoolIs official model or not
TriggerWordList[]StringTrigger word list, only available with LoRA model
InferenceParamsInferenceParamsInference parameters

Request Example

{
    "Action": "ApplyReferenceStyle",
    "MainModel": {
      	"ModelCode"  : "PICPIK Interior Design"
    },
    "PositivePrompts": ["a apple"],
    "NegativePrompts": [],
    "TranslatePrompts": true,
    "RawImageIndex": 0,
    "StyleImageIndex": 1,
    "StyleReferStrength": 0.5,
    "Seed": -1,
    "Width": 1024,
    "Height": 1024,
    "BatchSize": 1,
    "UseMainModelVAE": true,
    "ImageList": ["imagebase64","imagebase64"]
}

Response

Field NameTypeDescriptionRequired
RetCodeIntReturn status code: 0 indicates a successful return, while non-zero indicates a failure
ActionStringInstruction name
MessageStringThe error message is returned when RetCode is non-zero, providing a detailed description
request_uuidStringReturns the UUID that was included in the request
Parameter NameTypeDescriptionRequired
TaskUIDStringTask UID, used to query task details and get results

Response Example

{
	"Action": "ApplyReferenceStyle",
	"RetCode": 0,
	"Message": "",
	"request_uuid": "8482d350-04f9-421b-817b-1d98b3a4dcfa",
	"TaskUID": "cktlm6lrh4xxx8ng9nf0"
}