Skip to main content

ImageModel

Trait ImageModel 

Source
pub trait ImageModel:
    Send
    + Sync
    + 'static {
    // Required methods
    fn provider(&self) -> &ProviderId;
    fn model_id(&self) -> &ModelId;
    fn max_images_per_call(&self) -> Option<usize>;
    fn do_generate(
        &self,
        options: ImageOptions,
    ) -> impl Future<Output = Result<ImageResult, ProviderError>> + Send;
}
Expand description

A model that generates images from a prompt.

Required Methods§

Source

fn provider(&self) -> &ProviderId

Provider identifier.

Source

fn model_id(&self) -> &ModelId

Model identifier.

Source

fn max_images_per_call(&self) -> Option<usize>

Maximum number of images per call, or None when unknown (treated as 1).

Source

fn do_generate( &self, options: ImageOptions, ) -> impl Future<Output = Result<ImageResult, ProviderError>> + Send

Generates options.n images.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§