pub struct Client { /* private fields */ }Expand description
Interface to the web UI.
Implementations§
Source§impl Client
impl Client
Sourcepub async fn new(url: &str, authentication: Authentication<'_>) -> Result<Self>
pub async fn new(url: &str, authentication: Authentication<'_>) -> Result<Self>
Creates a new Client and authenticates to the web UI.
Sourcepub fn generate_from_text(
&self,
request: &TextToImageGenerationRequest,
) -> impl Future<Output = Result<GenerationResult>>
pub fn generate_from_text( &self, request: &TextToImageGenerationRequest, ) -> impl Future<Output = Result<GenerationResult>>
Generates an image from the provided request, which contains a prompt.
Sourcepub fn generate_from_image_and_text(
&self,
request: &ImageToImageGenerationRequest,
) -> impl Future<Output = Result<GenerationResult>>
pub fn generate_from_image_and_text( &self, request: &ImageToImageGenerationRequest, ) -> impl Future<Output = Result<GenerationResult>>
Generates an image from the provided request, which contains both an image and a prompt.
Sourcepub async fn progress(&self) -> Result<GenerationProgress>
pub async fn progress(&self) -> Result<GenerationProgress>
Retrieves the progress of the current generation.
Note that: - this does not disambiguate between generations (the WebUI does not expose details on its queue) - this will return 0% if there is no generation underway, which can be confusing after a generation finishes
Sourcepub async fn postprocess(
&self,
image: &DynamicImage,
request: &PostprocessRequest,
) -> Result<DynamicImage>
pub async fn postprocess( &self, image: &DynamicImage, request: &PostprocessRequest, ) -> Result<DynamicImage>
Upscales the given image and applies additional (optional) post-processing.
Sourcepub async fn interrogate(
&self,
image: &DynamicImage,
interrogator: Interrogator,
) -> Result<String>
pub async fn interrogate( &self, image: &DynamicImage, interrogator: Interrogator, ) -> Result<String>
Interrogates the given image with the interrogator to generate a caption.
Sourcepub async fn png_info(&self, image_bytes: &[u8]) -> Result<String>
pub async fn png_info(&self, image_bytes: &[u8]) -> Result<String>
Gets the PNG info for the image (assumed to be valid PNG)
Sourcepub async fn embeddings(&self) -> Result<Embeddings>
pub async fn embeddings(&self) -> Result<Embeddings>
Get the embeddings
Sourcepub async fn hypernetworks(&self) -> Result<Vec<String>>
pub async fn hypernetworks(&self) -> Result<Vec<String>>
Get the hypernetworks
Sourcepub async fn face_restorers(&self) -> Result<Vec<String>>
pub async fn face_restorers(&self) -> Result<Vec<String>>
Get the face restorers
Sourcepub async fn realesrgan_models(&self) -> Result<Vec<String>>
pub async fn realesrgan_models(&self) -> Result<Vec<String>>
Get the real ESRGAN models
Sourcepub async fn prompt_styles(&self) -> Result<Vec<PromptStyle>>
pub async fn prompt_styles(&self) -> Result<Vec<PromptStyle>>
Get the prompt styles
Sourcepub async fn artist_categories(&self) -> Result<Vec<String>>
pub async fn artist_categories(&self) -> Result<Vec<String>>
Get the artist categories
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more