Light Mode
Outpaint
POST
/api/v1/taskThis endpoint from PiAPI's Midjourney API extends the canvas of an upscaled image beyond the its original size while retaining the details of the original image. This endpoint corresponds to the Zoom Out
tool from the official 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:
outpaint
input
object
required
origin_task_id
string
required
The task ID of the parent task.
zoom_ratio
string
optional
This parameter controls how much to zoom out on an image
Valid values:
- For Midjourney Discord button "zoom out 1.5x" - use: 1.5
- For Midjourney Discord button "zoom out 2x" - use: 2
- For Midjourney Discord button "custom zoom" - use: (1, 2]
- For Midjourney Discord button "make square" - use: 1
prompt
string
optional
This prompt for this operation.
aspect_ratio
string
optional
This parameter dictating the ouput image's aspect ratio value.
Default:
1:1
skip_prompt_check
boolean
optional
Use this parameter to skip our internal prompt check.
Default:
false
Example
{
"model": "midjourney",
"task_type": "outpaint",
"input": {
"origin_task_id": "741ca8f8-be31-45cd-a33f-c21b8bff8ad8",
"zoom_ratio": "2",
"prompt": "flying night city",
"aspect_ratio": "16:9",
"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": "672eced8-11fc-4dad-830a-688a6bf91435",
"model": "midjourney",
"task_type": "outpaint",
"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