<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.melius.com/api/v1/nodes/{nodeId}/runs",
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([
'canvasId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'textPrompt' => '<string>',
'outputDuration' => 1,
'seed' => 1073741823,
'numVariations' => 5,
'generateAudio' => true,
'negativePrompt' => '<string>',
'colors' => [
[
'r' => 127,
'g' => 127,
'b' => 127
]
],
'imageUrls' => [
'<string>'
],
'voiceId' => '<string>',
'customVoiceId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'elevenLabsVoiceSettings' => [
'speed' => 2.125,
'stability' => 0.5,
'similarityBoost' => 0.5,
'style' => 0.5,
'speakerBoost' => true,
'removeBackgroundNoise' => true
],
'loras' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'weight' => 0.75
]
],
'steps' => 25,
'guidanceScale' => 10,
'draftVersionId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'strictSettings' => true,
'endImageUrls' => [
'<string>'
],
'mediaUrls' => [
'imageUrls' => [
'<string>'
],
'endImageUrls' => [
'<string>'
],
'referenceImageUrls' => [
'<string>'
],
'videoUrls' => [
'<string>'
],
'audioUrls' => [
'<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-team-id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}