Deprecated
API Reference (Legacy)
InPaint

InPaint

Action GenerateCompletion

Introduction

⚠️

This interface is no longer maintained.

This interface will redraw masked pixels by your prompts and reference images.

Request

Parameter NameTypeDescriptionRequired
ActionStringThe corresponding API command name, the current API is GenerateCompletion
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_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
MainModelIdIntMain model ID, if ModelType is combined_model, fill in the Id of SystemPreInstallModels, otherwise fill in the Id of SelfMainModels
SubModelIds[]intSubmodel list, do not fill in if ModelType is combined_model
SubModelParams[]SubModelParamSubmodel parameters. If SubModelIds is used, the weight of the submodel can be controlled through this parameter.
BatchSizeIntBatch image size 1~16
StepsIntIteration steps 1~150
CfgScaleFloatPrompt word guidance level 0~30
SeedIntRandom number seed
SamplerStringSampler,Reference Support Samplers
WidthIntImage generation width, max: 1440,min: 16
HeightIntImage generation height, max: 1440,min: 16
ClipSkipIntClipSkip
TranslatePromptBoolWhether to translate the prompt word into English
PositivePrompts[]StringPositive prompts
NegativePrompts[]StringNegative prompts
ReferenceImageStringReference Source image base64
TransparentImgStringBase64 of black and white mask, the white part is the redrawn part, the TransparentImg must avoid being compressed by third-party tools
CompletionControlWeightFloatweight for Completion
CompletionStrengthenPromptBoolIs prompt words more priority
CompletionSigmaFloatTransparent edge radius
EnableControlNetBoolWhether to enable controlNet
ControlNetParams[]ControlNetParam ControlNet parameters list (max length:3)
UseCustomMainModelVaeBoolUsing main model VAE ,true means use main model VAE,default false

ControlNetParam

Parameter NameTypeDescriptionRequired
ControlNetImgStringControlNet image base64
ControlPreSetIdStringControlNet Default parameter ID, 0: customized, 1: Graffiti and Sketch, 2: Figure's Pose, 3: Anime Line Drawing, 4: Spatial Line Drawing
ControlWeightFloatControlNet weight 0~2
ModelIdIntControlNet model Id
PreProcessorIdIntControlNet preprocessor Id
StartingControlStepFloatControlNet starting intervention step
EndingControlStepFloatControlNet ending intervention step
ControlModeStringControl mode, reference value: Balanced、MyPromptIsMoreImportant、ControlNetIsMoreImportant
ResizeModeStringResize mode, reference value: JustResize、CropAndResize、ResizeAndFill
PreProcessorResolutionIntPreProcessorResolution
Param1ValueFloatParameter 1
Param2ValueFloatParameter 2

Note: If ControlPreSetId is not 0, you only need to fill in the ControlNetImg and ControlWeight parameter. Otherwise, all parameters need to be filled in. Parameter referenceControlNet Model List

SubModelParam

参数名类型描述信息必填
SubModelIdIntSub model Id
ControlWeightFloatSub model control weight(Lora weight)

Request Example

{
	"Action": "GenerateCompletion",
	"PublicKey": "ALLak9M4cNdHXKOJAJJ4k8Hh1hZS2EgJF1D0FlPwfl",
	"request_uuid": "b91fcfbe-bb35-47ce-a168-bd6252c75270",
	"Signature": "743c5804b6ab6e5ac0e4e606d38a222272ad1739",
	"ModelType": "combined_model",
	"MainModelId": 1,
	"BatchSize": 2,
	"Steps": 20,
	"CfgScale": 8,
	"Seed": -1,
	"Sampler": "Euler a",
	"ClipSkip": 1,
	"Width": 1230,
	"Height": 750,
	"PositivePrompts": [],
	"NegativePrompts": [],
	"TranslatePrompt": true,
	"CompletionControlWeight": 1,
	"CompletionStrengthenPrompt": false,
	"CompletionSigma": 10,
	"TransparentImg": "data:image/jpeg;base64,xxx",
	"ReferenceImage": "data:image/jpeg;base64,xxx"
}

Response

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

{
    "Action":"",
    "RetCode":0,
    "Message":"",
    "TaskUID":"cjr997tleg738lelk3n0"
}