All nodes/AI/Media (Speech / Image / Video)

Generate Image

Generate an image from text (text2img) or from text + an input image (img2img). Parameters (size/quality/n) depend on the selected model.

Generate ImageT
PromptImages
Input imageAs Tool

Type in the graph: image_generate

ToolExec

An error branch can be enabled (expose_error_output) to handle failures on their own path.

Ports can be split into separate execution and data handles.

Try it

Minimal working workflow

Entry
Generate ImageT
Exit
  • Execute + Data
Press “Copy nodes”, open the editor and hit Ctrl+V on the canvas.

Pick your own connection or knowledge base first — the graph carries REPLACE_ME.

When to use it

The node draws an image from a text description, and edits an existing one when you connect a file. To merely look at a picture and answer about it you need no node at all — the attachment is read by the model itself inside an AI Agent or an LLM Response.

The wiring decides the role. An edge out of Images into the next step makes it an ordinary graph node; an edge out of tool_out into an agent’s Extensions port makes it a tool, so the model decides when to draw and the picture is attached to its reply.

How it works

The model list comes from the media catalog. A given model’s parameters — size, quality, number of images, seed — appear in the form only after the model is picked, because every model declares its own. Switching models drops the values the new one does not declare.

Connect a file to the Input image port and the same node becomes img2img: the description turns into a description of the edit. For a model that accepts no reference, the port is not drawn at all.

The tool role is subtler: tool arguments carry only text, so “redraw this photo” works through the Use the turn’s images as a reference (agent tool) switch, which hands the model the images the user attached to that turn. The result always reaches the user; it enters the model’s own context only with Show the result to the model, and an inlined picture costs input tokens on every generation.

Generated files land in the workspace file store; what travels down the graph is a reference, not bytes.

Common mistakes

  • An ImagesFiles edge into Exit. The Files port accepts pure data only. Turn on Split output ports and draw the edge from images_data.
  • Expecting a single picture. images is a list: if the model drew several, all of them travel on.
  • A leftover edge into Input image after a model change. The port disappears, the saved edge stays — and the node refuses to run rather than send the reference nowhere.
  • Writing the prompt only in the field. The Prompt port wins; the field is used when the port delivered nothing.
  • An empty connection instead of your own key. A connection with no key falls back to the platform key and is billed as usual. With your own key (BYO) the generation is not charged.

Inputs

PortWirePayloadNotes
PromptpromptExecute + Dataexecute_datastring

shown when operation_mode ≠ "as_tool"

Input imageimageDatadatafile

accepts many edges

shown when operation_mode ≠ "as_tool"

Outputs

PortWirePayloadNotes
ImagesimagesExecute + Dataexecute_datafile

shown when operation_mode ≠ "as_tool"

As Tooltool_outExtensionlink_extension

shown when operation_mode ≠ "executable"

Configuration

FieldTypeDefaultDescription
Node modeoperation_modestringexecutable

Executable — a step in the graph, with Run/Success ports. As Tool — an extension an AI Agent calls itself; only the tool_out port is shown and the agent decides when to run it.

Options: executable — Executable, as_tool — As Tool

Promptpromptstring""

Used when no 'prompt' input is connected.

supports templates

shown when operation_mode = executable

Modelmodelstringopenrouter/openai/gpt-image-1

Image model from the media catalog (e.g. 'openrouter/openai/gpt-image-1'). Its own parameters (size, quality, number of images) appear below once the model is selected; models that accept no reference image also hide the 'image' port.

Options: openrouter/openai/gpt-image-1 — OpenRouter / OpenAI: GPT Image 1, openrouter/microsoft/mai-image-2.5-pro — OpenRouter / Microsoft: MAI-Image-2.5 Pro, openrouter/krea/krea-2-large — OpenRouter / Krea: Krea 2 Large, openrouter/krea/krea-2-medium — OpenRouter / Krea: Krea 2 Medium, openrouter/krea/krea-2-medium-turbo — OpenRouter / Krea: Krea 2 Medium Turbo, openrouter/google/gemini-3.1-flash-lite-image — OpenRouter / Google: Nano Banana 2 Lite (Gemini 3.1 Flash Lite Image), openrouter/openai/gpt-image-2 — OpenRouter / OpenAI: GPT Image 2, openrouter/openai/gpt-image-1-mini — OpenRouter / OpenAI: GPT Image 1 Mini, openrouter/google/gemini-3.1-flash-image — OpenRouter / Google: Nano Banana 2 (Gemini 3.1 Flash Image), openrouter/google/gemini-3-pro-image — OpenRouter / Google: Nano Banana Pro (Gemini 3 Pro Image), openrouter/sourceful/riverflow-v2.5-pro — OpenRouter / Sourceful: Riverflow V2.5 Pro, openrouter/sourceful/riverflow-v2.5-fast — OpenRouter / Sourceful: Riverflow V2.5 Fast, openrouter/microsoft/mai-image-2.5 — OpenRouter / Microsoft: MAI-Image-2.5, openrouter/x-ai/grok-imagine-image-quality — OpenRouter / xAI: Grok Imagine Image Quality, openrouter/recraft/recraft-v4.1-pro-vector — OpenRouter / Recraft: Recraft V4.1 Pro Vector, openrouter/recraft/recraft-v4.1-vector — OpenRouter / Recraft: Recraft V4.1 Vector, openrouter/recraft/recraft-v4.1-utility-pro — OpenRouter / Recraft: Recraft V4.1 Utility Pro, openrouter/recraft/recraft-v4.1-utility — OpenRouter / Recraft: Recraft V4.1 Utility, openrouter/recraft/recraft-v4.1-pro — OpenRouter / Recraft: Recraft V4.1 Pro, openrouter/recraft/recraft-v4.1 — OpenRouter / Recraft: Recraft V4.1, openrouter/recraft/recraft-v4-pro-vector — OpenRouter / Recraft: Recraft V4 Pro Vector, openrouter/recraft/recraft-v4-vector — OpenRouter / Recraft: Recraft V4 Vector, openrouter/recraft/recraft-v4-pro — OpenRouter / Recraft: Recraft V4 Pro, openrouter/recraft/recraft-v4 — OpenRouter / Recraft: Recraft V4, openrouter/recraft/recraft-v3 — OpenRouter / Recraft: Recraft V3, openrouter/openai/gpt-5.4-image-2 — OpenRouter / OpenAI: GPT-5.4 Image 2, openrouter/google/gemini-3.1-flash-image-preview — OpenRouter / Google: Nano Banana 2 (Gemini 3.1 Flash Image Preview), openrouter/sourceful/riverflow-v2-pro — OpenRouter / Sourceful: Riverflow V2 Pro, openrouter/sourceful/riverflow-v2-fast — OpenRouter / Sourceful: Riverflow V2 Fast, openrouter/black-forest-labs/flux.2-klein-4b — OpenRouter / Black Forest Labs: FLUX.2 Klein 4B, openrouter/bytedance-seed/seedream-4.5 — OpenRouter / ByteDance Seed: Seedream 4.5, openrouter/black-forest-labs/flux.2-max — OpenRouter / Black Forest Labs: FLUX.2 Max, openrouter/black-forest-labs/flux.2-flex — OpenRouter / Black Forest Labs: FLUX.2 Flex, openrouter/black-forest-labs/flux.2-pro — OpenRouter / Black Forest Labs: FLUX.2 Pro, openrouter/google/gemini-3-pro-image-preview — OpenRouter / Google: Nano Banana Pro (Gemini 3 Pro Image Preview), openrouter/openai/gpt-5-image-mini — OpenRouter / OpenAI: GPT-5 Image Mini, openrouter/openai/gpt-5-image — OpenRouter / OpenAI: GPT-5 Image, openrouter/google/gemini-2.5-flash-image — OpenRouter / Google: Nano Banana (Gemini 2.5 Flash Image)

Advanced
Show the result to the modelshow_result_to_modelbooleanfalse

Inline the generated file into the conversation after the tool result, so the model can look at what it produced and refine it on a following round. Off by default: an inlined file costs input tokens on every generation.

shown when operation_mode = as_tool

Stream progress to Catch Tool Callstream_progress_in_catchbooleantrue

Emit loading/success lines for this tool into a connected catch_tool_call node.

shown when operation_mode = as_tool

Use the turn's images as a reference (agent tool)use_turn_imagesbooleantrue

When an AI Agent calls this node as a tool, send the images the user attached to that turn as the reference (img2img / edit). The tool arguments cannot carry bytes, so this is the only way "redraw this photo" reaches the provider. Ignored on the graph path, which uses the 'image' port.

shown when operation_mode = as_tool

Connection Idconnection_idstring""

Optional workspace connection carrying your own provider key (BYO). Empty = the platform key from the environment.

connection: openrouter

Shared fields

Every node has these three — the platform adds them, not the node author.

  • expose_error_output — When enabled, show an execution output to connect nodes that run if this step fails.
  • split_ports_in — Show separate execution and data input handles instead of one combined port.
  • split_ports_out — Show separate execution and data output handles instead of one combined port.