doubleplus/imagepig

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

1.0.8 2024-11-09 07:58 UTC

This package is auto-updated.

Last update: 2024-11-09 07:58:59 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.