视频
放大 Runway 视频
通过 CometAPI 使用 Magnific 放大视频,可选择从 720p 到 4k 的输出分辨率,并可选地控制细节。
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>"
}
}使用
省略数值控制项可使用模型默认值。值
magnific_video_upscaler_creative 放大源视频。该请求
会返回任务 id,用于获取完成后的输出。
准备请求
- 使用你的 CometAPI API 密钥进行身份验证。
- 将
model设置为magnific_video_upscaler_creative,并提供videoUri用于最长 30 秒的视频。 - 将示例视频 URL 替换为可访问的 HTTPS URL。
videoUri也接受编码大小最大为 5 MB 的 Base64 视频数据 URI。 - 选择
resolution:720p、1k、2k或4k。省略该字段可使用2k。
调整增强效果
| 字段 | 使用方法 |
|---|---|
creativity | 要添加的生成细节量,范围从 1 到 100. |
sharpen | 锐化强度,范围从 1 到 100. |
smartGrain | 颗粒和纹理增强强度,范围从 1 到 100. |
flavor | vivid 会强调色彩和细节;natural 更倾向于忠实还原。 |
fpsBoost | 将 true 设置为请求提高输出帧率。 |
0 会被视为
省略,因此不会明确选择零强度。同样,
fpsBoost: false 会被视为省略,且不会明确禁用
帧率增强。请省略可选字段,而不要发送 null。
获取结果
保存返回的id,并使用
获取 Runway 任务 以获取任务状态。
当 status 为 SUCCEEDED 时,从 output 读取结果 URL。如果任务
失败,请在存在时检查 failure 和 failureCode。请求体
application/json
Magnific video-upscaling request.
响应
The task was created. Save its id for task retrieval.
最后修改于 2026年9月21日
⌘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>"
}
}