Media (images, audio, video)

Generate / Edit Image

Create images from a prompt, or edit an image with an optional mask, with OpenAI or Stability AI.

Generate / Edit Image (media_generate_image) creates images from a text prompt, or changes an existing image.

Inputs

AI provider (integration_id): one of the workspace's integrations made from a media-capable connector — see Provider setup. It is chosen in the designer (not an expression). The picker lists only connections that can do the step, and warns when the chosen provider cannot do a feature you picked.

Prompt (prompt, required): what to draw, or what to change. Expressions allowed.

For Edit: Image to edit (source) and an optional Mask (mask) — a PNG the same size as the image whose transparent pixels mark the area to change. A file object (a form's Attachments field such as {{form.recording}}, or a file from another step), a list of files (the first is used), a storage:// reference, an http(s) URL (fetched through the egress guard) or base64 content. Files are read for the run's workspace only — the same rules as the document actions.

Options

SettingKeyDefaultWhat it does
Operationoperationgenerategenerate or edit
SizesizeautoPixels such as 1024x1024 or 1536x1024, or an aspect ratio such as 16:9 (Stability AI)
Imagescount11–4
Formatformatpngpng, jpeg or webp
Qualityqualitythe provider's defaultProvider-specific, such as low, medium, high
Negative promptnegative_prompt—What to avoid (Stability AI)
Modelmodelthe provider's default
Output file nameoutput_namegenerated
Output variableoutput_vargenerated_image

Outputs

VariableContents
{{generated_image}}file, files, revised_prompt, provider, model, cost
{{generated_image_file}}The first image
{{generated_image_files}}All images

Example

A product illustration
{
  "type": "media_generate_image",
  "label": "Illustration",
  "config": {
    "integration_id": "<integration-id>",
    "prompt": "A flat illustration of {{product.name}} on a plain background",
    "size": "1024x1024",
    "format": "png"
  }
}