Size
ImageEditsQuery.swift:12typealias Size = ImagesQuery.Size
typealias Size = ImagesQuery.Size
import OpenAI
struct ImageEditsQuery
struct ImagesQuery
Given a prompt and/or an input image, the model will generate a new image. https://platform.openai.com/docs/guides/images
enum Size
init(from decoder: any Decoder) throws
init(image: Data, prompt: String, mask: Data? = nil, model: Model? = nil, n: Int? = nil, responseFormat: Self.ResponseFormat? = nil, size: Self.Size? = nil, user: String? = nil)
let image: Data
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.
let mask: Data?
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.
let model: Model?
The model to use for image generation. Defaults to dall-e-2
let n: Int?
The number of images to generate. Must be between 1 and 10.
let prompt: String
A text description of the desired image(s). The maximum length is 1000 characters.
let responseFormat: Self.ResponseFormat?
The format in which the generated images are returned. Must be one of url or b64_json. Defaults to url
let size: Size?
The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.
let user: String?
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
enum CodingKeys
typealias ResponseFormat = ImagesQuery.ResponseFormat