Video
Buat performa karakter Runway
Buat tugas performa karakter Runway Act-Two melalui CometAPI menggunakan gambar atau video karakter dan klip performa referensi.
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>"
}
}Gunakan
act_two untuk menerapkan performa video referensi ke gambar karakter
atau video. Permintaan mengembalikan id tugas untuk mengambil output yang selesai.
Siapkan aset
- Autentikasi dengan kunci API CometAPI Anda.
- Atur
modelkeact_two. - Sediakan
character.typesebagaiimageatauvideo, dengan aset dalamcharacter.uri. Pastikan wajah yang dapat dikenali tetap terlihat dan berada di dalam bingkai. - Sediakan
reference.typesebagaivideo, dengan klip performa berdurasi 3 hingga 30 detik dalamreference.uri. - Ganti URL media contoh dengan URL HTTPS yang dapat diakses. Kolom media juga menerima URI data Base64 dengan ukuran terenkode hingga 5 MB.
Konfigurasikan performa
Hanyamodel, character, dan reference yang diperlukan.
| Kolom | Cara menggunakannya |
|---|---|
bodyControl | Atur true untuk meminta gerakan tubuh dan gestur selain ekspresi wajah. Abaikan untuk membiarkan pengaturan tidak ditentukan. |
expressionIntensity | Gunakan 1 hingga 5; nilai yang lebih tinggi meminta ekspresi yang lebih kuat. Abaikan untuk 3. |
seed | Gunakan 1 hingga 4294967295 untuk seed sampling eksplisit. Abaikan untuk seed acak. |
contentModeration.publicFigureThreshold | Gunakan auto untuk deteksi figur publik standar atau low untuk deteksi yang kurang ketat. |
bodyControl: false diperlakukan sebagai pengabaian, sehingga tidak secara eksplisit
menonaktifkan kontrol tubuh. seed atau expressionIntensity bernilai 0 juga
diperlakukan sebagai pengabaian. Abaikan kolom opsional alih-alih mengirim null.
Nilai ratio opsional adalah 1280:720,
720:1280, 960:960, 1104:832, 832:1104, atau 1584:672.
Ambil hasil
Simpanid yang dikembalikan dan gunakan
Dapatkan tugas Runway untuk mengambil status tugas.
Saat status adalah SUCCEEDED, baca URL hasil dari output. Jika tugas
gagal, periksa failure dan failureCode jika ada.Body
application/json
Act-Two character-performance request.
Respons
The task was created. Save its id for task retrieval.
Terakhir diubah pada 21 September 2026
⌘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>"
}
}