Crate rwuerstchen

Crate rwuerstchen 

Source
Expand description

§RWuerstchen

RWuerstchen is a rust wrapper for library for Wuerstchen implemented in the Candle ML framework.

RWuerstchen generates images efficiently from text prompts.

§Usage

use futures_util::StreamExt;
use rwuerstchen::*;
#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
    let model = Wuerstchen::builder().build().await?;
    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()))?;
        }
    }
    Ok(())
}

Structs§

ChannelImageStream
A stream of images from a tokio channel.
Image
An image generated by the model
Wuerstchen
A quantized wuerstchen image diffusion model
WuerstchenBuilder
A builder for the Wuerstchen model.
WuerstchenInferenceSettings
Settings for running inference with the Wuerstchen model.

Enums§

ModelLoadingProgress
The progress starting a model