v1/jobs
POSThttps://{endpoint}/v1/jobs
create diffusion job
Request
- application/json
Body
required
requestId stringrequired
ensure request idempotence, should be unique
stages object[]required
notifyUrl string
Responses
- 200
- 400
- default
OK
- application/json
- Schema
- Example (from schema)
Schema
job object
{
"job": {
"id": "string",
"status": "DEFAULT",
"credits": 0,
"waitingInfo": {
"queueRank": "string",
"queueLen": "string"
},
"failedInfo": {
"reason": "string",
"code": "DEFAULT"
},
"runningInfo": {
"processingImages": [
{
"resourceImage": {
"id": "string",
"url": "string",
"expiredIn": "string",
"meta": {
"image": {
"format": "string",
"width": 0,
"height": 0
}
}
},
"progress": 0
}
],
"workflowFinishItem": {
"status": "DEFAULT",
"progress": 0,
"step": 0,
"id": "string",
"ctime": "string",
"mtime": "string",
"nodes": {},
"finishedNodes": {}
}
},
"successInfo": {
"images": [
{
"id": "string",
"url": "string",
"expiredIn": "string",
"meta": {
"image": {
"format": "string",
"width": 0,
"height": 0
}
}
}
],
"videos": [
{
"id": "string",
"url": "string",
"expiredIn": "string",
"meta": {
"image": {
"format": "string",
"width": 0,
"height": 0
}
}
}
],
"workflowFinishItem": {
"status": "DEFAULT",
"progress": 0,
"step": 0,
"id": "string",
"ctime": "string",
"mtime": "string",
"nodes": {},
"finishedNodes": {}
}
}
}
}
Bad Request: general error for invalid parameters More specific errors:
- invalid_samples: Sample count may only be greater then 1
- invalid_height_or_width: Height and width must be specified in increments of 64
- application/json
- Schema
Schema
- any
Default
- application/json
- Schema
- Example (from schema)
Schema
code int32
message string
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L -g -X POST 'https://{endpoint}/v1/jobs' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--data-raw '{
"requestId": "string",
"stages": [
{
"type": "DEFAULT",
"inputInitialize": {
"seed": "0",
"imageResourceId": "string",
"count": "1"
},
"diffusion": {
"width": "512",
"height": "512",
"prompts": {},
"negativePrompts": {},
"sdModel": {},
"sdVae": {},
"sampler": "string",
"steps": "0",
"cfgScale": 0,
"clipSkip": 0,
"denoisingStrength": 0,
"etaNoiseSeedDelta": 0,
"controlnet": {
"args": [
{
"inputImageResourceId": "string",
"maskResourceId": "string",
"preprocessor": {},
"model": {},
"weight": 0,
"resizeMode": "DEFAULT",
"guidance": 0,
"guidanceStart": 0,
"guidanceEnd": 0,
"controlMode": "DEFAULT",
"pixelPerfect": true,
"preprocessorParams": {}
}
]
},
"lora": {
"items": [
{
"loraModel": {},
"weight": 0,
"blockWeight": "string",
"loraAccessKey": "string"
}
]
},
"animateDiff": {
"args": [
{
"videoLength": 0,
"fps": 0
}
]
},
"embedding": {
"items": [
{
"model": {},
"weight": 0,
"embeddingAccessKey": "string"
}
]
},
"v1Clip": true,
"modelAccessKey": "string",
"scheduleName": "string",
"enableElla": true,
"enablePix2pix": true,
"useHunyuanDit": true,
"layerDiffusion": {
"enable": true,
"weight": 0
},
"clipEncoderName": "string"
},
"imageToUpscaler": {
"hrUpscaler": {},
"hrResizeX": 0,
"hrResizeY": 0,
"hrScale": {},
"hrSecondPassSteps": {},
"denoisingStrength": {},
"diffusion": {}
},
"imageToAdetailer": {
"args": [
{
"adModel": "string",
"adPrompt": [
{
"text": "string",
"weight": 0
}
],
"adNegativePrompt": [
{
"text": "string",
"weight": 0
}
],
"adConfidence": 0,
"adDilateErode": "4",
"adMaskMergeInvert": "None",
"adDenoisingStrength": 0,
"adInpaintOnlyMasked": "true",
"adInpaintOnlyMaskedPadding": 0,
"adUseInpaintWidthHeight": "false",
"adInpaintWidth": "512",
"adInpaintHeight": "512",
"adUseSteps": "false",
"adSteps": "20",
"adUseCfgScale": "false",
"adCfgScale": 0,
"lora": {
"items": [
{
"loraModel": {},
"weight": 0,
"blockWeight": "string",
"loraAccessKey": "string"
}
]
},
"adUseCheckpoint": true,
"adCheckpoint": "string",
"adUseSampler": true,
"adUseNoiseMultiplier": true,
"adNoiseMultiplier": 0,
"adUseClipSkip": true,
"adClipSkip": 0,
"adSampler": "string"
}
],
"diffusion": {
"width": "512",
"height": "512",
"prompts": {},
"negativePrompts": {},
"sdModel": {},
"sdVae": {},
"sampler": "string",
"steps": "0",
"cfgScale": 0,
"clipSkip": 0,
"denoisingStrength": 0,
"etaNoiseSeedDelta": 0,
"controlnet": {
"args": [
{
"inputImageResourceId": "string",
"maskResourceId": "string",
"preprocessor": {},
"model": {},
"weight": 0,
"resizeMode": "DEFAULT",
"guidance": 0,
"guidanceStart": 0,
"guidanceEnd": 0,
"controlMode": "DEFAULT",
"pixelPerfect": true,
"preprocessorParams": {}
}
]
},
"lora": {
"items": [
{
"loraModel": {},
"weight": 0,
"blockWeight": "string",
"loraAccessKey": "string"
}
]
},
"animateDiff": {
"args": [
{
"videoLength": 0,
"fps": 0
}
]
},
"embedding": {
"items": [
{
"model": {},
"weight": 0,
"embeddingAccessKey": "string"
}
]
},
"v1Clip": true,
"modelAccessKey": "string",
"scheduleName": "string",
"enableElla": true,
"enablePix2pix": true,
"useHunyuanDit": true,
"layerDiffusion": {
"enable": true,
"weight": 0
},
"clipEncoderName": "string"
}
},
"imageToInpaint": {
"resizeMode": "DEFAULT",
"maskImageResourceId": "string",
"maskBlur": 0,
"inpaintingFill": "DEFAULT",
"inpaintFullRes": true,
"inpaintFullResPadding": 0,
"inpaintMaskInvert": 0,
"diffusion": {
"width": "512",
"height": "512",
"prompts": {},
"negativePrompts": {},
"sdModel": {},
"sdVae": {},
"sampler": "string",
"steps": "0",
"cfgScale": 0,
"clipSkip": 0,
"denoisingStrength": 0,
"etaNoiseSeedDelta": 0,
"controlnet": {
"args": [
{
"inputImageResourceId": "string",
"maskResourceId": "string",
"preprocessor": {},
"model": {},
"weight": 0,
"resizeMode": "DEFAULT",
"guidance": 0,
"guidanceStart": 0,
"guidanceEnd": 0,
"controlMode": "DEFAULT",
"pixelPerfect": true,
"preprocessorParams": {}
}
]
},
"lora": {
"items": [
{
"loraModel": {},
"weight": 0,
"blockWeight": "string",
"loraAccessKey": "string"
}
]
},
"animateDiff": {
"args": [
{
"videoLength": 0,
"fps": 0
}
]
},
"embedding": {
"items": [
{
"model": {},
"weight": 0,
"embeddingAccessKey": "string"
}
]
},
"v1Clip": true,
"modelAccessKey": "string",
"scheduleName": "string",
"enableElla": true,
"enablePix2pix": true,
"useHunyuanDit": true,
"layerDiffusion": {
"enable": true,
"weight": 0
},
"clipEncoderName": "string"
}
}
}
],
"notifyUrl": "string"
}'
ResponseClear