n8n image generation: AI images from one HTTP Request node

Generate images in n8n with an HTTP Request node that POSTs a prompt to an image API. Most calls return image URLs at once; poll the rest.

5 min readSume
All posts

To generate images in n8n, add an HTTP Request node that POSTs a prompt to an image generation API and returns the image URLs. With Sume's POST /v1/images, that one node is often the whole job: the API waits up to 30 seconds, most catalog models finish inside that budget, and the answer is 200 with the URLs. Only a 202, which means the job is still running, needs a Wait-and-poll branch.

Sume has no n8n node, so this is a plain HTTPS call from n8n's own nodes. Sume facts come from the Image API docs, and n8n behavior from n8n's HTTP Request node and related docs, all read on 2026-09-27. For Format runs that take minutes, see n8n AI video workflow instead.

How do I set up the HTTP Request node?

Use these settings, then paste the JSON body below. It reads the incoming item's prompt field with the expression $json.prompt, and because the body uses an expression, it is wrapped whole in double curly brackets, as n8n's HTTP Request common issues page asks.

From n8n's HTTP Request node and HTTP Request credentials docs and Sume's Image API and Authentication docs, read 2026-09-27.
SettingValueWhy
Method and URLPOST https://api.sume.com/v1/imagesThe Image API create call.
AuthenticationGeneric credential, Bearer auth, with your API keyn8n's Bearer auth is header auth with Name Authorization and Value Bearer <token>. Send one credential only: Sume rejects Authorization: Bearer plus x-api-key with 401.
Send HeadersIdempotency-Key set to a row id, such as {{ $json.id }}A retry with the same key returns the original job instead of billing a second one.
Send BodyJSON, Using JSONOnly model and prompt are required.
Options, ResponseInclude Response Headers and Status: onBy default the node returns only the body, and you need the status code to tell 200 from 202.
Options, TimeoutAbove 30,000 ms, if you set oneThe timeout covers the wait for response headers, and Sume can hold the request for 30 seconds.
{{
{
  "model": "bytedance-seed/seedream-4.5",
  "prompt": $json.prompt,
  "aspect_ratio": "1:1",
  "output_format": "png"
}
}}

What if the node returns 202 instead of the images?

Branch on the status code, not the body shape: 200 is the image response, 202 is the job envelope with a status_url and a result_url. Slow configurations, such as 4K, high quality, and a large n, are the most likely to return 202. By default the node succeeds only on a 2xx, so a 402 for balance or a 502 for a failed generation makes it fail; turn on Never Error only if you branch on those codes yourself. Build the branch from n8n's own nodes:

  • An If node with a Number condition, status code is equal to 200. The true output goes on to save the images.
  • On the false output, a Wait node that resumes After Time Interval, a few seconds.
  • An HTTP Request node that GETs the status_url with the same credential, then an If node on terminal. To loop, connect its false output back to the Wait node, as n8n's looping docs describe.
  • When terminal is true and sume_status is completed, GET the result_url: the image URLs are in the result's artifacts. A timeout on your side does not cancel the job, which keeps running and still bills.

How do I save the generated image?

Image API result URLs are Sume-hosted and signed, so store the file, not the link. Add an HTTP Request node that GETs each data[].url with Response Format set to File; n8n puts the response into a file in the field you name in Put Output in Field, ready for your storage node. With n above 1, data holds one URL per image.

How do I generate an image for every row?

n8n nodes usually run once for each item, so an HTTP Request node fed 50 rows makes 50 calls. In current code each call creates a paid image_generation job, so your workspace's concurrency limit sets how many process at once, and a full queue answers 429 queue_full. Pace the calls with the node's Batching option, which sets Items per Batch and a Batch Interval in milliseconds, and keep the Idempotency-Key tied to the row. Bulk image generation covers pacing in detail.

Is there a free image generation API for n8n?

Not from Sume. Every completed image is billed at its model's price, plus a 5.5% agent fee by default, and a failed generation is not billed. AI image generator API cost lists each model's price.

Sources

Related posts

More in Integrations

All Integrations posts

Written by Sume