Videolar
Bir Runway video-to-video görevi oluşturma
Bir metin Prompt’u, zamanlamalı yönlendirme görselleri ve isteğe bağlı hedef en-boy oranı kullanarak CometAPI aracılığıyla Runway Aleph 2 ile bir videoyu düzenleyin.
POST
/
runwayml
/
v1
/
video_to_video
cURL
curl --request POST \
--url https://api.cometapi.com/runwayml/v1/video_to_video \
--header "Authorization: Bearer $COMETAPI_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "aleph2",
"videoUri": "https://example.com/source-video.mp4",
"promptText": "Turn the daytime scene into a snowy winter evening."
}'import os
import requests
response = requests.post(
"https://api.cometapi.com/runwayml/v1/video_to_video",
headers={"Authorization": f"Bearer {os.environ['COMETAPI_KEY']}"},
json={
"model": "aleph2",
"videoUri": "https://example.com/source-video.mp4",
"promptText": "Turn the daytime scene into a snowy winter evening."
},
)
response.raise_for_status()
print(response.json())const response = await fetch(
"https://api.cometapi.com/runwayml/v1/video_to_video",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "aleph2",
"videoUri": "https://example.com/source-video.mp4",
"promptText": "Turn the daytime scene into a snowy winter evening."
}),
},
);
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.com/runwayml/v1/video_to_video",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'aleph2',
'videoUri' => 'https://example.com/source-video.mp4'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cometapi.com/runwayml/v1/video_to_video"
payload := strings.NewReader("{\n \"model\": \"aleph2\",\n \"videoUri\": \"https://example.com/source-video.mp4\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cometapi.com/runwayml/v1/video_to_video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"aleph2\",\n \"videoUri\": \"https://example.com/source-video.mp4\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/runwayml/v1/video_to_video")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"aleph2\",\n \"videoUri\": \"https://example.com/source-video.mp4\"\n}"
response = http.request(request)
puts response.read_body{
"id": "00000000-0000-4000-8000-000000000000"
}{
"code": "<string>",
"message": "<string>",
"data": "<unknown>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}Bir kaynak videoyu metin Prompt’u ile düzenlemek için
Keyframe zaman damgası, düzenleme penceresinin içinde olmalıdır.
aleph2 kullanın. İstek bir
görev id döndürür; tamamlanmış çıktıyı almak için görev ayrıntılarını getirin.
İsteği hazırlama
- CometAPI API anahtarınızla kimlik doğrulaması yapın.
modeldeğerinialeph2olarak ayarlayın ve en fazla 30 saniyelik bir video içinvideoUrisağlayın.- İsteğe bağlı: Düzenlemeyi açıklamak için 1 ila 1.000 karakter içeren
promptTextekleyin. Keyframe kullanırken bunu atlayabilirsiniz. - Örnek medya URL’sini erişilebilir bir HTTPS URL’siyle değiştirin. Medya alanları ayrıca kodlanmış boyutu en fazla 5 MB olan Base64 veri URI’lerini kabul eder.
Zamanlamalı yönlendirme görselleri ekleme
Belirli anlara yön vermek içinkeyframes içinde bir ila beş nesne sağlayın.
Her nesne bir görsel uri ve tam olarak bir konum içerir:
| Alan | Anlamı |
|---|---|
seconds | Video başlangıcından itibaren 0 ile 30 saniye arasındaki zaman damgası. |
at | Video süresinin 0 ile 1. |
range.start_seconds | İsteğe bağlı bir düzenleme penceresinin tam saniye cinsinden dahil olan başlangıcı. |
range.end_seconds | Bu pencerenin tam saniye cinsinden hariç tutulan sonu; başlangıcını aşmalıdır. |
range kullanıyorsanız,
bunu her keyframe’de ayarlayın. Aksi takdirde, range öğesini her keyframe’den çıkarın.
Yönlendirme görsellerine ihtiyacınız olmadığında keyframes öğesini atlayın. Boş bir dizi veya
null atlama olarak değerlendirilir.
Kare şeklini ve biçimini seçme
targetAspectRatio, 16:9, 4:3, 3:2, 1:1 boyutlarına genişletme istemek için
2:3, 3:4, 9:16, ya da 21:9 için kullanın. Girdi videosu ve yönlendirme görselleri
oluşturma öncesinde bu şekle göre letterbox uygulanır. Kullanımdan kaldırılan ratio alanı
isteğe bağlıdır; en-boy oranı denetimi için targetAspectRatio kullanın.
outputFormat | Çıktı |
|---|---|
mp4 | H.264 MP4; alan atlandığında kullanılır. |
prores | ProRes MOV. |
png_sequence | PNG kareleri içeren ZIP arşivi. |
sdr_rec709_10bit | 10 bit Rec.709 HEVC MP4. |
outputFormat değeri prores ise proresProfile değerini 422, 4444 olarak ayarlayabilirsiniz
422 Proxy, 422 LT, 422 HQ, ya da 4444 XQ. Varsayılan profil 4444 değeridir.
4444 ve 4444 XQ içindeki alfa kanalı opaktır. proresProfile öğesini
diğer çıktı biçimleri için atlayın.
Açık bir örnekleme seed’i için 1 ile 4294967295 arasını kullanın. seed öğesini
rastgele bir seed için atlayın; 0 atlama olarak değerlendirilir.
Sonucu alma
Döndürülenid değerini kaydedin ve
Bir Runway görevi alma görev durumunu almak için kullanın.
status değeri SUCCEEDED olduğunda, sonuç URL’lerini output içinden okuyun. Görev
başarısız olursa, mevcut olduğunda failure ve failureCode öğelerini inceleyin.Gövde
application/json
Aleph 2 video-editing request.
Yanıt
The task was created. Save its id for task retrieval.
Son değiştirilme tarihi 22 Eylül 2026
⌘I
cURL
curl --request POST \
--url https://api.cometapi.com/runwayml/v1/video_to_video \
--header "Authorization: Bearer $COMETAPI_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "aleph2",
"videoUri": "https://example.com/source-video.mp4",
"promptText": "Turn the daytime scene into a snowy winter evening."
}'import os
import requests
response = requests.post(
"https://api.cometapi.com/runwayml/v1/video_to_video",
headers={"Authorization": f"Bearer {os.environ['COMETAPI_KEY']}"},
json={
"model": "aleph2",
"videoUri": "https://example.com/source-video.mp4",
"promptText": "Turn the daytime scene into a snowy winter evening."
},
)
response.raise_for_status()
print(response.json())const response = await fetch(
"https://api.cometapi.com/runwayml/v1/video_to_video",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "aleph2",
"videoUri": "https://example.com/source-video.mp4",
"promptText": "Turn the daytime scene into a snowy winter evening."
}),
},
);
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.com/runwayml/v1/video_to_video",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'aleph2',
'videoUri' => 'https://example.com/source-video.mp4'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cometapi.com/runwayml/v1/video_to_video"
payload := strings.NewReader("{\n \"model\": \"aleph2\",\n \"videoUri\": \"https://example.com/source-video.mp4\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cometapi.com/runwayml/v1/video_to_video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"aleph2\",\n \"videoUri\": \"https://example.com/source-video.mp4\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/runwayml/v1/video_to_video")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"aleph2\",\n \"videoUri\": \"https://example.com/source-video.mp4\"\n}"
response = http.request(request)
puts response.read_body{
"id": "00000000-0000-4000-8000-000000000000"
}{
"code": "<string>",
"message": "<string>",
"data": "<unknown>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}