pub struct ImageVariationRequest {
pub image: PathBuf,
pub model: Option<String>,
pub n: Option<u32>,
pub response_format: Option<ImageResponseFormat>,
pub size: Option<VariationSize>,
pub user: Option<String>,
}Expand description
Creates a variation of a given image.
Fields§
§image: PathBufThe image to use as the basis for the variation(s), as a file path.
Must be a valid PNG file, less than 4MB, and square.
model: Option<String>The model to use for image generation. Only dall-e-2 is supported
at this time.
n: Option<u32>The number of images to generate. Must be between 1 and 10.
response_format: Option<ImageResponseFormat>The format in which the generated images are returned. Must be one of
url or b64_json. URLs are only valid for 60 minutes after the
image has been generated.
size: Option<VariationSize>The size of the generated images. Must be one of 256x256,
512x512, or 1024x1024.
user: Option<String>A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
Trait Implementations§
Source§impl Clone for ImageVariationRequest
impl Clone for ImageVariationRequest
Source§fn clone(&self) -> ImageVariationRequest
fn clone(&self) -> ImageVariationRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ImageVariationRequest
impl Debug for ImageVariationRequest
Source§impl Default for ImageVariationRequest
impl Default for ImageVariationRequest
Source§fn default() -> ImageVariationRequest
fn default() -> ImageVariationRequest
Returns the “default value” for a type. Read more
Source§impl Post for ImageVariationRequest
impl Post for ImageVariationRequest
Source§impl PostNoStream for ImageVariationRequest
impl PostNoStream for ImageVariationRequest
Source§async fn get_response_string(
&self,
client: &Client,
base_url: &str,
options: &RequestOptions,
) -> Result<String, OapiError>
async fn get_response_string( &self, client: &Client, base_url: &str, options: &RequestOptions, ) -> Result<String, OapiError>
Sends an image variation POST request using multipart/form-data format, following the field layout of the official SDK.
type Response = ImagesResponse
Auto Trait Implementations§
impl Freeze for ImageVariationRequest
impl RefUnwindSafe for ImageVariationRequest
impl Send for ImageVariationRequest
impl Sync for ImageVariationRequest
impl Unpin for ImageVariationRequest
impl UnsafeUnpin for ImageVariationRequest
impl UnwindSafe for ImageVariationRequest
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