Imagine
This is the starting point for creating your image generations
https://api.thenextleg.io/v2/imagine
Request Body
msg
Your prompt. This can include an image URL as well. You can also include flags such as the --v 5 parameterimg2img Requests
"msg":"<your-image-url> <your-prompt>"
"msg":"https://some_url_that_isnt_cdn.(Redacted Name).com.png Transformational anime"
ref (optional)
You can optionally passref
in your command - which can be used useful when using webhooks You might want to do this to pass some simple metadata through to your webhook.webhookOverride (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.
ignorePrefilter (optional)
You can optionally pass ignorePrefilter
that will ignore the prefilter that we provide.
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
var axios = require('axios');
var data = JSON.stringify({
"msg": "<your-prompt-here>",
"ref": "",
"webhookOverride": "",
"ignorePrefilter": "false"
});
var config = {
method: 'post',
url: 'https://api.thenextleg.io/v2/imagine',
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"
}
400Invalid Prompt
If you are using the banned word prefilter, you will receive a response 400 for any
0
1
2
3
{
"success": false,
"msg": "Invalid phrase: 'bad-word'"
}
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
{
"createdAt": "2023-04-04T13:07:01.927Z",
"buttons": [
"U1",
"U2",
"U3",
"U4",
"🔄",
"V1",
"V2",
"V3",
"V4"
],
"type": "imagine",
"imageUrl": "your-image-url",
"imageUrls": ["U1-image-url", "U2-image-url", "U3-image-url", "U4-image-url"],
"buttonMessageId": "OtfxNzfMIKBPVE1aP4u4",
"originatingMessageId": "your-message-id",
"content": "your-original-prompt",
"ref": "",
"responseAt": "2023-04-04T13:06:01.927Z"
}