Skip to content

ImageParameters

MarcoDotIO edited this page Dec 5, 2022 · 1 revision

ImageParameters

Parameter used for generating images given a prompt.

public struct ImageParameters 

Initializers

init(prompt:numberofImages:resolution:responseFormat:user:)

public init(
        prompt: String,
        @Clamped(range: 1...10) numberofImages: Int = 1,
        resolution: ImageResolutions = .large,
        responseFormat: ResponseFormat = .url,
        user: String? = nil
    ) 

Properties

prompt

A text description of the desired image(s).

public var prompt: String

The maximum length is 1000 characters.

numberOfImages

The number of images to generate.

public var numberOfImages: Int

Must be between 1 and 10.

resolution

The size of the generated images.

public var resolution: ImageResolutions

Must be one of .small, .medium, or .large.

responseFormat

The format in which the generated images are returned.

public var responseFormat: ResponseFormat

Must be one of url or b64_json.

user

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

public var user: String?

body

The body of the URL used for OpenAI API requests.

public var body: [String: Any] 
Types
Global Functions
Clone this wiki locally