choonkeat/elm-openai/1.0.0

NOTE: the latest version is 3.0.0

OpenAI.Image

The Images API provides three methods for interacting with images:

  • Creating images from scratch based on a text prompt
  • Creating edits of an existing image based on a new text prompt
  • Creating variations of an existing image

See https://beta.openai.com/docs/guides/images

type alias Input =
{ prompt : String
, n : Maybe Int
, size : Maybe Size
, response_format : Maybe ResponseFormat
, user : Maybe String
}
type alias EditsInput =
{ image : BinaryBlob
, mask : Maybe BinaryBlob
, prompt : String
, n : Maybe Int
, size : Maybe Size
, response_format : Maybe ResponseFormat
, user : Maybe String
}
= ImageURL
| ImageB64Json
type Size
= Size256x256
| Size512x512
| Size1024x1024
type Output
= ImageURLOutput Posix (List Url)
| ImageB64JsonOutput Posix (List Bytes)