#image #api #ai #pig #api-key

imagepig

Package to use Image Pig, the API for AI images

3 stable releases

1.0.2 Nov 12, 2024
1.0.1 Nov 11, 2024

#1595 in Web programming

Download history 304/week @ 2024-11-08 49/week @ 2024-11-15 9/week @ 2024-11-22 16/week @ 2024-12-06

83 downloads per month

MIT license

15KB
343 lines

imagepig

Rust crate for Image Pig, the API for AI images.

Installation

cargo add imagepig

Example of usage

use imagepig::ImagePig;

// create instance of API (put here your actual API key)
let imagepig = ImagePig::new("your-api-key".to_string(), None);

// call the API with a prompt to generate an image
let result = imagepig.xl("cute piglet running on a green garden", None, None).await.unwrap();

// save image to a file
result.save("cute-piglet.jpeg").await?;

// or access image data (Vec[u8])
let data = result.data().await?;

Contact us

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

Dependencies

~7–18MB
~244K SLoC