The outpaint endpoint enlarges an image's canvas beyond its original size while keeping the contents of the original image unchanged. Of course you first need to Upscale 1x.
POST https://api.apiframe.pro/outpaint
Headers
Name
Value
Content-Type
application/json
Authorization*
Your APIFRAME API Key
Body
Name
Type
Description
parent_task_id*
string
The task ID of the original task
zoom_ratio*
number
Can be:
1.5 for MJ button "zoom out 1.5x"
2 for MJ button "zoom out 2x"
(1, 2] for MJ button "custom zoom"
1 for MJ button "make square"
aspect_ratio
string
Aspect ratio of the image default value 1:1
prompt
string
Drawing prompt for new areas
webhook_url
string
The final result and updates of this task will be posted at this URL.
webhook_secret
string
Will be passed as x-webhook-secret in the webhook call headers for authentication.
Response
// Success, the task has been submitted
{
"task_id": "29e983ca-7e86-4017-a9e3-ef6fe9cd5f2a"
}
var headers = {
'Content-Type': 'application/json',
'Authorization': 'YOUR_API_KEY'
};
var data = json.encode({
"parent_task_id": "29e983ca-7e86-4017-a9e3-ef6fe9cd5f2a",
"zoom_ratio": "2"
});
var dio = Dio();
var response = await dio.request(
'https://api.apiframe.pro/outpaint',
options: Options(
method: 'POST',
headers: headers,
),
data: data,
);
if (response.statusCode == 200) {
print(json.encode(response.data));
}
else {
print(response.statusMessage);
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.apiframe.pro/outpaint");
request.Headers.Add("Authorization", "YOUR_API_KEY");
var content = new StringContent("{\r\n \"parent_task_id\": \"29e983ca-7e86-4017-a9e3-ef6fe9cd5f2a\",\r\n \"zoom_ratio\": \"2\"\r\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());