PHP code example of sawirricardo / replicate-php

1. Go to this page and download the library: Download sawirricardo/replicate-php 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/ */

    

sawirricardo / replicate-php example snippets


$token = 'sxsaxada';
$client = new Sawirricardo\Replicate\Replicate($token);
$prediction = $client->predictions()->create('sd-v1.4', [
    'prompt' => 'my exciting project',
]);

echo $prediction->json('id');
bash
composer