Skip to main content

EditImageJsonRequest

Struct EditImageJsonRequest 

Source
pub struct EditImageJsonRequest {
Show 15 fields pub model: Option<ImageModel>, pub images: Vec<ImageRefParam>, pub mask: Option<ImageRefParam>, pub prompt: String, pub n: Option<u8>, pub quality: Option<ImageQuality>, pub input_fidelity: Option<InputFidelity>, pub size: Option<ImageSize>, pub user: Option<String>, pub output_format: Option<ImageOutputFormat>, pub output_compression: Option<u8>, pub moderation: Option<ImageModeration>, pub background: Option<ImageBackground>, pub stream: Option<bool>, pub partial_images: Option<u8>,
}
Expand description

JSON request body for image edits.

Use images (array of ImageRefParam) instead of multipart image uploads. You can reference images via external URLs, data URLs, or uploaded file IDs. JSON edits support GPT image models only; DALL-E edits require multipart (dall-e-2 only).

Fields§

§model: Option<ImageModel>

The model to use for image editing.

§images: Vec<ImageRefParam>

Input image references to edit. For GPT image models, you can provide up to 16 images.

§mask: Option<ImageRefParam>

An optional mask image reference indicating which areas of the image should be edited.

§prompt: String

A text description of the desired image edit.

§n: Option<u8>

The number of edited images to generate. Must be between 1 and 10.

§quality: Option<ImageQuality>

The quality of the image that will be generated.

§input_fidelity: Option<InputFidelity>

Control how much effort the model will exert to match the style and features, especially facial features, of input images. Supports high and low. Defaults to low.

§size: Option<ImageSize>

The size of the generated image.

§user: Option<String>

A unique identifier representing your end-user.

§output_format: Option<ImageOutputFormat>

The output format for the generated image.

§output_compression: Option<u8>

The compression level (0-100%) for the generated images.

§moderation: Option<ImageModeration>

Control the content-moderation level for images.

§background: Option<ImageBackground>

The background style for the generated image.

§stream: Option<bool>

Whether to stream the image generation. Defaults to false.

§partial_images: Option<u8>

The number of partial images to generate during streaming.

Trait Implementations§

Source§

impl Clone for EditImageJsonRequest

Source§

fn clone(&self) -> EditImageJsonRequest

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EditImageJsonRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for EditImageJsonRequest

Source§

fn default() -> EditImageJsonRequest

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for EditImageJsonRequest

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<EditImageJsonRequest, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for EditImageJsonRequest

Source§

fn eq(&self, other: &EditImageJsonRequest) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for EditImageJsonRequest

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for EditImageJsonRequest

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more