Skip to main content
POST
/
image_editing
/
outpaint
Image outpainting
curl --request POST \
  --url https://modelslab.com/api/v6/image_editing/outpaint \
  --header 'Content-Type: application/json' \
  --data '{
  "key": "<string>",
  "prompt": "high quality",
  "negative_prompt": "low quality",
  "image": "<string>",
  "width": 1280,
  "height": 720,
  "overlap_width": 10,
  "num_inference_steps": 10,
  "guidance_scale": 8,
  "seed": 123,
  "temp": true,
  "base64": false,
  "webhook": "<string>",
  "track_id": 123
}'
{
  "status": "success",
  "generationTime": 123,
  "id": 123,
  "output": [
    "<string>"
  ],
  "proxy_links": [
    "<string>"
  ],
  "meta": {}
}

Outpaint

Outpainting endpoint result

Request

Make a POST request to below endpoint and pass the required parameters as a request body to the endpoint.
curl
--request POST 'https://modelslab.com/api/v6/image_editing/outpaint' \

Body

json
{    
       "key": "your_api_key",    
       "seed": 12345,    
       "width": 512,    
       "height": 512,    
       "prompt": "a majestic cat house, lush greenery, filled with plants, high quality, cartoonish, realistic, 4k",    
       "image": "https://i.ibb.co/wp0w7nt/1-d212fe65-f95c-4bbe-b275-99f0dedd901a.png",    
       "negative_prompt": "dull background, text, characters, symbols, unrealistic, repetitive background, boring background, bad, low quality, black background",    
       "overlap_width": 32,    
       "num_inference_steps": 15,    
       "guidance_scale": 8.0,    
       "temp": true,    
       "base64": false,    
       "webhook": null,    
       "track_id": null
}

Body

application/json
key
string
required

Your API Key used for request authorization

image
string<uri>
required

URL of the initial image to outpaint

prompt
string
default:high quality

The text prompt to guide image generation

negative_prompt
string
default:low quality

Aspects to avoid in the generated image

width
integer
default:1280

Width of the output image

Required range: x <= 1440
height
integer
default:720

Height of the output image

Required range: x <= 1440
overlap_width
integer
default:10

Width of the mask overlap area

Required range: x <= 42
num_inference_steps
integer
default:10

Number of denoising steps

Required range: x <= 30
guidance_scale
number
default:8

How closely to follow the prompt

seed
integer

Seed for reproducible results

temp
boolean
default:true

Whether to save output temporarily

base64
boolean
default:false

Whether the image is base64 encoded

webhook
string<uri>

URL to receive POST API call when complete

track_id
integer

ID for webhook identification

Response

200 - application/json

Outpainting response

  • Option 1
  • Option 2
  • Option 3
status
enum<string>
Available options:
success
generationTime
number

Time taken to generate the image in seconds

id
integer

Unique identifier for the generation request

output
string<uri>[]

Array of generated image URLs

Array of proxy image URLs

meta
object

Metadata about the generation process

I