Tailflow
Skip to article
Browse documentation

OpenAI · Action

Generate image

Asks an OpenAI image model to draw a picture from your prompt, and hands the picture to the steps below.

When to use it

A picture to go with a post about a new token or a milestone, made from the event's own values.

At a glance

IntegrationOpenAI
Credits2
ConnectionOpenAI, by pasting a key

Settings

promptRequiredAccepts event fields
Prompt. What to draw. Values from the event go in exactly as written.
model
Model. Leave it on the default, or choose a model your OpenAI account can use. Picked from your account's own list, or typed.
size
Size. Under More options.
quality
Quality. Higher quality costs more with OpenAI and makes a larger picture. Under More options.

What it hands on

Actions run in order, and each one can read what the actions above it produced. This one writes the fields below; a later action reaches them as {{ actions.openai_generate_image_1.image }} — the action’s key, then which one it is if you use more than one of the same kind.

image
The picture itself, written out in full as an address that starts with data:image/jpeg. It is not a web link, so a place that only takes a web link to an image cannot use it.
mime_type
The picture's file type, image/jpeg.
bytes
The picture's size in bytes.

Good to know

  • Runs on your own OpenAI key. OpenAI bills your account for what the model reads and writes.
  • A key whose account has run out of credit fails the step with that reason. The flow keeps trying on later events, so it carries on once credit is added, and stops after several failures in a row.
  • OpenAI gives back the picture itself and keeps no copy to link to. The step hands it on whole, as a JPEG of at most 512 KB. A larger picture fails the step, so choose a lower quality if that happens.
  • A Webhooks step can send the picture on to your own server, for example as one of its Data rows set to the image field.
  • Values from the event go into the prompt exactly as written, so anyone who can name a token can add words to it. OpenAI's own safety checks still apply.
  • A prompt OpenAI will not draw fails the step with OpenAI's reason. The flow keeps running.