pub struct ImageEditBuilder { /* private fields */ }Expand description
Builder describing an image edit request (/images/edits).
Implementations§
Source§impl ImageEditBuilder
impl ImageEditBuilder
Sourcepub fn new(image: impl AsRef<Path>, prompt: impl Into<String>) -> Self
pub fn new(image: impl AsRef<Path>, prompt: impl Into<String>) -> Self
Create a new edit request using a base image and prompt.
Sourcepub fn mask(self, mask: impl AsRef<Path>) -> Self
pub fn mask(self, mask: impl AsRef<Path>) -> Self
Supply a mask file that indicates editable regions.
Sourcepub fn background(self, background: impl Into<String>) -> Self
pub fn background(self, background: impl Into<String>) -> Self
Control the generated background (transparent, opaque, … as string).
Sourcepub fn model(self, model: impl Into<String>) -> Self
pub fn model(self, model: impl Into<String>) -> Self
Override the model (defaults to gpt-image-1).
Sourcepub fn response_format(self, format: impl Into<String>) -> Self
pub fn response_format(self, format: impl Into<String>) -> Self
Choose the response format (url, b64_json).
Sourcepub fn output_format(self, format: impl Into<String>) -> Self
pub fn output_format(self, format: impl Into<String>) -> Self
Choose the binary output format (png, jpeg, webp).
Sourcepub fn output_compression(self, compression: i32) -> Self
pub fn output_compression(self, compression: i32) -> Self
Configure output compression (0-100).
Sourcepub fn input_fidelity(self, fidelity: ImageInputFidelity) -> Self
pub fn input_fidelity(self, fidelity: ImageInputFidelity) -> Self
Control fidelity for the input image (low/high).
Sourcepub fn partial_images(self, value: i32) -> Self
pub fn partial_images(self, value: i32) -> Self
Configure partial image count when streaming (0-3).
Trait Implementations§
Source§impl Builder<ImageEditRequest> for ImageEditBuilder
impl Builder<ImageEditRequest> for ImageEditBuilder
Source§fn build(self) -> Result<ImageEditRequest>
fn build(self) -> Result<ImageEditRequest>
Build the final request type.
Source§impl Clone for ImageEditBuilder
impl Clone for ImageEditBuilder
Source§fn clone(&self) -> ImageEditBuilder
fn clone(&self) -> ImageEditBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ImageEditBuilder
impl RefUnwindSafe for ImageEditBuilder
impl Send for ImageEditBuilder
impl Sync for ImageEditBuilder
impl Unpin for ImageEditBuilder
impl UnwindSafe for ImageEditBuilder
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
Mutably borrows from an owned value. Read more