Video
Nâng cấp độ phân giải video Runway
Nâng cấp độ phân giải video qua CometAPI bằng Magnific, chọn độ phân giải đầu ra từ 720p đến 4k và các tùy chọn điều chỉnh chi tiết.
POST
/
runwayml
/
v1
/
video_upscale
cURL
curl --request POST \
--url https://api.cometapi.com/runwayml/v1/video_upscale \
--header "Authorization: Bearer $COMETAPI_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "magnific_video_upscaler_creative",
"videoUri": "https://example.com/source-video.mp4",
"resolution": "2k"
}'import os
import requests
response = requests.post(
"https://api.cometapi.com/runwayml/v1/video_upscale",
headers={"Authorization": f"Bearer {os.environ['COMETAPI_KEY']}"},
json={
"model": "magnific_video_upscaler_creative",
"videoUri": "https://example.com/source-video.mp4",
"resolution": "2k"
},
)
response.raise_for_status()
print(response.json())const response = await fetch(
"https://api.cometapi.com/runwayml/v1/video_upscale",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "magnific_video_upscaler_creative",
"videoUri": "https://example.com/source-video.mp4",
"resolution": "2k"
}),
},
);
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_upscale",
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' => 'magnific_video_upscaler_creative',
'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_upscale"
payload := strings.NewReader("{\n \"model\": \"magnific_video_upscaler_creative\",\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_upscale")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"magnific_video_upscaler_creative\",\n \"videoUri\": \"https://example.com/source-video.mp4\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/runwayml/v1/video_upscale")
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\": \"magnific_video_upscaler_creative\",\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>"
}
}Dùng
Bỏ qua một tùy chọn điều khiển dạng số để dùng giá trị mặc định của model. Giá trị
magnific_video_upscaler_creative để nâng cấp độ phân giải video nguồn. Yêu cầu này
trả về id của tác vụ để truy xuất đầu ra đã hoàn tất.
Chuẩn bị yêu cầu
- Xác thực bằng API key CometAPI của bạn.
- Đặt
modelthànhmagnific_video_upscaler_creativevà cung cấpvideoUricho video dài tối đa 30 giây. - Thay URL video ví dụ bằng một URL HTTPS có thể truy cập.
videoUricũng chấp nhận URI dữ liệu video Base64 có kích thước mã hóa tối đa 5 MB. - Chọn
resolution:720p,1k,2khoặc4k. Bỏ qua trường này để dùng2k.
Điều chỉnh tính năng nâng cấp
| Trường | Cách sử dụng |
|---|---|
creativity | Lượng chi tiết được tạo cần thêm, từ 1 đến 100. |
sharpen | Cường độ độ sắc nét, từ 1 đến 100. |
smartGrain | Cường độ cải thiện hạt và kết cấu, từ 1 đến 100. |
flavor | vivid nhấn mạnh màu sắc và chi tiết; natural ưu tiên tái tạo trung thực. |
fpsBoost | Đặt true để yêu cầu tăng tốc độ khung hình đầu ra. |
0 được coi
là không cung cấp, vì vậy không chọn rõ ràng cường độ bằng không. Tương tự,
fpsBoost: false được coi là không cung cấp và không vô hiệu hóa rõ ràng
tính năng cải thiện tốc độ khung hình. Hãy bỏ qua các trường tùy chọn thay vì gửi null.
Truy xuất kết quả
Lưuid được trả về và dùng
Lấy một tác vụ Runway để truy xuất trạng thái tác vụ.
Khi status là SUCCEEDED, hãy đọc các URL kết quả từ output. Nếu tác vụ
thất bại, hãy kiểm tra failure và failureCode nếu có.Nội dung
application/json
Magnific video-upscaling request.
Phản hồi
The task was created. Save its id for task retrieval.
Lần sửa đổi cuối 21 tháng 9, 2026
⌘I
cURL
curl --request POST \
--url https://api.cometapi.com/runwayml/v1/video_upscale \
--header "Authorization: Bearer $COMETAPI_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "magnific_video_upscaler_creative",
"videoUri": "https://example.com/source-video.mp4",
"resolution": "2k"
}'import os
import requests
response = requests.post(
"https://api.cometapi.com/runwayml/v1/video_upscale",
headers={"Authorization": f"Bearer {os.environ['COMETAPI_KEY']}"},
json={
"model": "magnific_video_upscaler_creative",
"videoUri": "https://example.com/source-video.mp4",
"resolution": "2k"
},
)
response.raise_for_status()
print(response.json())const response = await fetch(
"https://api.cometapi.com/runwayml/v1/video_upscale",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "magnific_video_upscaler_creative",
"videoUri": "https://example.com/source-video.mp4",
"resolution": "2k"
}),
},
);
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_upscale",
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' => 'magnific_video_upscaler_creative',
'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_upscale"
payload := strings.NewReader("{\n \"model\": \"magnific_video_upscaler_creative\",\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_upscale")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"magnific_video_upscaler_creative\",\n \"videoUri\": \"https://example.com/source-video.mp4\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/runwayml/v1/video_upscale")
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\": \"magnific_video_upscaler_creative\",\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>"
}
}