kalosm 0.4.0

A simple interface for pretrained AI models
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use futures_util::StreamExt;
use kalosm_vision::{Wuerstchen, WuerstchenInferenceSettings};

#[tokio::main]
async fn main() {
    let model = Wuerstchen::builder().build().await.unwrap();
    let settings = WuerstchenInferenceSettings::new(
        "a cute cat with a hat in a room covered with fur with incredible detail",
    );

    let mut images = model.run(settings);
    while let Some(image) = images.next().await {
        if let Some(buf) = image.generated_image() {
            buf.save(&format!("{}.png", image.sample_num())).unwrap();
        }
    }
}