Table of Contents

Class ImageEditRequest

Namespace
OpenAI.Images
Assembly
OpenAI-DotNet.dll
public sealed class ImageEditRequest : AbstractBaseImageRequest, IDisposable
Inheritance
ImageEditRequest
Implements
Inherited Members

Constructors

ImageEditRequest(Stream, string, Stream, string, string, int, ImageSize, string, ImageResponseFormat, Model)

[Obsolete("Use new .ctor overload")]
public ImageEditRequest(Stream image, string imageName, Stream mask, string maskName, string prompt, int numberOfResults, ImageSize size = ImageSize.Large, string user = null, ImageResponseFormat responseFormat = (ImageResponseFormat)0, Model model = null)

Parameters

image Stream
imageName string
mask Stream
maskName string
prompt string
numberOfResults int
size ImageSize
user string
responseFormat ImageResponseFormat
model Model

ImageEditRequest(Stream, string, string, int, ImageSize, string, ImageResponseFormat, Model)

[Obsolete("Use new .ctor overload")]
public ImageEditRequest(Stream image, string imageName, string prompt, int numberOfResults, ImageSize size = ImageSize.Large, string user = null, ImageResponseFormat responseFormat = (ImageResponseFormat)0, Model model = null)

Parameters

image Stream
imageName string
prompt string
numberOfResults int
size ImageSize
user string
responseFormat ImageResponseFormat
model Model

ImageEditRequest(string, IReadOnlyDictionary<string, Stream>, (string, Stream), int?, string, string, string, ImageResponseFormat, Model)

public ImageEditRequest(string prompt, IReadOnlyDictionary<string, Stream> images, (string, Stream) mask = default, int? numberOfResults = null, string size = null, string quality = null, string user = null, ImageResponseFormat responseFormat = (ImageResponseFormat)0, Model model = null)

Parameters

prompt string
images IReadOnlyDictionary<string, Stream>
mask (string, Stream)
numberOfResults int?
size string
quality string
user string
responseFormat ImageResponseFormat
model Model

ImageEditRequest(string, string, int, ImageSize, string, ImageResponseFormat, Model)

[Obsolete("Use new .ctor overload")]
public ImageEditRequest(string imagePath, string prompt, int numberOfResults, ImageSize size = ImageSize.Large, string user = null, ImageResponseFormat responseFormat = (ImageResponseFormat)0, Model model = null)

Parameters

imagePath string
prompt string
numberOfResults int
size ImageSize
user string
responseFormat ImageResponseFormat
model Model

ImageEditRequest(string, string, string, int, ImageSize, string, ImageResponseFormat, Model)

[Obsolete("Use new .ctor overload")]
public ImageEditRequest(string imagePath, string maskPath, string prompt, int numberOfResults, ImageSize size = ImageSize.Large, string user = null, ImageResponseFormat responseFormat = (ImageResponseFormat)0, Model model = null)

Parameters

imagePath string
maskPath string
prompt string
numberOfResults int
size ImageSize
user string
responseFormat ImageResponseFormat
model Model

ImageEditRequest(string, string, string, int?, string, string, string, ImageResponseFormat, Model)

public ImageEditRequest(string prompt, string imagePath, string maskPath = null, int? numberOfResults = null, string size = null, string quality = null, string user = null, ImageResponseFormat responseFormat = (ImageResponseFormat)0, Model model = null)

Parameters

prompt string
imagePath string
maskPath string
numberOfResults int?
size string
quality string
user string
responseFormat ImageResponseFormat
model Model

ImageEditRequest(string, (string, Stream), (string, Stream), int?, string, string, string, ImageResponseFormat, Model)

public ImageEditRequest(string prompt, (string, Stream) image, (string, Stream) mask = default, int? numberOfResults = null, string size = null, string quality = null, string user = null, ImageResponseFormat responseFormat = (ImageResponseFormat)0, Model model = null)

Parameters

prompt string
image (string, Stream)
mask (string, Stream)
numberOfResults int?
size string
quality string
user string
responseFormat ImageResponseFormat
model Model

Properties

Images

The image(s) to edit. Must be a supported image file or an array of images. For gpt-image-1, each image should be a png, webp, or jpg file less than 25MB. You can provide up to 16 images. For dall-e-2, you can only provide one image, and it should be a square png file less than 4MB.

public IReadOnlyDictionary<string, Stream> Images { get; }

Property Value

IReadOnlyDictionary<string, Stream>

Mask

An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as image.

public Stream Mask { get; }

Property Value

Stream

MaskName

public string MaskName { get; }

Property Value

string

Prompt

A text description of the desired image(s). The maximum length is 1000 characters for dall-e-2, and 32000 characters for gpt-image-1.

public string Prompt { get; }

Property Value

string

Quality

The quality of the image that will be generated. high, medium and low are only supported for gpt-image-1. dall-e-2 only supports standard quality. Defaults to auto.

public string Quality { get; }

Property Value

string

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

~ImageEditRequest()

protected ~ImageEditRequest()