adachsoft / ai-image-xai
AI image explanation library
v0.1.0
2026-03-11 20:18 UTC
Requires
- adachsoft/ai-image-contract: ^0.1
- adachsoft/collection: ^3.0
- guzzlehttp/guzzle: ^7.10
Requires (Dev)
- adachsoft/php-code-style: ^0.4.2
- friendsofphp/php-cs-fixer: ^3.94
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^13.0
- rector/rector: ^2.3
- vlucas/phpdotenv: ^5.6
This package is not auto-updated.
Last update: 2026-03-11 19:20:24 UTC
README
AI Image Generator implementation for X.AI (Grok) API.
Installation
composer require adachsoft/ai-image-xai
Usage
use AdachSoft\AiImageXai\XaiImageGeneratorFactory;
use AdachSoft\AiImageContract\Models\GenerationRequest;
use AdachSoft\AiImageContract\ValueObjects\Prompt;
use AdachSoft\AiImageContract\ValueObjects\ImageSize;
use AdachSoft\AiImageContract\Collections\ImageInputCollection;
$generator = XaiImageGeneratorFactory::create('your-xai-api-key');
$request = new GenerationRequest(
prompt: new Prompt('A cute dog with a lion mane'),
imageInputs: new ImageInputCollection([]),
size: new ImageSize(1024, 1024),
options: ['model' => 'grok-imagine-image']
);
$response = $generator->generate($request);
$imageUrl = $response->images->first()?->url;