Skip to content

Commit 44900ab

Browse files
committed
feat: add snippets for runway
1 parent a10e47e commit 44900ab

6 files changed

Lines changed: 106 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/runway",
4+
"payload": {
5+
"baseUrl": "https://api.aimlapi.com/v2",
6+
"apiKey": "<YOUR_API_KEY>"
7+
}
8+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const main = async () => {
2+
const response = await fetch('{{baseUrl}}/generate/video/runway/generation', {
3+
method: 'POST',
4+
headers: {
5+
Authorization: 'Bearer {{apiKey}}',
6+
'Content-Type': 'application/json',
7+
},
8+
body: JSON.stringify({
9+
model: '{{model}}',
10+
character: {
11+
type: 'image',
12+
url: 'https://fs.tonkosti.ru/33/ol/33olc2eyzj6s4w8ksg8kkc0gg.jpg',
13+
},
14+
reference: {
15+
type: 'video',
16+
url: 'https://www.shutterstock.com/shutterstock/videos/1068048734/preview/stock-footage-cheerful-businessman-talking-on-the-phone-on-a-green-screen-chroma-key.webm',
17+
}
18+
}),
19+
}).then((res) => res.json());
20+
21+
console.log('Generation:', response);
22+
};
23+
24+
main()
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import requests
2+
3+
4+
def main():
5+
url = "{{baseUrl}}/generate/video/runway/generation"
6+
payload = {
7+
"model": "{{model}}",
8+
"character": {
9+
"type": "image",
10+
"url": "https://fs.tonkosti.ru/33/ol/33olc2eyzj6s4w8ksg8kkc0gg.jpg",
11+
},
12+
"reference": {
13+
"type": "video",
14+
"url": "https://www.shutterstock.com/shutterstock/videos/1068048734/preview/stock-footage-cheerful-businessman-talking-on-the-phone-on-a-green-screen-chroma-key.webm",
15+
}
16+
}
17+
headers = {"Authorization": "Bearer {{apiKey}}", "Content-Type": "application/json"}
18+
19+
response = requests.post(url, json=payload, headers=headers)
20+
print("Generation:", response.json())
21+
22+
if __name__ == "__main__":
23+
main()
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/runway",
4+
"payload": {
5+
"baseUrl": "https://api.aimlapi.com/v2",
6+
"apiKey": "<YOUR_API_KEY>"
7+
}
8+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const main = async () => {
2+
const response = await fetch('{{baseUrl}}/generate/video/runway/generation', {
3+
method: 'POST',
4+
headers: {
5+
Authorization: 'Bearer {{apiKey}}',
6+
'Content-Type': 'application/json',
7+
},
8+
body: JSON.stringify({
9+
model: '{{model}}',
10+
prompt: 'Replace the pink background color with the color of the image',
11+
video_url : 'https://cdn.pixabay.com/video/2019/09/04/26566-358041233_large.mp4',
12+
references: [{
13+
type: 'image',
14+
url: 'https://thumbs.dreamstime.com/b/yellow-square-background-shape-blank-high-quality-photo-214458702.jpg'
15+
}]
16+
}),
17+
}).then((res) => res.json());
18+
19+
console.log('Generation:', response);
20+
};
21+
22+
main()
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import requests
2+
3+
4+
def main():
5+
url = "{{baseUrl}}/generate/video/runway/generation"
6+
payload = {
7+
"model": "{{model}}",
8+
"prompt": "Replace the pink background color with the color of the image",
9+
"video_url" : f"https://cdn.pixabay.com/video/2019/09/04/26566-358041233_large.mp4",
10+
"references": [{
11+
"type": "image",
12+
"url": "https://thumbs.dreamstime.com/b/yellow-square-background-shape-blank-high-quality-photo-214458702.jpg"
13+
}]
14+
}
15+
headers = {"Authorization": "Bearer {{apiKey}}", "Content-Type": "application/json"}
16+
17+
response = requests.post(url, json=payload, headers=headers)
18+
print("Generation:", response.json())
19+
20+
if __name__ == "__main__":
21+
main()

0 commit comments

Comments
 (0)