pub struct ImageEditRequestBuilder { /* private fields */ }Expand description
Builder for creating a ImageEditRequest instance.
Implementations§
Source§impl ImageEditRequestBuilder
impl ImageEditRequestBuilder
Sourcepub fn new(
model: impl Into<String>,
image: FileObject,
prompt: impl Into<String>,
) -> Self
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.
Sourcepub fn with_negative_prompt(self, negative_prompt: impl Into<String>) -> Self
pub fn with_negative_prompt(self, negative_prompt: impl Into<String>) -> Self
Set negative prompt
Sourcepub fn with_mask(self, mask: FileObject) -> Self
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.
Sourcepub fn with_number_of_images(self, n: u64) -> Self
pub fn with_number_of_images(self, n: u64) -> Self
Set the number of images to generate.
Sourcepub fn with_response_format(self, response_format: ResponseFormat) -> Self
pub fn with_response_format(self, response_format: ResponseFormat) -> Self
Set the format in which the generated images are returned.
Sourcepub fn with_cfg_scale(self, cfg_scale: f32) -> Self
pub fn with_cfg_scale(self, cfg_scale: f32) -> Self
Set the unconditional guidance scale. This param is only supported for stable-diffusion.cpp.
Sourcepub fn with_sample_method(self, sample_method: SamplingMethod) -> Self
pub fn with_sample_method(self, sample_method: SamplingMethod) -> Self
Set the sampling method. This param is only supported for stable-diffusion.cpp.
Sourcepub fn with_steps(self, steps: usize) -> Self
pub fn with_steps(self, steps: usize) -> Self
Set the number of sample steps. This param is only supported for stable-diffusion.cpp.
Sourcepub fn with_image_size(self, height: usize, width: usize) -> Self
pub fn with_image_size(self, height: usize, width: usize) -> Self
Set the image size.
Sourcepub fn with_control_strength(self, control_strength: f32) -> Self
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.
Sourcepub fn with_control_image(self, control_image: FileObject) -> Self
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.
Sourcepub fn with_seed(self, seed: i32) -> Self
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.
Sourcepub fn with_strength(self, strength: f32) -> Self
pub fn with_strength(self, strength: f32) -> Self
Set the strength for noising/unnoising. This param is only supported for stable-diffusion.cpp.
Sourcepub fn with_scheduler(self, scheduler: Scheduler) -> Self
pub fn with_scheduler(self, scheduler: Scheduler) -> Self
Set the denoiser sigma scheduler. This param is only supported for stable-diffusion.cpp.
Sourcepub fn with_apply_canny_preprocessor(
self,
apply_canny_preprocessor: bool,
) -> Self
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.
Sourcepub fn with_style_ratio(self, style_ratio: f32) -> Self
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.
Sourcepub fn build(self) -> ImageEditRequest
pub fn build(self) -> ImageEditRequest
Build the request.