-
-
Notifications
You must be signed in to change notification settings - Fork 46
ImageEditParameters
Parameter used for creating image edits
public struct ImageEditParameters
public init(
image: Data,
mask: Data,
prompt: String,
@Clamped(range: 1...10) numberOfImages: Int = 1,
resolution: ImageResolutions = .large,
responseFormat: ResponseFormat = .url,
user: String? = nil
) throws
os(iOS) || os(tvOS) || os(watchOS)
-
public init( image: UIImage, mask: UIImage, prompt: String, @Clamped(range: 1...10) numberOfImages: Int = 1, resolution: ImageResolutions = .large, responseFormat: ResponseFormat = .url, user: String? = nil ) throws
os(macOS)
-
public init( image: NSImage, mask: NSImage, prompt: String, @Clamped(range: 1...10) numberOfImages: Int = 1, resolution: ImageResolutions = .large, responseFormat: ResponseFormat = .url, user: String? = nil ) throws
The image to edit.
public var image: FormData
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.
An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image
should be edited.
public var mask: FormData
Must be a valid PNG file, less than 4MB, and have the same dimensions as image
.
A text description of the desired image(s).
public var prompt: String
The maximum length is 1000 characters.
The number of images to generate.
public var numberOfImages: Int
Must be between 1 and 10.
The size of the generated images.
public var resolution: ImageResolutions
Must be one of .small
, .medium
, or .large
.
The format in which the generated images are returned.
public var responseFormat: ResponseFormat
Must be one of url
or b64_json
.
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.
public var user: String?
The body of the URL used for OpenAI API requests.
public var body: [String: Any]
Generated at 2023-03-04T02:43:47+0000 using swift-doc 1.0.0-rc.1.
Types
- ChatChoice
- ChatMessage
- ChatParameters
- ChatResponse
- ChatRole
- Choice
- CompletionParameters
- CompletionResponse
- Configuration
- ContentPolicyCategories
- ContentPolicyCategoryScore
- ContentPolicyModels
- ContentPolicyParameters
- ContentPolicyResponse
- ContentPolicyResult
- CreateFineTuneParameters
- DeleteObject
- EditParameters
- EditResponse
- EmbeddingsData
- EmbeddingsParameters
- EmbeddingsResponse
- EmbeddingsUsage
- File
- FileStatus
- FineTune
- FineTuneEvent
- FineTuneEventInfo
- FineTuneEventsResponse
- FineTuneHyperparamters
- FineTuneStatus
- FineTuneTraining
- FormData
- HTTPMethod
- ImageData
- ImageEditParameters
- ImageParameters
- ImageResolutions
- ImageResponse
- ImageVariationParameters
- ListFilesResponse
- ListFineTuneResponse
- ListModelResponse
- Model
- ModelPermission
- OpenAIError
- OpenAIErrorMessage
- OpenAIErrorResponse
- OpenAIObject
- ResponseFormat
- UploadFileParameters
- Usage
Global Functions
- cancelFineTune(fineTune:)
- checkContentPolicy(parameters:)
- createEmbeddings(parameters:)
- createFineTune(parameters:)
- createImage(parameters:)
- decodeBase64Image(_:)
- decodeUrl(_:with:apiKey:body:method:bodyRequired:formSubmission:)
- deleteFile(fileId:)
- deleteFineTuneModel(model:)
- generateChatCompletion(parameters:)
- generateCompletion(parameters:)
- generateEdit(parameters:)
- generateImageEdits(parameters:)
- generateImageVariations(parameters:)
- listFiles()
- listFineTuneEvents(fineTune:)
- listFineTunes()
- listModels()
- retrieveFile(fileId:)
- retrieveFileContent(fileId:)
- retrieveFineTune(fineTune:)
- retrieveJsonLine(_:with:apiKey:)
- retrieveModel(modelId:)
- uploadFile(parameters:)