PHP code example of runapi-ai / luma
1. Go to this page and download the library: Download runapi-ai/luma library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
runapi-ai / luma example snippets
unApi\Luma\LumaClient;
$client = new LumaClient(); // reads RUNAPI_API_KEY
$task = $client->modifyVideo->create([
'model' => 'luma-modify-video',
'prompt' => 'A precise product render on white marble',
'source_video_url' => 'https://cdn.runapi.ai/public/samples/video.mp4',
]);
$status = $client->modifyVideo->get($task->id);
$result = $client->modifyVideo->run([
'model' => 'luma-modify-video',
'prompt' => 'A serene mountain lake at dawn',
'source_video_url' => 'https://cdn.runapi.ai/public/samples/video.mp4',
]);
echo $result->videos[0]->url . PHP_EOL;