Skip to main content

openai_image_generation

Generates an image from a text description and other attributes, using OpenAI API.

# Common config fields, showing default values
pipeline:
processors:
- label: ""
openai_image_generation:
server_address: "https://api.openai.com/v1"
api_key: "" # No default (required)
model: "" # No default (required)
prompt: "" # No default (optional)

This processor sends an image description and other attributes, such as image size and quality to the OpenAI API, which generates an image. By default, the processor submits the entire payload of each message as a string, unless you use the prompt configuration field to customize it.

To learn more about image generation, see the OpenAI API documentation.

Fields

server_address

The Open API endpoint that the processor sends requests to. Update the default value to use another OpenAI compatible service.

Type: string
Default: "https://api.openai.com/v1"

api_key

The API key for OpenAI API.

Secret

This field contains sensitive information. Use a secret reference rather than a literal value.

Type: string

model

The name of the OpenAI model to use.

Type: string

prompt

A text description of the image you want to generate. The prompt field accepts a maximum of 1000 characters for dall-e-2 and 4000 characters for dall-e-3.

Type: string

quality

The quality of the image to generate. Use hd to create images with finer details and greater consistency across the image. This parameter is only supported for dall-e-3 models.

This field supports interpolation functions.

Type: string

size

The size of the generated image. Choose from 256x256, 512x512, or 1024x1024 for dall-e-2. Choose from 1024x1024, 1792x1024, or 1024x1792 for dall-e-3 models.

This field supports interpolation functions.

Type: string

style

The style of the generated image. Choose from vivid or natural. Vivid causes the model to lean towards generating hyperreal and dramatic images. Natural causes the model to produce more natural, less hyperreal looking images. This parameter is only supported for dall-e-3.

This field supports interpolation functions.

Type: string