Pan
POST
https://api.genartapi.com/pan
Parameters
NAME | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
taskId | string | true | You can get taskId from previous tasks eg Imagine |
button | string | true | Valid values are Pan Left, Pan Right, Pan Up, Pan Down |
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/imagine?button=Pan%20Left&taskId=WzMxMTkxNDExNjldXzEyMzY1MzE4NzUwMTU4MTkzMjZfMF9mMzU1OTZjYS1hMDZkLTQzNmUtOGM4Yi05MzdhN2M3MmZhNzg=",
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/imagine?button=Pan%20Left&taskId=WzMxMTkxNDExNjldXzEyMzY1MzE4NzUwMTU4MTkzMjZfMF9mMzU1OTZjYS1hMDZkLTQzNmUtOGM4Yi05MzdhN2M3MmZhNzg="
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 --ar 3:2",
"id": "1239434678302146715",
"uri": "https://cdn.discordapp.com/attachments/1235070628952805379/1239434678088368231/bytefishstudios_3119141169_3_girls_and_2_boys_in_Roma_arena_6f4ed2ec-7acb-4ad2-a3a9-2263be3e8741.png?ex=6642e8fe&is=6641977e&hm=9c543a05913cfc7020bee58a7df2ec3a6a94c166018aa26a5b125cbd53861d1c&",
"proxy_url": "https://media.discordapp.net/attachments/1235070628952805379/1239434678088368231/bytefishstudios_3119141169_3_girls_and_2_boys_in_Roma_arena_6f4ed2ec-7acb-4ad2-a3a9-2263be3e8741.png?ex=6642e8fe&is=6641977e&hm=9c543a05913cfc7020bee58a7df2ec3a6a94c166018aa26a5b125cbd53861d1c&",
"flags": 0,
"hash": "6f4ed2ec-7acb-4ad2-a3a9-2263be3e8741",
"progress": "done",
"options": [
{
"type": 2,
"style": 2,
"label": "U1",
"custom": "MJ::JOB::upsample::1::6f4ed2ec-7acb-4ad2-a3a9-2263be3e8741"
},
{
"type": 2,
"style": 2,
"label": "U2",
"custom": "MJ::JOB::upsample::2::6f4ed2ec-7acb-4ad2-a3a9-2263be3e8741"
},
{
"type": 2,
"style": 2,
"label": "U3",
"custom": "MJ::JOB::upsample::3::6f4ed2ec-7acb-4ad2-a3a9-2263be3e8741"
},
{
"type": 2,
"style": 2,
"label": "U4",
"custom": "MJ::JOB::upsample::4::6f4ed2ec-7acb-4ad2-a3a9-2263be3e8741"
},
{
"type": 2,
"style": 2,
"label": "🔄",
"custom": "MJ::JOB::reroll::0::6f4ed2ec-7acb-4ad2-a3a9-2263be3e8741::SOLO"
},
{
"type": 2,
"style": 2,
"label": "V1",
"custom": "MJ::JOB::variation::1::6f4ed2ec-7acb-4ad2-a3a9-2263be3e8741"
},
{
"type": 2,
"style": 2,
"label": "V2",
"custom": "MJ::JOB::variation::2::6f4ed2ec-7acb-4ad2-a3a9-2263be3e8741"
},
{
"type": 2,
"style": 2,
"label": "V3",
"custom": "MJ::JOB::variation::3::6f4ed2ec-7acb-4ad2-a3a9-2263be3e8741"
},
{
"type": 2,
"style": 2,
"label": "V4",
"custom": "MJ::JOB::variation::4::6f4ed2ec-7acb-4ad2-a3a9-2263be3e8741"
}
],
"width": 2688,
"height": 1792,
"taskId": "WzMxMTkxNDExNjldXzEyMzk0MzQ2NzgzMDIxNDY3MTVfMF82ZjRlZDJlYy03YWNiLTRhZDItYTNhOS0yMjYzYmUzZTg3NDE="
}
three!