Inpaint (🖌️ Vary (Region))
After a successful upscale (U1, U2, U3, U4). You have the option to use the 🖌️ Vary (Region)
button to redraw a section of your image; also known as Inpainting.
https://api.thenextleg.io/v2/button
https://api.thenextleg.io/v2/button?authToken=<token>&buttonMessageId=<id>&button=<button>&mask=<mask>&prompt=<prompt>
Request Body
buttonMessageId
Use thebuttonMessageId
returned in your webhook URLbutton
Should always be🖌️ Vary (Region)
prompt
Provide an updated prompt for the Inpaint or reuse your original prompt.
mask
Prove a mask for the section of the image you want to inpaint. You can use our tool to draw and generate your mask. The mask is a base64 encoded string.
ref (optional)
You can optionally passref
in your command - which can be used useful when using webhookswebhookOverride (optional)
You can optionally pass webhookOverride
that will route a response to a webhook of your choosing.
Please note that using a webhook is completely optional. You are welcome to use the GET Message endpoint to retrieve responses.
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
var axios = require('axios');
var data = JSON.stringify({
"button": "🖌️ Vary (Region)",
"buttonMessageId": "your-buttonMessageId",
"prompt": "hamsters running on a threadmill",
"mask": "UklGRmQKAABXRUJQVlA4WAoAAAAgAAAA3wEA3wEASUNDUMgBAAAAAAHIAAAAAAQwA..."
"ref": "",
"webhookOverride": ""
});
var config = {
method: 'post',
url: 'https://api.thenextleg.io/v2/button',
headers: {
'Authorization': 'Bearer <your-token>',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
200Success
Your response will return a messageId
. Use the messageId
at the GET Message endpoint to poll for results, or to you can wait for the result to arrive via webhook.
0
1
2
3
4
{
"success": true,
"messageId": "your-message-id",
"createdAt": "2023-04-04T13:07:01.927Z"
}
Get your progress and retrieve a Message using GET
After receiving your messageId
you can use the GET /v2/message/<messageId> in order to retrieve your progress and image.
See the GET /v2/message/<messageId> docs for more information.
Completed Response
The message you receive by using the GET Message endpoint or received via your webhook, will have the following:🚧 Note: You should be aware that content will also return messages from (Redacted Name) including:
ALREADY_REQUESTED_UPSCALE
BOT_TOOK_TOO_LONG_TO_PROCESS_YOUR_COMMAND
APPEAL_ACCEPTED
APPEAL_REJECTED
BANNED_PROMPT
BLOCKED
BUTTON_NOT_FOUND
FAILED_TO_PROCESS_YOUR_COMMAND
FAILED_TO_REQUEST
IMAGE_BLOCKED
INTERNAL_ERROR
INVALID_LINK
INVALID_PARAMETER
JOB_ACTION_RESTRICTED
JOB_QUEUED
MODERATION_OUTAGE
NO_FAST_HOURS
PLEASE_SUBSCRIBE_TO_MJ_IN_YOUR_DASHBOARD
QUEUE_FULL
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
"createdAt": {
"_nanoseconds": 215000000,
"_seconds": 1678840347
},
"buttons": [
"U1",
"U2",
"U3",
"U4",
"🔄",
"V1",
"V2",
"V3",
"V4"
],
"type": "button",
"imageUrl": "your-image-url",
"buttonMessageId": "OtfxNzfMIKBPVE1aP4u4",
"originatingMessageId": "your-message-id",
"content": "your-original-prompt",
"ref": "",
"responseAt": "2023-04-04T13:06:01.927Z"
}
![Wide view, behind the scenes, Ayutthaya large robot workshop, extra large, Fuji film, hyper-realism from 1970s Thai sci-fi movies, steam-powered aerial robot workshop army, maintenance soldiers.](https://media.discordapp.net/attachments/1170827918734262302/1181414460926206094/loukrasta_Wide_view_behind_the_scenes_Ayutthaya_large_robot_wor_c650ec93-0343-4a70-b455-2dbb45c53e65.png?ex=6580f8f5&is=656e83f5&hm=2b9947cdf9ee242dff35cb8b051115064785219bcb411cc32e6bb4e94f721d15&=&format=webp&quality=lossless&width=844&height=844)
![](https://storage.googleapis.com/the-next-leg-public/Screenshot%202023-12-04%20at%207.00.42%E2%80%AFPM.png)
![Wide view, behind the scenes, Ayutthaya large robot workshop, extra large, Fuji film, hyper-realism from 1970s Thai sci-fi movies, steam-powered aerial robot workshop army, maintenance soldiers.](https://media.discordapp.net/attachments/1170827918734262302/1181422462253142097/loukrasta_jet_fighter_planes_84c23f6d-6610-4585-a87d-363676c8bc9b.png?ex=65810068&is=656e8b68&hm=cc1e001fb84f0441a4c9dcb8523914a1ab1e6f5e0de663bee176f85698dbdc94&=&format=webp&quality=lossless&width=844&height=844)