Table of Contents

Class ImageRequest<T>

Creates an image given a prompt: https://api.openai.com/v1/images/generations Creates an edited or extended image given an original image and a prompt: https://api.openai.com/v1/images/edits Creates a variation of a given image: https://api.openai.com/v1/images/variations

public abstract class ImageRequest<T> : OpenAIRequest where T : ImageRequest<T>

Type Parameters

T
Inheritance
object
RESTRequestBody
ImageRequest<T>
Derived
Inherited Members

Properties

Image

[Required for Variation Request] The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask.

public File<Texture2D> Image { get; set; }

Property Value

File<Texture2D>

Mask

[Optional] An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as image.

public File<Texture2D> Mask { get; set; }

Property Value

File<Texture2D>

Prompt

[Required for Request and Edit Request] A Text description of the desired image(s). The maximum length is 1000 characters for dall-e-2 and 4000 characters for dall-e-3.

public string Prompt { get; set; }

Property Value

string

Quality

The quality of the image that will be generated. ImageQuality.HighDefinition creates images with finer details and greater consistency across the image. This param is only supported for DallE3.

public OpenAITypes.ImageQuality? Quality { get; set; }

Property Value

OpenAITypes.ImageQuality?

Remarks

Defaults to ImageQuality.Standard

ResponseFormat

The format of the response.

public ImageFormat? ResponseFormat { get; set; }

Property Value

ImageFormat?

Size

The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024 for dall-e-2. Must be one of 1024x1024, 1792x1024, or 1024x1792 for dall-e-3 models.

public OpenAITypes.ImageResolution? Size { get; set; }

Property Value

OpenAITypes.ImageResolution?

Remarks

Defaults to 1024x1024

Style

The style of the generated images. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for DallE3.

public OpenAITypes.ImageStyle? Style { get; set; }

Property Value

OpenAITypes.ImageStyle?

Remarks

Defaults to ImageStyle.Vivid