leonardoai-php

Leonardo AI SDK for PHP

MIT License

Downloads
6
Stars
0
Committers
1

leonardoai-php

Leonardo AI SDK for PHP

Install

composer require cedricziel/leonardoai-php

Usage

You need an API key from Leonardo

Client creation

$authenticationRegistry = new AuthenticationRegistry([new ApiKeyAuthentication('my-api-key')]);
$client = Client::create(null, [$authenticationRegistry]);

Get current user

$client->getUserSelf();

Image Generation: Create

$body = GenerationsPostBody();
$body->setPrompt('A cat on a tree');
$res = $client->createGeneration($body);

License

MIT