| Crates.io | imagepig |
| lib.rs | imagepig |
| version | 1.0.2 |
| created_at | 2024-11-11 19:20:11.147962+00 |
| updated_at | 2024-11-12 05:04:30.86497+00 |
| description | Package to use Image Pig, the API for AI images |
| homepage | https://imagepig.com |
| repository | https://github.com/double-plus/imagepig-rust |
| max_upload_size | |
| id | 1444122 |
| size | 17,458 |
Rust crate for Image Pig, the API for AI images.
cargo add imagepig
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?;
Something does not work as expected? Feel free to send us a message, we are here for you.