endpoints::images

Struct ImageEditRequestBuilder

Source
pub struct ImageEditRequestBuilder { /* private fields */ }
Expand description

Builder for creating a ImageEditRequest instance.

Implementations§

Source§

impl ImageEditRequestBuilder

Source

pub fn new( model: impl Into<String>, image: FileObject, prompt: impl Into<String>, ) -> Self

Create a new builder with the given image, prompt, and mask.

Source

pub fn with_negative_prompt(self, negative_prompt: impl Into<String>) -> Self

Set negative prompt

Source

pub fn with_mask(self, mask: FileObject) -> Self

Set an additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. Must have the same dimensions as image.

Source

pub fn with_number_of_images(self, n: u64) -> Self

Set the number of images to generate.

Source

pub fn with_size(self, size: impl Into<String>) -> Self

Set the size of the generated images.

Source

pub fn with_response_format(self, response_format: ResponseFormat) -> Self

Set the format in which the generated images are returned.

Source

pub fn with_user(self, user: impl Into<String>) -> Self

Set the user id

Source

pub fn with_cfg_scale(self, cfg_scale: f32) -> Self

Set the unconditional guidance scale. This param is only supported for stable-diffusion.cpp.

Source

pub fn with_sample_method(self, sample_method: SamplingMethod) -> Self

Set the sampling method. This param is only supported for stable-diffusion.cpp.

Source

pub fn with_steps(self, steps: usize) -> Self

Set the number of sample steps. This param is only supported for stable-diffusion.cpp.

Source

pub fn with_image_size(self, height: usize, width: usize) -> Self

Set the image size.

Source

pub fn with_control_strength(self, control_strength: f32) -> Self

Set the strength to apply Control Net. This param is only supported for stable-diffusion.cpp.

Source

pub fn with_control_image(self, control_image: FileObject) -> Self

Set the image to control the generation. This param is only supported for stable-diffusion.cpp.

Source

pub fn with_seed(self, seed: i32) -> Self

Set the RNG seed. Negative value means to use random seed. This param is only supported for stable-diffusion.cpp.

Source

pub fn with_strength(self, strength: f32) -> Self

Set the strength for noising/unnoising. This param is only supported for stable-diffusion.cpp.

Source

pub fn with_scheduler(self, scheduler: Scheduler) -> Self

Set the denoiser sigma scheduler. This param is only supported for stable-diffusion.cpp.

Source

pub fn with_apply_canny_preprocessor( self, apply_canny_preprocessor: bool, ) -> Self

Set whether to apply the canny preprocessor. This param is only supported for stable-diffusion.cpp.

Source

pub fn with_style_ratio(self, style_ratio: f32) -> Self

Set the strength for keeping input identity. This param is only supported for stable-diffusion.cpp.

Source

pub fn build(self) -> ImageEditRequest

Build the request.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T