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
| Setting | Key | Default | What it does |
|---|---|---|---|
| Operation | operation | generate | generate or edit |
| Size | size | auto | Pixels such as 1024x1024 or 1536x1024, or an aspect ratio such as 16:9 (Stability AI) |
| Images | count | 1 | 1–4 |
| Format | format | png | png, jpeg or webp |
| Quality | quality | the provider's default | Provider-specific, such as low, medium, high |
| Negative prompt | negative_prompt | — | What to avoid (Stability AI) |
| Model | model | the provider's default | |
| Output file name | output_name | generated | |
| Output variable | output_var | generated_image |
Outputs
| Variable | Contents |
|---|---|
{{generated_image}} | file, files, revised_prompt, provider, model, cost |
{{generated_image_file}} | The first image |
{{generated_image_files}} | All images |
Example
{
"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"
}
}