CreateImage icon

Create an image using OpenAI's DALL-E

Turn a text prompt into an AI generated image using OpenAI DALL-E, orchestrated in Kestra with declarative YAML, retries, and downloadable outputs.

Categories
AI
id: openai-dall-e-create-image
namespace: company.team

tasks:
  - id: puppy
    type: io.kestra.plugin.openai.CreateImage
    apiKey: "{{ secret('OPENAI_API_KEY') }}"
    n: 1
    download: true
    prompt: the cutest little happy smiling puppy

Generate AI images from a text prompt using OpenAI DALL-E, fully orchestrated in Kestra. This blueprint takes a natural language prompt, calls the DALL-E image generation API, and makes the resulting image available for download straight from the execution Outputs tab. It solves a common gap in generative AI workflows: turning one off API calls into a repeatable, parameterized, scheduled, and observable pipeline that fits alongside the rest of your data and automation stack.

How it works

The flow runs a single task, puppy, of type io.kestra.plugin.openai.CreateImage. It authenticates to OpenAI with apiKey sourced from {{ secret('OPENAI_API_KEY') }}, sends the prompt to DALL-E, requests n: 1 image, and sets download: true so Kestra stores the generated image in internal storage. Because download is enabled, the image appears in the Outputs tab of the execution and can be downloaded directly or passed to downstream tasks.

What you get

  • A working text to image pipeline backed by OpenAI DALL-E.
  • The generated image stored in Kestra internal storage and downloadable from the execution Outputs.
  • A declarative, version controllable definition of the generation step.
  • A foundation you can parameterize, schedule, and chain into larger flows.

Who it's for

  • Data and ML engineers adding generative image steps to pipelines.
  • Automation and platform teams standardizing AI API calls.
  • Developers prototyping DALL-E generation before productionizing it.

Why orchestrate this with Kestra

OpenAI exposes an API, not a scheduler or a workflow engine. Kestra fills that gap: trigger generation on a schedule or in response to events, apply automatic retries when the API rate limits or times out, capture full execution lineage and logs for every run, and keep the whole definition as declarative YAML in version control. You get reproducibility, observability, and the ability to wire image generation into upstream and downstream tasks, which the OpenAI API alone cannot provide.

Prerequisites

  • A Kestra instance (local or self hosted).
  • An OpenAI account with API access and image generation enabled.

Secrets

  • OPENAI_API_KEY: your OpenAI API key used by the CreateImage task.

Quick start

  1. Add the OPENAI_API_KEY secret to your Kestra instance.
  2. Copy this blueprint into a flow.
  3. Adjust the prompt to describe the image you want.
  4. Execute the flow and open the Outputs tab to download the generated image.

How to extend

  • Expose the prompt as an input so users can drive generation at execution time.
  • Increase n to generate multiple variations in a single run.
  • Add a Schedule trigger to produce images on a recurring cadence.
  • Chain a follow up task to upload the image to object storage or post it to Slack.

Links

Share this Blueprint
See How

New to Kestra?

Use blueprints to kickstart your first workflows.