generate_image_openai
Generates OpenAI images and saves them to disk. Provide prompts, filenames, model, and an absolute output directory to create assets for your app or website.
Instructions
Generate one or more images with OpenAI's Image API and save them to disk.
Use this when the user (or your plan) needs OpenAI-generated assets for a website or app. Pass the OpenAI image model id (e.g. gpt-image-2, gpt-image-1.5, gpt-image-1, dall-e-3), a list of prompt + filename pairs, the required absolute_output_directory, and optional settings: size, quality, background, output_format.
Notes:
size: standard GPT sizes are 1024x1024, 1536x1024, 1024x1536, or auto; gpt-image-2 also allows arbitrary WIDTHxHEIGHT (divisible by 16).
quality: low/medium/high/auto for GPT image models; standard/hd for dall-e-3.
background: transparent/opaque/auto; transparent is unsupported on gpt-image-2 and requires png or webp.
output_format: png, jpeg, or webp (GPT image models only).
Images are written only to absolute_output_directory. It must be an absolute path; relative paths are rejected. Each file is named: {filename}-openai-{model}-{timestamp}.{ext}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Image size as WIDTHxHEIGHT or "auto". GPT image models: 1024x1024, 1536x1024, 1024x1536, or auto. gpt-image-2 also supports arbitrary sizes (both sides divisible by 16, aspect ratio 1:3-3:1, max 3840x2160). dall-e-2: 256x256, 512x512, 1024x1024. dall-e-3: 1024x1024, 1792x1024, 1024x1792. | |
| model | Yes | OpenAI image model id. GPT image models: gpt-image-2, gpt-image-1.5, gpt-image-1, gpt-image-1-mini, chatgpt-image-latest. Also dall-e-2, dall-e-3. | |
| images | Yes | List of images to generate (prompt + filename) | |
| quality | No | Rendering quality. auto (default) picks the best for the model. GPT image models: low, medium, high. dall-e-3: standard, hd. dall-e-2: standard only. | |
| background | No | Background for GPT image models that support it: transparent, opaque, or auto (default). transparent requires png or webp. gpt-image-2 does not support transparent — use opaque or auto. | |
| output_format | No | Output format for GPT image models only: png (default), jpeg, or webp. | |
| absolute_output_directory | Yes | Required absolute directory path where generated images will be saved. Relative paths are rejected. |