pub struct CreateImageRequest {
pub model: Option<String>,
pub n: NonZeroU64,
pub prompt: String,
pub quality: Option<CreateImageRequestQuality>,
pub response_format: CreateImageRequestResponseFormat,
pub size: Option<ImageSize>,
}Expand description
Request body for creating an image via the OpenAI-compatible Images API.
JSON schema
{
"description": "Request body for creating an image via the OpenAI-compatible Images API.\n",
"type": "object",
"required": [
"prompt"
],
"properties": {
"model": {
"description": "Model ID to use for image generation.",
"type": "string"
},
"n": {
"description": "Number of images to generate.",
"default": 1,
"type": "integer",
"maximum": 10.0,
"minimum": 1.0
},
"prompt": {
"description": "A text description of the desired image.",
"type": "string"
},
"quality": {
"description": "The quality of the image. `auto` selects the best quality for\nthe model. The GPT image models support `low`, `medium`, and\n`high`; `dall-e-3` supports `standard` and `hd`; `dall-e-2`\nsupports only `standard`.\n",
"type": "string",
"enum": [
"auto",
"standard",
"hd",
"low",
"medium",
"high"
]
},
"response_format": {
"description": "The format in which the generated images are returned. Must be\none of `url` or `b64_json`.\n",
"default": "url",
"type": "string",
"enum": [
"url",
"b64_json"
]
},
"size": {
"$ref": "#/definitions/ImageSize"
}
}
}Fields§
§model: Option<String>Model ID to use for image generation.
n: NonZeroU64Number of images to generate.
prompt: StringA text description of the desired image.
quality: Option<CreateImageRequestQuality>The quality of the image. auto selects the best quality for
the model. The GPT image models support low, medium, and
high; dall-e-3 supports standard and hd; dall-e-2
supports only standard.
response_format: CreateImageRequestResponseFormatThe format in which the generated images are returned. Must be
one of url or b64_json.
size: Option<ImageSize>Trait Implementations§
Source§impl Clone for CreateImageRequest
impl Clone for CreateImageRequest
Source§fn clone(&self) -> CreateImageRequest
fn clone(&self) -> CreateImageRequest
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 CreateImageRequest
impl Debug for CreateImageRequest
Source§impl Default for CreateImageRequest
impl Default for CreateImageRequest
Source§impl<'de> Deserialize<'de> for CreateImageRequest
impl<'de> Deserialize<'de> for CreateImageRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CreateImageRequest
impl RefUnwindSafe for CreateImageRequest
impl Send for CreateImageRequest
impl Sync for CreateImageRequest
impl Unpin for CreateImageRequest
impl UnsafeUnpin for CreateImageRequest
impl UnwindSafe for CreateImageRequest
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