A npm library for Image Pig, the API for AI images.
npm i imagepig
const ImagePig = require('imagepig');
void async function() {
// create instance of API (put here your actual API key)
const imagepig = ImagePig('your-api-key');
// call the API with a prompt to generate an image
const result = await imagepig.xl('cute piglet running on a green garden')
// save image to a file
await result.save('cute-piglet.jpeg');
// or access image data (Buffer)
await result.data;
}();
Something does not work as expected? Feel free to send us a message, we are here for you.