Wideo
Utwórz zadanie wykonania postaci Runway
Utwórz zadanie wykonania postaci Runway Act-Two za pośrednictwem CometAPI, używając obrazu lub filmu postaci oraz referencyjnego klipu wykonania.
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>"
}
}Użyj
act_two, aby zastosować wykonanie z referencyjnego filmu do obrazu postaci
lub filmu. Żądanie zwraca id zadania, służący do pobrania gotowego wyniku.
Przygotuj zasoby
- Uwierzytelnij się za pomocą klucza API CometAPI.
- Ustaw
modelnaact_two. - Podaj
character.typejakoimagelubvideo, z zasobem wcharacter.uri. Zachowaj rozpoznawalną twarz widoczną i w obrębie kadru. - Podaj
reference.typejakovideo, z klipem wykonania trwającym od 3 do 30 sekund w formaciereference.uri. - Zastąp przykładowe adresy URL mediów dostępnymi adresami URL HTTPS. Pola mediów akceptują także identyfikatory URI danych Base64 o zakodowanym rozmiarze do 5 MB.
Skonfiguruj wykonanie
Wymagane są tylkomodel, character i reference.
| Pole | Sposób użycia |
|---|---|
bodyControl | Ustaw true, aby żądać ruchów ciała i gestów oprócz wyrazu twarzy. Pomiń, aby pozostawić ustawienie nieokreślone. |
expressionIntensity | Użyj wartości od 1 do 5; wyższe wartości powodują silniejszą ekspresję. Pomiń, aby użyć 3. |
seed | Użyj wartości od 1 do 4294967295, aby określić jawny seed próbkowania. Pomiń, aby użyć losowego seed. |
contentModeration.publicFigureThreshold | Użyj auto do standardowego wykrywania osób publicznych lub low do mniej restrykcyjnego wykrywania. |
bodyControl: false jest traktowane jako pominięcie, więc nie powoduje jawnego
wyłączenia sterowania ciałem. Wartość seed lub expressionIntensity równa 0 jest również
traktowana jako pominięcie. Pomijaj pola opcjonalne zamiast wysyłać null.
Opcjonalne wartości ratio to 1280:720
720:1280, 960:960, 1104:832, 832:1104, lub 1584:672.
Pobierz wynik
Zapisz zwróconyid i użyj
Pobierz zadanie Runway aby pobrać status zadania.
Gdy status ma wartość SUCCEEDED, odczytaj adresy URL wyników z output. Jeśli zadanie
zakończy się niepowodzeniem, sprawdź failure i failureCode, jeśli są obecne.Treść
application/json
Act-Two character-performance request.
Odpowiedź
The task was created. Save its id for task retrieval.
Ostatnia modyfikacja 21 września 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>"
}
}