API Reference
Mannequin to Fashion Models

Mannequin to Fashion Models

Action GenerateFromMannequin

Introduction

This interface is used to convert the mannequin into real-life fashion models.

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
Image2ImageImage2ImageParameters related to an extra background reference image when generating.
MannequinForegroundParameters related to the mannequin.
ImageAndMaskList[]Base64A list of reference images and masks 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

Image2Image

Parameter NameTypeDescriptionRequired
ImageIndexIntThe index of an image in ImageAndMaskList or ImageList, starting from 0.
ReferStrengthFloatThe reference strength of this image (0~1). Default value: 0.5

Foreground

Parameter NameTypeSupported InterfaceDescriptionRequired
ImageIndexIntGeneralThe index of a foreground image in ImageAndMaskList or ImageList, starting from 0.
ResizeModeStringGeneralSpecifying the resize mode of the foreground image when the final generating dimension is different. Reference values: JustResize, CropAndResize, ResizeAndFill. Default value: ResizeAndFill
ClothesMaskIndexIntGenerateFromMannequinSpecifying the clothes to be kept on the mannequin. The index of the mask image in ImageAndMaskList or MaskList starts from 0. The mask is a black-and-white image where the white part represents the redrawn area. You can draw masks independently or obtain them through the "Remove Background" or "Content Extraction" APIs.
InvertMaskBoolGenerateFromMannequinInvert the mask, default value: false

InferenceParams

Note: Specific parameters are only valid for a particular model data type (parent) and are not generic.

Parameter NameTypeValid Parent TypeDescriptionDefaultRangeStepRequired
LoraWeightFloatModelThe influence weight when inferencing. Only available with the LoRA model.1-1~20.01
ResolutionIntPreProcessorThe resolution of images generated by the pre-processor.51264~204864
ControlWeightFloatControlModelThe influence weight of a ControlNet model when inferencing.10~20.01
StartingStepFloatControlModelTiming (ratio) of a ControlNet model to start intervening in the inference process.00~10.01
EndingStepFloatControlModelTiming (ratio) of a ControlNet model to stop intervening in the inference process.10~10.01

Request Example

{
    "Action": "GenerateFromMannequin",
    "PublicKey": "ALLak9M4cNdHXKOJAJJ4k8Hh1hZS2EgJF1D0FlPwfl",
    "Signature": "7e61f1f16321a1cdeef1395adc12437eae77005c",
    "request_uuid": "d893b720-15a5-4f60-8c37-c87343079ca5",
    "BatchSize": 2,
    "Image2Image": {
        "ImageIndex": 0,
        "ReferStrength": 0.3,
        "ResizeMode": "ResizeAndFill"
    },
    "ImageAndMaskList": [
        "data:image/jpeg;base64,xxxx",
        "data:image/jpeg;base64,xxxx"
    ],
    "Mannequin": {
        "ImageIndex": 0,
        "ClothesMaskIndex": 1
    },
    "NegativePrompts": [],
    "PositivePrompts": [
        "girl",
        "smile"
    ],
    "TranslatePrompts": true
 
}

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": "GenerateFromMannequin",
	"RetCode": 0,
	"Message": "",
	"request_uuid": "5ae03609-451b-44d7-a351-c72904df881b",
	"TaskUID": "ckt3uqacrh4miq8mr9lgg"
}