Skip to content

Commit 6a59cb5

Browse files
authored
feat: add snippets for image video to video
feat: add snippets for image video to video
2 parents 41d2172 + 0ea72e9 commit 6a59cb5

3 files changed

Lines changed: 46 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"title": "Generate a video",
3+
"docs": "https://docs.aimlapi.com/api-references/video-models",
4+
"payload": {
5+
"baseUrl": "https://api.aimlapi.com/v2",
6+
"apiKey": "<YOUR_API_KEY>"
7+
}
8+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const main = async () => {
2+
const response = await fetch('{{baseUrl}}/video/generations', {
3+
method: 'POST',
4+
headers: {
5+
Authorization: 'Bearer {{apiKey}}',
6+
'Content-Type': 'application/json',
7+
},
8+
body: JSON.stringify({
9+
model: '{{model}}',
10+
prompt: 'An african american woman dancing',
11+
image_url: 'https://cdn.aimlapi.com/flamingo/files/b/0a875302/8NaxQrQxDNHppHtqcchMm.png',
12+
video_url: 'https://cdn.aimlapi.com/flamingo/files/b/0a8752bc/2xrNS217ngQ3wzXqA7LXr_output.mp4'
13+
}),
14+
}).then((res) => res.json());
15+
16+
console.log('Generation:', response);
17+
};
18+
19+
main()
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import requests
2+
3+
4+
def main():
5+
url = "{{baseUrl}}/video/generations"
6+
payload = {
7+
"model": "{{model}}",
8+
"prompt": "An african american woman dancing",
9+
"image_url": "https://cdn.aimlapi.com/flamingo/files/b/0a875302/8NaxQrQxDNHppHtqcchMm.png",
10+
"video_url": "https://cdn.aimlapi.com/flamingo/files/b/0a8752bc/2xrNS217ngQ3wzXqA7LXr_output.mp4"
11+
}
12+
headers = {"Authorization": "Bearer {{apiKey}}", "Content-Type": "application/json"}
13+
14+
response = requests.post(url, json=payload, headers=headers)
15+
print("Generation:", response.json())
16+
17+
18+
if __name__ == "__main__":
19+
main()

0 commit comments

Comments
 (0)