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
Inheritance
Namespace: Glitch9.AIDevKit.OpenAI
Assembly: .dll
Syntax
public abstract class ImageRequest<T> : ModelRequest where T : ImageRequest<T>
Type Parameters
Name | Description |
---|---|
T |
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.
Declaration
public FormFile? Image { get; set; }
Property Value
Type | Description |
---|---|
FormFile? |
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.
Declaration
public FormFile? Mask { get; set; }
Property Value
Type | Description |
---|---|
FormFile? |
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.
Declaration
public string Prompt { get; set; }
Property Value
Type | Description |
---|---|
string |
Quality
The quality of the image that will be generated. HighDefinition creates images with finer details and greater consistency across the image. This param is only supported for DallE3.
Declaration
public ImageQuality? Quality { get; set; }
Property Value
Type | Description |
---|---|
ImageQuality? |
Remarks
Defaults to Standard
ResponseFormat
The format of the response.
Declaration
public ImageFormat ResponseFormat { get; set; }
Property Value
Type | Description |
---|---|
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.
Declaration
public ImageSize? Size { get; set; }
Property Value
Type | Description |
---|---|
ImageSize? |
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.
Declaration
public ImageStyle? Style { get; set; }
Property Value
Type | Description |
---|---|
ImageStyle? |
Remarks
Defaults to Vivid