adachsoft/ai-image-xai

AI image explanation library

Maintainers

Package info

gitlab.com/a.adach/ai-image-xai

Issues

pkg:composer/adachsoft/ai-image-xai

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

v0.1.0 2026-03-11 20:18 UTC

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;