doubleplus/imagepig

A composer library for Image Pig, the API for AI images.

1.0.2 2024-10-15 07:07 UTC

This package is not auto-updated.

Last update: 2024-10-15 10:17:32 UTC


README

PHP package for Image Pig, the API for AI images.

Installation

composer require doubleplus/imagepig

Example of usage

use ImagePig\ImagePig;

# create instance of API (put here your actual API key)
$imagepig = ImagePig('your-api-key');

# call the API with a prompt to generate an image
$result = $imagepig->xl('cute piglet running on a green garden');

# save image to a file
$result->save('cute-piglet.jpeg');

# or access image data (binary string)
$result->data;

# or access image as a GDImage object (needs to have the GD extension installed)
$result->image

Contact us

Something does not work as expected? Feel free to send us a message, we are here for you.