Skip to content
Guides

n8n Image Generation With Nano Banana and More

n8n image generation with one HTTP Request node: Nano Banana Pro, GPT Image, Seedream and our engines on one key, batches, files and per-image billing.

Updated 4 min read

n8n image generation takes one HTTP Request node pointed at an image API: with Frameport, the same node and credential reach all 10 image models, from Nano Banana Pro to GPT Image 2.5 Sunburst, Seedream 5.0 Pro and our own engines. Each image is charged only if it succeeds, from $0.025.

This guide sets up the node, then builds a workflow that reads prompts from a sheet and saves the images to Google Drive, with batches of four, partial results and switching models from the sheet.

The node set-up

Create an API key in the dashboard (it starts with fp_live_). In n8n, create a Header Auth credential: name Authorization, value Bearer followed by a space and your key. Then add an HTTP Request node:

FieldValue
MethodPOST
URLhttps://frameport.ai/v1/images/generations
AuthenticationGeneric Credential Type › Header Auth, with the credential above
Send HeadersOn: Idempotency-Key, from the row's id
Send BodyOn: JSON, Using JSON, as an expression
Body (Using JSON, as an expression)
{
  "model": "nano-banana-pro",
  "prompt": {{ JSON.stringify($json.prompt) }},
  "n": 1,
  "aspect_ratio": "4:3",
  "max_cost_usd": 0.16
}

JSON.stringify keeps a prompt with quotes in it from breaking the body. aspect_ratio takes 1:1 (the default), 3:4, 4:3, 9:16 or 16:9, and max_cost_usd refuses a request priced above it before anything is held. The Idempotency-Key header, built from the row's id (for example img- and the id), makes a retry return the first generation for 24 hours instead of paying twice, so Retry On Fail in the node's settings is safe to turn on.

The node gets 202 Accepted at once with the generation's id and status: "queued"; the images follow once they are rendered.

Prompt from a sheet, image to Drive

The whole workflow, for a sheet with an id, a prompt and an empty status column:

Manual or Schedule Trigger → Google Sheets (rows with no status)
  → HTTP Request (submit) → Wait (5 seconds) → HTTP Request (read the generation)
  → If: still rendering? back to Wait
  → Split Out (outputs) → Filter (status is succeeded)
  → HTTP Request (download as a file) → Google Drive (upload) → Google Sheets (update the row)

After the Wait node, read the generation with the same credential, and loop while it renders. The bound keeps the loop from running forever:

GET, URL (expression)
https://frameport.ai/v1/generations/{{ $json.id }}
If: still rendering (a boolean expression, is true)
{{ ['queued', 'running'].includes($json.status) && $runIndex < 24 }}

Each finished image has a signed url that works without a key for about an hour. After the Split Out node below, each item is one image: download it with an HTTP Request node (no credential), Options › Response › Response Format set to File, and pass the binary data to a Google Drive node that uploads it to your folder. Write the Drive link and the generation's cost_usd back to the row.

Download, URL (expression)
{{ $json.url }}

For a request that came in error (a prompt the model refuses, a balance too low), set the submit node's On Error setting to Continue (using error output) and write the message to the row: a refused request is not charged.

Batches and partial results

n asks for 1 to 4 images in one request. The hold is the price of all of them, but each image is its own job and is charged only if it succeeds:

Model1 image4 images
Nano Banana Pro$0.16$0.64
GPT Image 2.5 Sunburst$0.085$0.34
Seedream 5.0 Pro$0.099$0.396
Frameport Image 1$0.025$0.10

The generation's outputs array holds one entry per image. A Split Out node with outputs as the field to split out turns them into one item each, and a Filter node keeps those whose status is succeeded. A batch counts as succeeded when at least one image did; an image that failed shows status: "failed" and an error, and its share of the hold goes back to your balance. The generation's cost_usd is the sum of the images that succeeded.

Reference pictures

Some models take pictures with the prompt: a product, a face or a place to keep, or a picture to change. Nano Banana Pro takes up to 6, and Frameport Image 1 up to 10. Put a public image URL in a photo column and add it to the body:

Body with a reference picture (expression)
{
  "model": "fp-image-1",
  "prompt": {{ JSON.stringify($json.prompt) }},
  "reference_images": [{{ JSON.stringify($json.photo) }}],
  "aspect_ratio": "1:1"
}

Write the change you want rather than the whole scene: "the mug from the picture on a walnut desk beside a window, morning light". Frameport Image 1 adds a small charge for each reference picture after the first; a quote shows it before you spend (quotes).

The Nano Banana Pro API guide shows what its edits can do.

Switching models

Every image model takes the same body, so the model can be a column of the sheet: replace "nano-banana-pro" with the row's model value, through JSON.stringify like the prompt. Draft on a cheaper model, then render the keepers on a flagship.

ModelmodelMakerBest at
Nano Banana Pronano-banana-proGoogleHero images, text in the picture, edits from pictures
GPT Image 2.5 Sunburstgpt-image-2-5-sunburstOpenAIClose prompt adherence, posters and lettering
Seedream 5.0 Proseedream-5-0-proByteDanceDense detail and texture
Flux 3 Imageflux-3-imageBlack Forest LabsNatural photoreal light, clean in-image text
Frameport Image 1fp-image-1FrameportSeries that stay consistent, plain-language edits

GPT Image 2.5 Sunburst, Seedream 5.0 Pro and Flux 3 Image work from text alone here, so leave reference_images out for them. The images reference lists every field, and n8n AI video applies the same workflow to clips. To script it instead, see the image generation API in Python. To test the workflow without paying for a render, read free image generation API.

FAQ

Can I use Nano Banana Pro in n8n?

Yes. Set model to nano-banana-pro in an HTTP Request node with your Frameport key in a Header Auth credential. The same node runs Nano Banana 2.1, the GPT Image models and the rest of the catalog.

Is n8n image generation free?

The workflow uses n8n's standard nodes. The images are paid from your prepaid balance, from $0.025 each, and only when they succeed; a failed image costs nothing.

How do I generate several images per row?

Send n from 1 to 4 in the body, then split the generation's outputs into one item per image with a Split Out node, and keep those that succeeded.

Can I use Flux in n8n?

Yes: flux-3-image takes the same body as every other model here. Change the model value and keep the rest of the workflow.

Why use a Wait node for images?

The API answers at once with a queued generation, and the images follow when they are done. A short Wait node and a read of the generation, in a bounded loop, picks them up when they are done.

Start building.

Your API key is free. Top up from $10 when you are ready.