Variation
POST
https://api.genartapi.com/vary
Parameters
NAME | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
taskId | string | true | You can get taskId from previous tasks eg Imagine |
button | string | true | Valid values are V1, V2, V3, V4, Vary (Subtle), Vary (Strong) |
Response Code
RESPONSE CODE | DESCRIPTION |
---|---|
200: OK | Successful Response |
400: Bad Request | The request data format is incorrect |
401: Unauthorized | The API key is incorrect or expired |
500: Internal Server Error | Service is experiencing an error |
Request Example:
Make sure you also passed servier_id, channel_id, discord_token and (our) apiKey.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const axios = require("axios")
const config = {
method: "post",
url: "https://api.genartapi.com/vary?button=Vary%20(Region)&taskId=WzMxMTkxNDExNjldXzEyMzc1MzkxNTgwOTI4MTIzNzhfMF8xMTRmMWVhYS1jN2FkLTQyYjgtYmE1Ny1kMTk1ZjNiOTE0OGM=",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer <your-midjourney-api-key>",
"server_id": "<servier_id>",
"channel_id": "<channel_id>",
"discord_token": "<discord_token>",
},
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import requests
url = "https://api.genartapi.com/vary?button=Vary%20(Region)&taskId=WzMxMTkxNDExNjldXzEyMzc1MzkxNTgwOTI4MTIzNzhfMF8xMTRmMWVhYS1jN2FkLTQyYjgtYmE1Ny1kMTk1ZjNiOTE0OGM="
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer <your-midjourney-api-key>",
"server_id": "<servier_id>",
"channel_id": "<channel_id>",
"discord_token": "<discord_token>",
}
response = requests.post(url, headers=headers, json=data)
if response.status_code == 200:
print(response.json())
else:
print(response.text)
three!
Response Example:
you can get generated images by using uri or proxy_url
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
"content": "[3119141169] 3 girls and 2 boys in Roma arena",
"id": "1239436467571261522",
"uri": "https://cdn.discordapp.com/attachments/1235070628952805379/1239436467202293790/bytefishstudios_3119141169_3_girls_and_2_boys_in_Roma_arena_6702bbca-eb18-4b5c-8f52-a02708719d97.png?ex=6642eaa9&is=66419929&hm=09e02e8fe695e9408a224b791028bfb85c5cbf746f4cec6d7f031d404e9b38fc&",
"proxy_url": "https://media.discordapp.net/attachments/1235070628952805379/1239436467202293790/bytefishstudios_3119141169_3_girls_and_2_boys_in_Roma_arena_6702bbca-eb18-4b5c-8f52-a02708719d97.png?ex=6642eaa9&is=66419929&hm=09e02e8fe695e9408a224b791028bfb85c5cbf746f4cec6d7f031d404e9b38fc&",
"flags": 0,
"hash": "6702bbca-eb18-4b5c-8f52-a02708719d97",
"progress": "done",
"options": [
{
"type": 2,
"style": 2,
"label": "U1",
"custom": "MJ::JOB::upsample::1::6702bbca-eb18-4b5c-8f52-a02708719d97"
},
{
"type": 2,
"style": 2,
"label": "U2",
"custom": "MJ::JOB::upsample::2::6702bbca-eb18-4b5c-8f52-a02708719d97"
},
{
"type": 2,
"style": 2,
"label": "U3",
"custom": "MJ::JOB::upsample::3::6702bbca-eb18-4b5c-8f52-a02708719d97"
},
{
"type": 2,
"style": 2,
"label": "U4",
"custom": "MJ::JOB::upsample::4::6702bbca-eb18-4b5c-8f52-a02708719d97"
},
{
"type": 2,
"style": 2,
"label": "🔄",
"custom": "MJ::JOB::reroll::0::6702bbca-eb18-4b5c-8f52-a02708719d97::SOLO"
},
{
"type": 2,
"style": 2,
"label": "V1",
"custom": "MJ::JOB::variation::1::6702bbca-eb18-4b5c-8f52-a02708719d97"
},
{
"type": 2,
"style": 2,
"label": "V2",
"custom": "MJ::JOB::variation::2::6702bbca-eb18-4b5c-8f52-a02708719d97"
},
{
"type": 2,
"style": 2,
"label": "V3",
"custom": "MJ::JOB::variation::3::6702bbca-eb18-4b5c-8f52-a02708719d97"
},
{
"type": 2,
"style": 2,
"label": "V4",
"custom": "MJ::JOB::variation::4::6702bbca-eb18-4b5c-8f52-a02708719d97"
}
],
"width": 2048,
"height": 2048,
"taskId": "WzMxMTkxNDExNjldXzEyMzk0MzY0Njc1NzEyNjE1MjJfMF82NzAyYmJjYS1lYjE4LTRiNWMtOGY1Mi1hMDI3MDg3MTlkOTc="
}
three!