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.

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.
| Setting | Value | Why |
|---|---|---|
| Method and URL | POST https://api.sume.com/v1/images | The Image API create call. |
| Authentication | Generic credential, Bearer auth, with your API key | n8n'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 Headers | Idempotency-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 Body | JSON, Using JSON | Only model and prompt are required. |
| Options, Response | Include Response Headers and Status: on | By default the node returns only the body, and you need the status code to tell 200 from 202. |
| Options, Timeout | Above 30,000 ms, if you set one | The 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_urlwith the same credential, then an If node onterminal. To loop, connect its false output back to the Wait node, as n8n's looping docs describe. - When
terminalis true andsume_statusiscompleted, GET theresult_url: the image URLs are in the result'sartifacts. 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
- Image API
- Jobs and results
- Authentication
- Generation admission
- n8n Docs: HTTP Request node (read 2026-09-27)
- n8n Docs: HTTP Request credentials (read 2026-09-27)
- n8n Docs: Wait node (read 2026-09-27)
- n8n Docs: If node (read 2026-09-27)
- n8n Docs: Looping (read 2026-09-27)
- n8n Docs: Loop Over Items (read 2026-09-27)
- n8n Docs: HTTP Request common issues (read 2026-09-27)
Related posts
More in Integrations
- n8n Google Sheets AI avatar video: one Sume video per row
Read rows with n8n's Google Sheets node, submit one Sume talking-avatar job per row, poll in a capped loop, and write each video URL to the sheet.
- NestJS raw body for webhook signature verification
In NestJS, pass rawBody: true to NestFactory.create and verify the webhook signature over req.rawBody, a Buffer. Raise the 100kb JSON limit too.
- Open WebUI MCP server: connect Sume's hosted MCP
Add Sume's hosted MCP to Open WebUI as an admin: type MCP (Streamable HTTP), then OAuth 2.1 per user or one shared Bearer key.
- OpenAI Agents SDK MCP server: Sume and the 5-second timeout
Connect the OpenAI Agents SDK to Sume's hosted MCP server with an API key, and raise the 5-second client timeouts above jobs_wait's 55 seconds.
Written by Sume