Skip to content

Commit 9582425

Browse files
Merge branch 'main' of https://github.com/aimlapi/api-docs
2 parents 00fcf52 + 61cc28f commit 9582425

11 files changed

Lines changed: 124 additions & 44 deletions

File tree

docs/api-references/image-models/topaz-labs/sharpen-generative.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,5 +115,5 @@ main();
115115

116116
</details>
117117

118-
<table data-full-width="false"><thead><tr><th width="372.73321533203125" valign="top">Blurred Image</th><th valign="top">Deblurred Image</th></tr></thead><tbody><tr><td valign="top"><div><figure><img src="../../../.gitbook/assets/blurred-face.jpeg" alt=""><figcaption></figcaption></figure></div></td><td valign="top"><div><figure><img src="../../../.gitbook/assets/5cff080e-5d24-4fc3-85f5-0e57621ead7d.jpeg" alt=""><figcaption><p>"mode": "Super Focus V2"<br>"strength": 0.6</p></figcaption></figure></div></td></tr></tbody></table>
118+
<table data-full-width="true"><thead><tr><th valign="top">Blurred Image</th><th valign="top">Deblurred Image</th><th></th></tr></thead><tbody><tr><td valign="top"><div><figure><img src="../../../.gitbook/assets/blurred-face.jpeg" alt=""><figcaption></figcaption></figure></div></td><td valign="top"><div><figure><img src="../../../.gitbook/assets/5cff080e-5d24-4fc3-85f5-0e57621ead7d.jpeg" alt=""><figcaption><p>"mode": "Super Focus V2"<br>"strength": 0.6</p></figcaption></figure></div></td><td></td></tr></tbody></table>
119119

docs/api-references/image-models/topaz-labs/sharpen.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ If you don’t have an API key for the AI/ML API yet, feel free to use our [Quic
3030

3131
## Quick Example
3232

33-
Let's sharpen a relatively strongly blurred image using the _Strong_ mode while adjusting the _strength_ parameter.
33+
Let's sharpen a relatively strongly blurred image using the `Strong` mode while adjusting the `strength` parameter.
3434

3535
{% tabs %}
3636
{% tab title="Python" %}
@@ -117,7 +117,7 @@ main();
117117

118118
</details>
119119

120-
<table data-full-width="false"><thead><tr><th width="372.73321533203125" valign="top">Blurred Image</th><th valign="top">Deblurred Image</th></tr></thead><tbody><tr><td valign="top"><div><figure><img src="../../../.gitbook/assets/blurred-landscape.png" alt=""><figcaption></figcaption></figure></div></td><td valign="top"><div><figure><img src="../../../.gitbook/assets/sharpen_strength_0.9.png" alt=""><figcaption><p>"mode": "Strong"<br>"strength": 0.9</p></figcaption></figure></div></td></tr></tbody></table>
120+
<table data-full-width="true"><thead><tr><th valign="top">Blurred Image</th><th valign="top">Deblurred Image</th><th></th></tr></thead><tbody><tr><td valign="top"><div><figure><img src="../../../.gitbook/assets/blurred-landscape.png" alt=""><figcaption></figcaption></figure></div></td><td valign="top"><div><figure><img src="../../../.gitbook/assets/sharpen_strength_0.9.png" alt=""><figcaption><p>"mode": "Strong"<br>"strength": 0.9</p></figcaption></figure></div></td><td></td></tr></tbody></table>
121121

122122
For clarity, we’ve created a split image showing the results of different parameter settings.
123123

docs/api-references/model-database.md

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/api-references/video-models/README.md

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/api-references/video-models/krea/krea-wan-14b-text-to-video.md

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
---
2-
hidden: true
3-
noIndex: true
4-
---
5-
61
# krea-wan-14b/text-to-video
72

83
{% columns %}
@@ -19,7 +14,7 @@ This documentation is valid for the following list of our models:
1914
{% endcolumn %}
2015
{% endcolumns %}
2116

22-
17+
A 14-billion parameter model for text-to-video generation.
2318

2419
## Setup your API Key
2520

@@ -56,16 +51,15 @@ api_key = "<YOUR_AIMLAPI_KEY>"
5651

5752
# Creating and sending a video generation task to the server
5853
def generate_video():
59-
url = "https://api.aimlapi.com/v2/generate/video/pixverse/generation"
54+
url = "https://api.aimlapi.com/v2/video/generations"
6055
headers = {
6156
"Authorization": f"Bearer {api_key}",
6257
}
6358

6459
data = {
6560
"model": "krea/krea-wan-14b/text-to-video",
6661
"prompt": "A menacing evil dragon appears in a distance above the tallest mountain, then rushes toward the camera with its jaws open, revealing massive fangs. We see it's coming.",
67-
"resolution": "1080p",
68-
"duration": 5
62+
"num_frames": 90
6963
}
7064

7165
response = requests.post(url, json=data, headers=headers)
@@ -79,7 +73,7 @@ def generate_video():
7973

8074
# Requesting the result of the task from the server using the generation_id
8175
def get_video(gen_id):
82-
url = "https://api.aimlapi.com/v2/generate/video/pixverse/generation"
76+
url = "https://api.aimlapi.com/v2/video/generations"
8377
params = {
8478
"generation_id": gen_id,
8579
}
@@ -147,7 +141,7 @@ function generateVideo(callback) {
147141
prompt: `
148142
A menacing evil dragon appears in a distance above the tallest mountain, then rushes toward the camera with its jaws open, revealing massive fangs. We see it's coming.
149143
`,
150-
// duration: 5,
144+
num_frames: 90,
151145
});
152146

153147
const url = new URL(`${baseUrl}/video/generations`);
@@ -268,14 +262,22 @@ main();
268262

269263
{% code overflow="wrap" %}
270264
```json5
265+
{'id': '67b69e0c-922f-4eae-9b90-8c4605131d3b:krea/krea-wan-14b/text-to-video', 'status': 'queued', 'meta': {'usage': {'tokens_used': 315000}}}
266+
Generation ID: 67b69e0c-922f-4eae-9b90-8c4605131d3b:krea/krea-wan-14b/text-to-video
267+
Status: queued
268+
Still waiting... Checking again in 10 seconds.
269+
Status: completed
270+
Processing complete:/n {'id': '67b69e0c-922f-4eae-9b90-8c4605131d3b:krea/krea-wan-14b/text-to-video', 'status': 'completed', 'video': {'url': 'https://cdn.aimlapi.com/flamingo/files/b/zebra/GR3ehIPWwREVvJduWH6Pn_R07gifMb.mp4'}}
271271
```
272272
{% endcode %}
273273

274274
</details>
275275

276-
**Processing time**: \~2 min 28 sec.
276+
**Processing time**: 11.6 sec.
277+
278+
**Generated Video** (832x480, without sound):
277279

278-
**Generated Video** (768x512, without sound):
280+
{% embed url="https://drive.google.com/file/d/1lgAtCN0R_QTHStjbU4jFmggeFRd0PK-A/view" %}
279281

280282
## API Schemas
281283

@@ -284,6 +286,10 @@ main();
284286
You can generate a video using this API. In the basic setup, you only need a prompt. \
285287
This endpoint creates and sends a video generation task to the server — and returns a generation ID.
286288

289+
Note that in this model, the video duration is defined by the number of frames, not seconds. You can calculate the duration in seconds based on the frame rate of 16 frames per second.
290+
291+
292+
287293
{% openapi-operation spec="krea-wan-14b-text-to-video" path="/v2/video/generations" method="post" %}
288294
[OpenAPI krea-wan-14b-text-to-video](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/video-models/Krea/krea-wan-14b-text-to-video.json)
289295
{% endopenapi-operation %}

docs/api-references/video-models/krea/krea-wan-14b-video-to-video.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
---
2-
hidden: true
3-
noIndex: true
4-
---
5-
61
# krea-wan-14b/video-to-video
72

83
{% columns %}
@@ -19,7 +14,7 @@ This documentation is valid for the following list of our models:
1914
{% endcolumn %}
2015
{% endcolumns %}
2116

22-
17+
A 14-billion parameter model for video edition.
2318

2419
## Setup your API Key
2520

@@ -56,16 +51,18 @@ api_key = "<YOUR_AIMLAPI_KEY>"
5651

5752
# Creating and sending a video generation task to the server
5853
def generate_video():
59-
url = "https://api.aimlapi.com/v2/generate/video/pixverse/generation"
54+
url = "https://api.aimlapi.com/v2/video/generations"
6055
headers = {
6156
"Authorization": f"Bearer {api_key}",
6257
}
6358

6459
data = {
65-
"model": "krea/krea-wan-14b/text-to-video",
66-
"prompt": "A menacing evil dragon appears in a distance above the tallest mountain, then rushes toward the camera with its jaws open, revealing massive fangs. We see it's coming.",
67-
"resolution": "1080p",
68-
"duration": 5
60+
"model": "krea/krea-wan-14b/video-to-video",
61+
"video_url":"https://zovi0.github.io/public_misc/kling-v2-master-t2v-racoon.mp4",
62+
"prompt":'''
63+
Add a small fairy as a rider on the raccoon’s back. She must have a black-and-golden face and a cloak in the colors of a dark emerald tropical butterfly with bright blue shimmering spots.
64+
''',
65+
"strength": 0.55,
6966
}
7067

7168
response = requests.post(url, json=data, headers=headers)
@@ -79,7 +76,7 @@ def generate_video():
7976

8077
# Requesting the result of the task from the server using the generation_id
8178
def get_video(gen_id):
82-
url = "https://api.aimlapi.com/v2/generate/video/pixverse/generation"
79+
url = "https://api.aimlapi.com/v2/video/generations"
8380
params = {
8481
"generation_id": gen_id,
8582
}
@@ -143,11 +140,12 @@ const { URL } = require("url");
143140
// Creating and sending a video generation task to the server
144141
function generateVideo(callback) {
145142
const data = JSON.stringify({
146-
model: "krea/krea-wan-14b/text-to-video",
143+
model: "krea/krea-wan-14b/video-to-video",
147144
prompt: `
148-
A menacing evil dragon appears in a distance above the tallest mountain, then rushes toward the camera with its jaws open, revealing massive fangs. We see it's coming.
145+
Add a small fairy as a rider on the raccoon’s back. She must have a black-and-golden face and a cloak in the colors of a dark emerald tropical butterfly with bright blue shimmering spots.
149146
`,
150-
// duration: 5,
147+
video_url:'https://zovi0.github.io/public_misc/kling-v2-master-t2v-racoon.mp4',
148+
strength: 0.55
151149
});
152150

153151
const url = new URL(`${baseUrl}/video/generations`);
@@ -268,16 +266,22 @@ main();
268266

269267
{% code overflow="wrap" %}
270268
```json5
269+
{'id': '3637be63-2db8-4ecc-bc0f-00afbdf10a55:krea/krea-wan-14b/video-to-video', 'status': 'queued', 'meta': {'usage': {'tokens_used': 315000}}}
270+
Generation ID: 3637be63-2db8-4ecc-bc0f-00afbdf10a55:krea/krea-wan-14b/video-to-video
271+
Status: generating
272+
Still waiting... Checking again in 10 seconds.
273+
Status: completed
274+
Processing complete:/n {'id': '3637be63-2db8-4ecc-bc0f-00afbdf10a55:krea/krea-wan-14b/video-to-video', 'status': 'completed', 'video': {'url': 'https://cdn.aimlapi.com/flamingo/files/b/panda/W9bYaX0QBdz6mzlOcKVRo_mF899FFI.mp4'}}
271275
```
272276
{% endcode %}
273277

274278
</details>
275279

276-
**Processing time**: \~2 min 28 sec.
277-
278-
**Generated Video** (768x512, without sound):
280+
**Processing time**: 11.4 sec.
279281

282+
**Generated Video** (832x480, without sound):
280283

284+
{% embed url="https://drive.google.com/file/d/1Npu3ROPtLTf2CY07jRwZMCNGunxaBEAU/view?usp=sharing" %}
281285

282286
## API Schemas
283287

packages/openapi/descriptions/audio.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,16 @@ export default {
66
minimax: {
77
desc: `Lyrics with optional formatting. You can use a newline to separate each line of lyrics. You can use two newlines to add a pause between lines. You can use double hash marks (##) at the beginning and end of the lyrics to add accompaniment. Maximum 600 characters.`,
88
},
9+
minimax15: {
10+
desc: `A description of the music, specifying style, mood, and scenario. Length: 10–300 characters.`,
11+
},
912
elevenlabs: {
1013
desc: `A text description that can define the genre, mood, instruments, vocals, tempo, structure, and even lyrics of the track. It can be high-level (“peaceful meditation with voiceover”) or detailed (“solo piano in C minor, 90 BPM, raw and emotional”). Use keywords to control genre, emotional tone, vocals (e.g., a cappella, two singers harmonizing), structure (e.g., “lyrics begin at 15 seconds”), or provide custom lyrics directly in the prompt.`,
1114
},
1215
},
16+
lyrics: {
17+
desc: `Lyrics of the song. Use (\n) to separate lines. You may add structure tags like [Intro], [Verse], [Chorus], [Bridge], [Outro] to enhance the arrangement. Length: 10–3000 characters.`,
18+
},
1319
reference_audio_url: {
1420
desc: `Reference song, should contain music and vocals. Must be a .wav or .mp3 file longer than 15 seconds.`,
1521
},
@@ -67,4 +73,9 @@ export default {
6773
desc: `The length of the song to generate in milliseconds. This parameter may not always be respected by the model, and the actual audio length can differ.`,
6874
},
6975
},
76+
output_format: {
77+
minimax: {
78+
desc: `The output format of the audio. Options: url or hex.`,
79+
},
80+
},
7081
};

packages/openapi/descriptions/video.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@ export default {
1313
desc: `For hug, kiss, and heart_gesture effects, pass an array containing exactly two image URLs. For squish or expansion, only one image URL is required.`,
1414
},
1515
minimax: {
16-
desc: `The model will use the image passed in this parameter as the first frame to generate a video.
17-
Supported formats:
18-
- URL of the image;
19-
- base64 encoding of the image.
20-
Image specifications:
21-
- format must be JPG, JPEG, or PNG;
22-
- aspect ratio should be greater than 2:5 and less than 5:2; the shorter side must exceed 300 pixels;
23-
- file size must not exceed 20MB.`,
16+
desc: `A direct link to an online image or a Base64-encoded local image that will serve as the first frame for the video.
17+
Image specifications:
18+
- format must be JPG, JPEG, or PNG;
19+
- aspect ratio should be greater than 2:5 and less than 5:2;
20+
- the shorter side must exceed 300 pixels;
21+
- file size must not exceed 20MB.`,
2422
},
2523
google: {
2624
desc: `URL of the input image to animate. Should be 720p or higher resolution.`,
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"title": "Generate an audio",
3+
"docs": "https://docs.aimlapi.com/api-references/music-models/minimax/music-15",
4+
"payload": {
5+
"baseUrl": "https://api.aimlapi.com/v2",
6+
"apiKey": "<YOUR_API_KEY>"
7+
}
8+
}

shared/snippets/minimax/15/js.hbs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const main = async () => {
2+
const response = await fetch('{{baseUrl}}/generate/audio', {
3+
method: 'POST',
4+
headers: {
5+
Authorization: 'Bearer {{apiKey}}',
6+
'Content-Type': 'application/json',
7+
},
8+
body: JSON.stringify({
9+
model: '{{model}}',
10+
prompt: 'A calm and soothing instrumental music with gentle piano and soft strings.',
11+
lyrics: `[Verse]\nStreetlights flicker, the night breeze sighs\nShadows stretch as I walk alone\nAn old coat wraps my silent sorrow\nWandering, longing, where should I go\n[Chorus]\nPushing the wooden door, the aroma spreads\nIn a familiar corner, a stranger gazes back\nWarm lights flicker, memories awaken\nIn this small cafe, I find my way\n[Verse]\nRaindrops tap on the windowpane\nA melody plays, soft and low\nThe clink of cups, the murmur of dreams\nIn this haven, I find my home\n[Chorus]\nPushing the wooden door, the aroma spreads\nIn a familiar corner, a stranger gazes back\nWarm lights flicker, memories awaken\nIn this small cafe, I find my way`,
12+
}),
13+
}).then((res) => res.json());
14+
15+
console.log('Generation:', response);
16+
};
17+
18+
main()

0 commit comments

Comments
 (0)