AILabTools Rust SDK
Official Rust SDK for the AILabTools AI Image APIs. It supports background removal, image upscaling, object removal, portrait retouching, hairstyle changes, virtual try-on, skin analysis, and other AI image workflows.
Requirements
- Rust 1.70 or later
- Tokio or another async runtime compatible with
reqwest
Installation
[]
= "0.5.4"
Quick Start
Create an API key in the AILabTools Developer Console.
use ;
use CutoutUniversalBackgroundRemovalParams;
async
File Uploads
from_path?;
from_bytes;
Popular Aliases
| Use case | Rust method |
|---|---|
| Remove image background | client.background.remove(params).await |
| Upscale an image | client.image.upscale(params).await |
| Remove objects | client.image.remove_objects(params).await |
| Change hairstyle | client.portrait.change_hairstyle(params).await |
| Retouch portrait | client.portrait.retouch(params).await |
Async Tasks
let task = client.portrait.change_hairstyle.await?;
let task_id = task.task_id.expect;
let result = client.wait_for_task.await?;
println!;
Error Handling
match client.background.remove.await
crates.io Publishing
Before publishing:
- Log in with
cargo login. - Run
cargo publish --dry-run. - Run
cargo publish.
The crate name is ailabtools.
Links
- Get an AILabTools API key
- AILabTools API documentation
- AILabTools SDK source code
- Report an SDK issue