Trait sal_e_api::Txt2ImgApi

source ·
pub trait Txt2ImgApi: Debug + DynClone + Send + Sync + AsAny {
    // Required methods
    fn txt2img<'life0, 'life1, 'async_trait>(
        &'life0 self,
        config: &'life1 dyn GenParams,
    ) -> Pin<Box<dyn Future<Output = Result<Response, Txt2ImgApiError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn gen_params(
        &self,
        user_settings: Option<&dyn GenParams>,
    ) -> Box<dyn GenParams>;
}
Expand description

Trait representing a Txt2Img endpoint.

Required Methods§

source

fn txt2img<'life0, 'life1, 'async_trait>( &'life0 self, config: &'life1 dyn GenParams, ) -> Pin<Box<dyn Future<Output = Result<Response, Txt2ImgApiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Generates an image using text-to-image.

§Arguments
  • config - The configuration to use for the generation.
§Returns

A Result containing a Response on success, or an error if the request failed.

source

fn gen_params( &self, user_settings: Option<&dyn GenParams>, ) -> Box<dyn GenParams>

Returns the default generation parameters for this endpoint.

§Arguments
  • user_settings - The user settings to merge with the defaults.
§Returns

A Box<dyn crate::gen_params::GenParams> containing the generation parameters.

Implementors§