Imagine
POST
https://api.genartapi.com/imagine
Parameters
NAME | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
prompt | string | true | Instructions to influence the generated image |
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?prompt=humanoid%20android,%20covered%20in%20white%20porcelain%20skin,%20blue%20eyes,%20white%20wispy%20ghost%20wearing%20ornate%20armour%204k%20realistic%20fantasy,%20insane%20details,%20ghost%20phantom%20effect,%20hyper%20detailed,%20photoreal,%20photography,%20cinematic%20lighting,%20hdr,%20hd,%20cinematography,%20realism,%20fine%20art%20digital,%20HD,%20Mark%20Molnar%20mystical,%20redshift%20rendering,%208k%20%E2%80%93v%204&serverId=1235070628952805376&channelId=1235070628952805379&discordToken=MTIzNTA2OTgxNDk5Mzg1MDQzMg.GJta2v.dHekSlsst03CHaZorhA2MjfxWrmLhXePr4JjNI",
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?prompt=humanoid%20android,%20covered%20in%20white%20porcelain%20skin,%20blue%20eyes,%20white%20wispy%20ghost%20wearing%20ornate%20armour%204k%20realistic%20fantasy,%20insane%20details,%20ghost%20phantom%20effect,%20hyper%20detailed,%20photoreal,%20photography,%20cinematic%20lighting,%20hdr,%20hd,%20cinematography,%20realism,%20fine%20art%20digital,%20HD,%20Mark%20Molnar%20mystical,%20redshift%20rendering,%208k%20%E2%80%93v%204&serverId=1235070628952805376&channelId=1235070628952805379&discordToken=MTIzNTA2OTgxNDk5Mzg1MDQzMg.GJta2v.dHekSlsst03CHaZorhA2MjfxWrmLhXePr4JjNI"
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": "[1583952362] humanoid android, covered in white porcelain skin, blue eyes, white wispy ghost wearing ornate armour 4k realistic fantasy, insane details, ghost phantom effect, hyper detailed, photoreal, photography, cinematic lighting, hdr, hd, cinematography, realism, fine art digital, HD, Mark Molnar mystical, redshift rendering, 8k –v 4",
"id": "1237997657503432714",
"uri": "https://cdn.discordapp.com/attachments/1235070628952805379/1237997656962236456/bytefishstudios_1583952362_humanoid_android_covered_in_white_po_64a58d83-974b-4ef8-a418-7b84408a2427.png?ex=663daeaa&is=663c5d2a&hm=c7ac84fe925957221c5768f350f3ce5b2e6f7a1d494b2040dcff55497b4ac6eb&",
"proxy_url": "https://media.discordapp.net/attachments/1235070628952805379/1237997656962236456/bytefishstudios_1583952362_humanoid_android_covered_in_white_po_64a58d83-974b-4ef8-a418-7b84408a2427.png?ex=663daeaa&is=663c5d2a&hm=c7ac84fe925957221c5768f350f3ce5b2e6f7a1d494b2040dcff55497b4ac6eb&",
"flags": 0,
"hash": "64a58d83-974b-4ef8-a418-7b84408a2427",
"progress": "done",
"options": [
{
"type": 2,
"style": 2,
"label": "U1",
"custom": "MJ::JOB::upsample::1::64a58d83-974b-4ef8-a418-7b84408a2427"
},
{
"type": 2,
"style": 2,
"label": "U2",
"custom": "MJ::JOB::upsample::2::64a58d83-974b-4ef8-a418-7b84408a2427"
},
{
"type": 2,
"style": 2,
"label": "U3",
"custom": "MJ::JOB::upsample::3::64a58d83-974b-4ef8-a418-7b84408a2427"
},
{
"type": 2,
"style": 2,
"label": "U4",
"custom": "MJ::JOB::upsample::4::64a58d83-974b-4ef8-a418-7b84408a2427"
},
{
"type": 2,
"style": 2,
"label": "🔄",
"custom": "MJ::JOB::reroll::0::64a58d83-974b-4ef8-a418-7b84408a2427::SOLO"
},
{
"type": 2,
"style": 2,
"label": "V1",
"custom": "MJ::JOB::variation::1::64a58d83-974b-4ef8-a418-7b84408a2427"
},
{
"type": 2,
"style": 2,
"label": "V2",
"custom": "MJ::JOB::variation::2::64a58d83-974b-4ef8-a418-7b84408a2427"
},
{
"type": 2,
"style": 2,
"label": "V3",
"custom": "MJ::JOB::variation::3::64a58d83-974b-4ef8-a418-7b84408a2427"
},
{
"type": 2,
"style": 2,
"label": "V4",
"custom": "MJ::JOB::variation::4::64a58d83-974b-4ef8-a418-7b84408a2427"
}
],
"width": 2048,
"height": 2048,
"taskId": "WzE1ODM5NTIzNjJdXzEyMzc5OTc2NTc1MDM0MzI3MTRfMF82NGE1OGQ4My05NzRiLTRlZjgtYTQxOC03Yjg0NDA4YTI0Mjc="
}
three!