Skip to main content

Enterprise: Outpainting Endpoint

Overview

This endpoint helps to outpaint by expanding the giving image

Outpainting endpoint result
caution

Make sure you add your s3 details for image_editing server, so you can receive image generated in your bucket. Images generated without s3 details being added will be delete after 24hours

Request

--request POST 'https://modelslab.com/api/v1/enterprise/image_editing/outpaint' \

Make a POST request to https://modelslab.com/api/v1/enterprise/image_editing/outpaint endpoint and pass the required parameters as a request body to the endpoint.

Body Attributes

ParameterDescriptionValues
keyYour API Key used for request authorizationkey
promptThe text prompt to guide image generation. Default: "high quality"string (default: "high quality")
negative_promptAspects to avoid in the generated image. Default: "low quality"string (default: "low quality")
imageURL of the initial image to outpaintURL (example: valid image URL)
widthWidth of the output image. Max: 1440. Default: 1280integer (default: 1280, max: 1440)
heightHeight of the output image. Max: 1440. Default: 720integer (default: 720, max: 1440)
overlap_widthWidth of the mask overlap area. Max: 42. Default: 10integer (default: 10, max: 42)
num_inference_stepsNumber of denoising steps. Max: 30. Default: 10integer (default: 10, max: 30)
guidance_scaleHow closely to follow the prompt. Default: 8.0float (default: 8.0)
seedSeed for reproducible results (-1 or 0 for random)integer (default: random)
tempWhether to save output temporarily. Default: trueBoolean (default: true)
base64Whether the image is base64 encoded. Default: falseBoolean (default: false)
webhookSet a URL to get a POST API call once the image generation is completeURL
track_idThis ID is returned in the response to the webhook API call. This will be used to identify the webhook requestIntegral value

Example

Body

Body
{
"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
}

Request

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
"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
});

var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};

fetch("https://modelslab.com/api/v1/enterprise/image_editing/outpaint", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));

Response

Example Response

{
"status": "success",
"generationTime": 5.230603456497192,
"id": 873,
"output": [
"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/generations/47b84646-fd81-4aaf-83fd-a25506b3d8d6.png"
],
"proxy_links": [
"https://cdn2.stablediffusionapi.com/generations/47b84646-fd81-4aaf-83fd-a25506b3d8d6.png"
],
"meta": {
"base64": "no",
"file_prefix": "870b62e7-77a5-46c4-a4c3-0dbf73efbbda",
"guidance_scale": 8,
"height": 512,
"init_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",
"num_inference_steps": 15,
"opacity": 0.7,
"outdir": "out",
"overlap_width": 32,
"padding_down": 10,
"padding_right": 10,
"prompt": "a majestic cat house, lush greenery, filled with plants, high quality, cartoonish, realistic, 4k",
"scale_down": 6,
"seed": 12345,
"temp": "yes",
"watermark": "no",
"width": 512
}
}