pub trait ImageGenerator {
type Error: Error + Send + Sync + 'static;
// Required methods
fn create(
&self,
prompt: Prompt,
size: Size,
) -> impl Stream<Item = Result<Data, Self::Error>> + Unpin + Send;
fn edit(
&self,
prompt: Prompt,
mask: &[u8],
) -> impl Stream<Item = Result<Data, Self::Error>> + Unpin + Send;
}
Expand description
Trait for generating and editing images from prompts and masks.
Images are returned as a stream where each item represents a complete image with progressively improving quality, allowing for real-time preview during generation.
Required Associated Types§
Required Methods§
Sourcefn create(
&self,
prompt: Prompt,
size: Size,
) -> impl Stream<Item = Result<Data, Self::Error>> + Unpin + Send
fn create( &self, prompt: Prompt, size: Size, ) -> impl Stream<Item = Result<Data, Self::Error>> + Unpin + Send
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.