Light Mode
Inpaint
POST
/api/v1/taskThis endpoint from PiAPI's Midjourney API alters a part of an upscaled image. This endpoint corresponds with the Vary (Region)
command from the offical Midjourney.
Request
Header Params
X-API-Key
string
required
Insert your API Key here
Body Params application/json
model
enum<string>
required
Allowed value:
midjourney
task_type
enum<string>
required
Allowed value:
inpaint
input
object
required
origin_task_id
string
required
The task ID of the parent task.
prompt
string
optional
This prompt used to regenerate the selected region of the image.
mask
string
required
Base64 encoded mask for the region to be modified. You can generate mask base64 code using this open-source tool--Midjourney inpainting UI.
skip_prompt_check
boolean
optional
Use this parameter to skip our internal prompt check.
Default:
false
Example
{
"model": "midjourney",
"task_type": "inpaint",
"input": {
"origin_task_id": "741ca8f8-be31-45cd-a33f-c21b8bff8ad8",
"prompt": "a jet",
"mask": "",
"skip_prompt_check": false
},
"config": {
"service_mode": "",
"webhook_config": {
"endpoint": "",
"secret": ""
}
}
}
Request samples
Responses
OK(200)
Bad Request(400)
Unauthorized(401)
Server Error(500)
HTTP Code: 200
Content Type : JSONapplication/json
OK - Successful response
Data Schema
object {0}
Example
{
"code": 200,
"data": {
"task_id": "4b7bece8-c1e9-411e-a73d-9e8eca0e99ef",
"model": "midjourney",
"task_type": "inpaint",
"status": "pending",
"config": {
"service_mode": "public",
"webhook_config": {
"endpoint": "",
"secret": ""
}
},
"input": {},
"output": {
"image_url": "",
"image_urls": null,
"temporary_image_urls": null,
"discord_image_url": "",
"actions": [],
"progress": 0,
"intermediate_image_urls": null
},
"meta": {},
"detail": null,
"logs": [],
"error": {
"code": 0,
"raw_message": "",
"message": "",
"detail": null
}
},
"message": "success"
}
Last modified: 11 days ago