By Admin on Sunday, 09 April 2023
Category: All

Image Generator OpenAI Delphi (5 / 5)

OpenAI API allows given a prompt and/or an input image, the model will generate a new image. The Images API provides three methods for interacting with images:

1. Creating images from scratch based on a text prompt
2. Creating edits of an existing image based on a new text prompt
3. Creating variations of an existing image

Image Generator Delphi Example

The OpenAI API has the following methods to create a new image using a prompt.

- prompt: (Required) A text description of the desired image(s). The maximum length is 1000 characters.

- n: The number of images to generate. Must be between 1 and 10.

- size: The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.

- response_format: The format in which the generated images are returned. 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.

Find below a simple delphi example which generates an image given a prompt.

Find below the compiled demo for windows built with the sgcWebSockets library. 

Related Posts