Class ImageEditRequest
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
StreamThe 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
stringName of the image file.
mask
StreamAn 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
stringName of the mask file.
prompt
stringA text description of the desired image(s). The maximum length is 1000 characters.
numberOfResults
intThe number of images to generate. Must be between 1 and 10.
size
ImageSizeThe size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.
user
stringA unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
responseFormat
ImageResponseFormatThe format in which the generated images are returned. Must be one of url or b64_json.
Defaults to Urlmodel
ModelThe 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
StreamThe 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
stringName of the image file.
prompt
stringA text description of the desired image(s). The maximum length is 1000 characters.
numberOfResults
intThe number of images to generate. Must be between 1 and 10.
size
ImageSizeThe size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.
user
stringA unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
responseFormat
ImageResponseFormatThe format in which the generated images are returned. Must be one of url or b64_json.
Defaults to Urlmodel
ModelThe 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
stringThe 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
stringA text description of the desired image(s). The maximum length is 1000 characters.
numberOfResults
intThe number of images to generate. Must be between 1 and 10.
size
ImageSizeThe size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.
user
stringA unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
responseFormat
ImageResponseFormatThe format in which the generated images are returned. Must be one of url or b64_json.
Defaults to Urlmodel
ModelThe 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
stringThe 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
stringAn 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
stringA text description of the desired image(s). The maximum length is 1000 characters.
numberOfResults
intThe number of images to generate. Must be between 1 and 10.
size
ImageSizeThe size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.
user
stringA unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
responseFormat
ImageResponseFormatThe format in which the generated images are returned. Must be one of url or b64_json.
Defaults to Urlmodel
ModelThe 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
ImageName
public string ImageName { get; }
Property Value
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
MaskName
public string MaskName { get; }
Property Value
Prompt
A text description of the desired image(s). The maximum length is 1000 characters.
public string Prompt { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
~ImageEditRequest()
protected ~ImageEditRequest()