PHP code example of aisdk / black-forest-labs
1. Go to this page and download the library: Download aisdk/black-forest-labs 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/ */
aisdk / black-forest-labs example snippets
use AiSdk\BlackForestLabs;
use AiSdk\Generate;
BlackForestLabs::create(['apiKey' => $_ENV['BFL_API_KEY']]);
$image = Generate::image('A cinematic mountain lake at sunrise')
->model(BlackForestLabs::model('flux-2-pro-preview'))
->size('1440x810')
->run();