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)

Constructor.

public ImageEditRequest(Stream image, string imageName, Stream mask, string maskName, string prompt, int numberOfResults = 1, ImageSize size = ImageSize.Large, string user = null, ImageResponseFormat responseFormat = ImageResponseFormat.Url, Model model = null)

Parameters

image Stream

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.

imageName string

Name of the image file.

mask Stream

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.

maskName string

Name of the mask file.

prompt string

A text description of the desired image(s). The maximum length is 1000 characters.

numberOfResults int

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

size ImageSize

The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.

user string

A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.

responseFormat ImageResponseFormat

The format in which the generated images are returned. Must be one of url or b64_json.

Defaults to Url
model Model

The model to use for image generation.

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

Constructor.

public ImageEditRequest(Stream image, string imageName, string prompt, int numberOfResults = 1, ImageSize size = ImageSize.Large, string user = null, ImageResponseFormat responseFormat = ImageResponseFormat.Url, Model model = null)

Parameters

image Stream

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.

imageName string

Name of the image file.

prompt string

A text description of the desired image(s). The maximum length is 1000 characters.

numberOfResults int

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

size ImageSize

The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.

user string

A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.

responseFormat ImageResponseFormat

The format in which the generated images are returned. Must be one of url or b64_json.

Defaults to Url
model Model

The model to use for image generation.

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

Constructor.

public ImageEditRequest(string imagePath, string prompt, int numberOfResults = 1, ImageSize size = ImageSize.Large, string user = null, ImageResponseFormat responseFormat = ImageResponseFormat.Url, Model model = null)

Parameters

imagePath string

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.

prompt string

A text description of the desired image(s). The maximum length is 1000 characters.

numberOfResults int

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

size ImageSize

The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.

user string

A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.

responseFormat ImageResponseFormat

The format in which the generated images are returned. Must be one of url or b64_json.

Defaults to Url
model Model

The model to use for image generation.

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

Constructor.

public ImageEditRequest(string imagePath, string maskPath, string prompt, int numberOfResults = 1, ImageSize size = ImageSize.Large, string user = null, ImageResponseFormat responseFormat = ImageResponseFormat.Url, Model model = null)

Parameters

imagePath string

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.

maskPath string

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.

prompt string

A text description of the desired image(s). The maximum length is 1000 characters.

numberOfResults int

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

size ImageSize

The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.

user string

A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.

responseFormat ImageResponseFormat

The format in which the generated images are returned. Must be one of url or b64_json.

Defaults to Url
model Model

The model to use for image generation.

Properties

Image

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 Stream Image { get; }

Property Value

Stream

ImageName

public string ImageName { get; }

Property Value

string

Mask

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 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.

public string Prompt { get; }

Property Value

string

Methods

Dispose()

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

public void Dispose()

~ImageEditRequest()

protected ~ImageEditRequest()