视频
创建 Runway 角色表演
通过 CometAPI 使用角色图像或视频以及参考表演片段创建 Runway Act-Two 角色表演任务。
POST
/
runwayml
/
v1
/
character_performance
cURL
curl --request POST \
--url https://api.cometapi.com/runwayml/v1/character_performance \
--header "Authorization: Bearer $COMETAPI_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "act_two",
"character": {
"type": "image",
"uri": "https://example.com/character.jpg"
},
"reference": {
"type": "video",
"uri": "https://example.com/performance.mp4"
},
"bodyControl": true,
"expressionIntensity": 3
}'import os
import requests
response = requests.post(
"https://api.cometapi.com/runwayml/v1/character_performance",
headers={"Authorization": f"Bearer {os.environ['COMETAPI_KEY']}"},
json={
"model": "act_two",
"character": {
"type": "image",
"uri": "https://example.com/character.jpg"
},
"reference": {
"type": "video",
"uri": "https://example.com/performance.mp4"
},
"bodyControl": True,
"expressionIntensity": 3
},
)
response.raise_for_status()
print(response.json())const response = await fetch(
"https://api.cometapi.com/runwayml/v1/character_performance",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "act_two",
"character": {
"type": "image",
"uri": "https://example.com/character.jpg"
},
"reference": {
"type": "video",
"uri": "https://example.com/performance.mp4"
},
"bodyControl": true,
"expressionIntensity": 3
}),
},
);
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/character_performance",
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' => 'act_two',
'character' => [
'type' => 'image',
'uri' => 'https://example.com/character.jpg'
],
'reference' => [
'type' => 'video',
'uri' => 'https://example.com/performance.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/character_performance"
payload := strings.NewReader("{\n \"model\": \"act_two\",\n \"character\": {\n \"type\": \"image\",\n \"uri\": \"https://example.com/character.jpg\"\n },\n \"reference\": {\n \"type\": \"video\",\n \"uri\": \"https://example.com/performance.mp4\"\n }\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/character_performance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"act_two\",\n \"character\": {\n \"type\": \"image\",\n \"uri\": \"https://example.com/character.jpg\"\n },\n \"reference\": {\n \"type\": \"video\",\n \"uri\": \"https://example.com/performance.mp4\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/runwayml/v1/character_performance")
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\": \"act_two\",\n \"character\": {\n \"type\": \"image\",\n \"uri\": \"https://example.com/character.jpg\"\n },\n \"reference\": {\n \"type\": \"video\",\n \"uri\": \"https://example.com/performance.mp4\"\n }\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>"
}
}使用
act_two 将参考视频的表演应用到角色图像
或视频。请求会返回用于获取完成输出的任务 id。
准备资源
- 使用您的 CometAPI API 密钥进行身份验证。
- 将
model设置为act_two。 - 将
character.type作为image或video提供,其中资源采用character.uri。确保可识别的面部保持可见且位于画面内。 - 将
reference.type作为video提供,并在reference.uri中提供时长为 3 到 30 秒的表演片段。 - 将示例媒体 URL 替换为可访问的 HTTPS URL。媒体字段 还接受编码后大小最高为 5 MB 的 Base64 数据 URI。
配置表演
仅model、character 和 reference 为必填项。
| 字段 | 使用方法 |
|---|---|
bodyControl | 设置 true,以便除面部表情外还请求身体动作和手势。省略此字段可不指定该设置。 |
expressionIntensity | 使用 1 到 5;值越高,所请求的表情越强烈。省略则使用 3. |
seed | 使用 1 到 4294967295 指定显式采样种子。省略则使用随机种子。 |
contentModeration.publicFigureThreshold | 使用 auto 进行标准公众人物检测,或使用 low 进行限制较少的检测。 |
bodyControl: false 会被视为省略,因此不会明确地
禁用身体控制。seed 或 expressionIntensity 为 0 时也会
被视为省略。请省略可选字段,而不要发送 null。
可选的 ratio 值包括 1280:720、
720:1280, 960:960, 1104:832, 832:1104或 1584:672。
获取结果
保存返回的id 并使用
获取 Runway 任务 以获取任务状态。
当 status 为 SUCCEEDED 时,从 output 读取结果 URL。如果任务
失败,请在存在时检查 failure 和 failureCode。请求体
application/json
Act-Two character-performance 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/character_performance \
--header "Authorization: Bearer $COMETAPI_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "act_two",
"character": {
"type": "image",
"uri": "https://example.com/character.jpg"
},
"reference": {
"type": "video",
"uri": "https://example.com/performance.mp4"
},
"bodyControl": true,
"expressionIntensity": 3
}'import os
import requests
response = requests.post(
"https://api.cometapi.com/runwayml/v1/character_performance",
headers={"Authorization": f"Bearer {os.environ['COMETAPI_KEY']}"},
json={
"model": "act_two",
"character": {
"type": "image",
"uri": "https://example.com/character.jpg"
},
"reference": {
"type": "video",
"uri": "https://example.com/performance.mp4"
},
"bodyControl": True,
"expressionIntensity": 3
},
)
response.raise_for_status()
print(response.json())const response = await fetch(
"https://api.cometapi.com/runwayml/v1/character_performance",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "act_two",
"character": {
"type": "image",
"uri": "https://example.com/character.jpg"
},
"reference": {
"type": "video",
"uri": "https://example.com/performance.mp4"
},
"bodyControl": true,
"expressionIntensity": 3
}),
},
);
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/character_performance",
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' => 'act_two',
'character' => [
'type' => 'image',
'uri' => 'https://example.com/character.jpg'
],
'reference' => [
'type' => 'video',
'uri' => 'https://example.com/performance.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/character_performance"
payload := strings.NewReader("{\n \"model\": \"act_two\",\n \"character\": {\n \"type\": \"image\",\n \"uri\": \"https://example.com/character.jpg\"\n },\n \"reference\": {\n \"type\": \"video\",\n \"uri\": \"https://example.com/performance.mp4\"\n }\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/character_performance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"act_two\",\n \"character\": {\n \"type\": \"image\",\n \"uri\": \"https://example.com/character.jpg\"\n },\n \"reference\": {\n \"type\": \"video\",\n \"uri\": \"https://example.com/performance.mp4\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/runwayml/v1/character_performance")
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\": \"act_two\",\n \"character\": {\n \"type\": \"image\",\n \"uri\": \"https://example.com/character.jpg\"\n },\n \"reference\": {\n \"type\": \"video\",\n \"uri\": \"https://example.com/performance.mp4\"\n }\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>"
}
}