[{"data":1,"prerenderedAt":494,"buildId":495},["ShallowReactive",2],{"blog:article:image-generation-api-python":3,"catalog":156},{"article":4,"related":133,"studioPath":155},{"slug":5,"path":6,"title":7,"description":8,"category":9,"categoryLabel":10,"date":11,"updated":11,"readingMinutes":12,"models":13,"featured":17,"primaryKeyword":18,"keywords":19,"words":27,"toc":28,"blocks":51,"faq":127},"image-generation-api-python","\u002Fblog\u002Fimage-generation-api-python","Image Generation API in Python: Prompt to File","An image generation API Python tutorial: a first request, reference pictures and edits, batches of four billed per image, saving files, safe retries.","guides","Guides","2026-11-28",5,[14,15,16],"nano-banana-pro","gpt-image-2-5-sunburst","fp-image-1",false,"image generation api python",[18,20,21,22,23,24,25,26],"ai image api python","ai image api python example","python text to image api","image to image api python","gpt image api python","openai image api python","nano banana pro api python",1126,[29,33,36,39,42,45,48],{"id":30,"text":31,"level":32},"what-you-need","What you need",2,{"id":34,"text":35,"level":32},"your-first-image-from-the-python-api","Your first image from the Python API",{"id":37,"text":38,"level":32},"reference-pictures-and-edits","Reference pictures and edits",{"id":40,"text":41,"level":32},"batches-four-images-billed-per-success","Batches: four images, billed per success",{"id":43,"text":44,"level":32},"saving-the-files","Saving the files",{"id":46,"text":47,"level":32},"retries-and-idempotency","Retries and idempotency",{"id":49,"text":50,"level":32},"faq","FAQ",[52,55,59,61,64,66,69,73,75,78,80,83,85,88,91,93,95,98,100,103,105],{"type":53,"html":54},"html","\u003Cp>To generate images from Python, you send a prompt to an image generation API with \u003Ccode>requests\u003C\u002Fcode>, wait a few seconds for the job, then save each file. On Frameport one key reaches all 10 image models, from $0.025 per image, and an image that fails costs nothing.\u003C\u002Fp>\n\u003Cp>This guide goes from a first request to a script you can run in production: reference pictures and edits, batches of four, saving the files, and retries that never pay twice. The examples use \u003Ca href=\"\u002Fmodels\u002Fgpt-image-2-5-sunburst\">GPT Image 2.5 Sunburst\u003C\u002Fa>, \u003Ca href=\"\u002Fmodels\u002Fnano-banana-pro\">Nano Banana Pro\u003C\u002Fa> and \u003Ca href=\"\u002Fmodels\u002Ffp-image-1\">Frameport Image 1\u003C\u002Fa>; every image model takes the same request.\u003C\u002Fp>\n\u003Ch2 id=\"what-you-need\">What you need\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>Python 3.8 or later and \u003Ccode>requests\u003C\u002Fcode> (\u003Ccode>pip install requests\u003C\u002Fcode>).\u003C\u002Fli>\n\u003Cli>An API key: \u003Ca href=\"\u002Fsignup\">create an account\u003C\u002Fa>, add funds under Billing (from $10), then create a key under API keys. It starts with \u003Ccode>fp_live_\u003C\u002Fcode> and is shown once.\u003C\u002Fli>\n\u003Cli>The key in an environment variable, so it never lands in your code.\u003C\u002Fli>\n\u003C\u002Ful>",{"type":56,"lang":57,"code":58},"code","curl","export FRAMEPORT_API_KEY=\"fp_live_...\"\npip install requests",{"type":53,"html":60},"\u003Cp>All the code below shares these lines:\u003C\u002Fp>",{"type":56,"lang":62,"code":63},"python","import os\nimport requests\n\nAPI = \"https:\u002F\u002Fframeport.ai\u002Fv1\"\nHEADERS = {\"Authorization\": f\"Bearer {os.environ['FRAMEPORT_API_KEY']}\"}",{"type":53,"html":65},"\u003Ch2 id=\"your-first-image-from-the-python-api\">Your first image from the Python API\u003C\u002Fh2>\n\u003Cp>\u003Ccode>POST \u002Fv1\u002Fimages\u002Fgenerations\u003C\u002Fcode> takes a \u003Ccode>model\u003C\u002Fcode>, a \u003Ccode>prompt\u003C\u002Fcode>, and optionally \u003Ccode>aspect_ratio\u003C\u002Fcode> (\u003Ccode>1:1\u003C\u002Fcode> by default, or \u003Ccode>3:4\u003C\u002Fcode>, \u003Ccode>4:3\u003C\u002Fcode>, \u003Ccode>9:16\u003C\u002Fcode>, \u003Ccode>16:9\u003C\u002Fcode>) and \u003Ccode>n\u003C\u002Fcode>, the number of images. It holds the price on your balance and answers at once with \u003Ccode>202 Accepted\u003C\u002Fcode> and a generation \u003Ccode>id\u003C\u002Fcode>. The images take a few seconds; read the generation until it settles.\u003C\u002Fp>",{"type":56,"lang":62,"code":67,"title":68},"import time\nimport uuid\n\n\ndef error_of(res: requests.Response) -> str:\n    try:\n        error = res.json()[\"error\"]\n        return f\"{error['code']}: {error['message']}\"\n    except (ValueError, KeyError, TypeError):\n        return f\"HTTP {res.status_code}\"\n\n\ndef submit(body: dict, key: str = \"\") -> dict:\n    res = requests.post(\n        f\"{API}\u002Fimages\u002Fgenerations\",\n        headers={**HEADERS, \"Idempotency-Key\": key or str(uuid.uuid4())},\n        json=body,\n    )\n    if not res.ok:\n        raise RuntimeError(error_of(res))\n    return res.json()\n\n\ndef wait(gen: dict, timeout: float = 300) -> dict:\n    deadline = time.monotonic() + timeout\n    while gen[\"status\"] in (\"queued\", \"running\"):\n        if time.monotonic() > deadline:\n            raise TimeoutError(f\"{gen['id']} is still {gen['status']}\")\n        time.sleep(2)\n        res = requests.get(f\"{API}\u002Fgenerations\u002F{gen['id']}\", headers=HEADERS)\n        if not res.ok:\n            raise RuntimeError(error_of(res))\n        gen = res.json()\n    return gen\n\n\ngen = wait(submit({\n    \"model\": \"gpt-image-2-5-sunburst\",\n    \"prompt\": 'A minimal poster of a mountain lake at dawn with the title \"Quiet Water\" in a clean serif',\n    \"aspect_ratio\": \"3:4\",\n}))\nprint(gen[\"status\"], \"charged\", gen[\"cost_usd\"], gen[\"outputs\"][0].get(\"url\"))","Submit and wait",{"type":56,"lang":70,"code":71,"title":72},"json","{\n  \"id\": \"gen_4kQ8vT2nLm9Xr7Wd1sYcPa\",\n  \"object\": \"generation\",\n  \"type\": \"image\",\n  \"model\": \"gpt-image-2-5-sunburst\",\n  \"status\": \"succeeded\",\n  \"reserved_usd\": 0.085,\n  \"cost_usd\": 0.085,\n  \"outputs\": [{\n    \"id\": \"file_8Hc2RkQw5ZpT1mVb7nXe3L\",\n    \"status\": \"succeeded\",\n    \"url\": \"https:\u002F\u002Fframeport.ai\u002Fv1\u002Ffiles\u002Ffile_8Hc2RkQw5ZpT1mVb7nXe3L?expires=...&signature=...\",\n    \"url_expires_at\": \"2026-11-28T11:10:00.000Z\",\n    \"cost_usd\": 0.085,\n    \"content_type\": \"image\u002Fpng\"\n  }],\n  \"error\": null\n}","The generation, once it has succeeded (abridged)",{"type":53,"html":74},"\u003Cp>Text that must appear in the picture goes in quotes, as above, so the model draws it as lettering. Each model takes the same body; the differences are in what it does with it:\u003C\u002Fp>\n\u003Cdiv class=\"blog-table box blog-table-wide\">\u003Ctable class=\"tbl\">\u003Cthead>\u003Ctr>\u003Cth scope=\"col\">Model\u003C\u002Fth>\u003Cth scope=\"col\">\u003Ccode>model\u003C\u002Fcode>\u003C\u002Fth>\u003Cth scope=\"col\">Per image\u003C\u002Fth>\u003Cth scope=\"col\">Reference pictures\u003C\u002Fth>\u003Cth scope=\"col\">Makes\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\u003Ctbody>\u003Ctr>\u003Ctd>\u003Ca href=\"\u002Fmodels\u002Fgpt-image-2-5-sunburst\">GPT Image 2.5 Sunburst\u003C\u002Fa>\u003C\u002Ftd>\u003Ctd>\u003Ccode>gpt-image-2-5-sunburst\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>$0.085\u003C\u002Ftd>\u003Ctd>Text only\u003C\u002Ftd>\u003Ctd>Text to image\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>\u003Ca href=\"\u002Fmodels\u002Fnano-banana-pro\">Nano Banana Pro\u003C\u002Fa>\u003C\u002Ftd>\u003Ctd>\u003Ccode>nano-banana-pro\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>$0.16\u003C\u002Ftd>\u003Ctd>Up to 6\u003C\u002Ftd>\u003Ctd>Text to image and Image to image\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>\u003Ca href=\"\u002Fmodels\u002Ffp-image-1\">Frameport Image 1\u003C\u002Fa>\u003C\u002Ftd>\u003Ctd>\u003Ccode>fp-image-1\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>$0.025\u003C\u002Ftd>\u003Ctd>Up to 10\u003C\u002Ftd>\u003Ctd>Text to image and Image to image\u003C\u002Ftd>\u003C\u002Ftr>\u003C\u002Ftbody>\u003C\u002Ftable>\u003C\u002Fdiv>\n\u003Ch2 id=\"reference-pictures-and-edits\">Reference pictures and edits\u003C\u002Fh2>\n\u003Cp>\u003Ccode>reference_images\u003C\u002Fcode> sends pictures with the prompt: a face, a product or a place to keep, or a picture to change. Nano Banana Pro takes up to 6 and Frameport Image 1 up to 10. Each item can be a public \u003Ccode>https\u003C\u002Fcode> URL, a \u003Ccode>data:image\u002F...;base64,\u003C\u002Fcode> URI, an upload id (\u003Ccode>upl_…\u003C\u002Fcode>) or one of your earlier outputs by its file id (\u003Ccode>file_…\u003C\u002Fcode>).\u003C\u002Fp>\n\u003Cp>That last form makes edits a two-step script: generate, then send the output back with the change written as an instruction. Write the change, not the whole scene again.\u003C\u002Fp>",{"type":56,"lang":62,"code":76,"title":77},"edit = wait(submit({\n    \"model\": \"fp-image-1\",\n    \"prompt\": \"Change the background to a beach at sunset, keep the poster's layout and title\",\n    \"reference_images\": [gen[\"outputs\"][0][\"id\"]],\n    \"aspect_ratio\": \"3:4\",\n}))","Edit an earlier output",{"type":53,"html":79},"\u003Cp>For a picture on disk, send it to \u003Ccode>POST \u002Fv1\u002Fuploads\u003C\u002Fcode> as the raw body (PNG, JPEG or WebP, up to 10 MB). The id it returns works in any request of the workspace for 24 hours:\u003C\u002Fp>",{"type":56,"lang":62,"code":81,"title":82},"def upload(path: str, content_type: str = \"image\u002Fjpeg\") -> str:\n    with open(path, \"rb\") as file:\n        res = requests.post(\n            f\"{API}\u002Fuploads\",\n            headers={**HEADERS, \"Content-Type\": content_type},\n            params={\"filename\": os.path.basename(path)},\n            data=file,\n        )\n    res.raise_for_status()\n    return res.json()[\"id\"]  # upl_...\n\n\nmug = upload(\"mug.jpg\")\nshot = wait(submit({\n    \"model\": \"nano-banana-pro\",\n    \"prompt\": \"The ceramic mug from the picture on a walnut desk beside a window, morning light, product photo\",\n    \"reference_images\": [mug],\n}))","Upload a local picture",{"type":53,"html":84},"\u003Cp>Frameport Image 1 adds a small charge for each reference picture after the first; the quote below shows it before you spend. See \u003Ca href=\"\u002Fdocs\u002Fuploads\">uploads\u003C\u002Fa> for the limits.\u003C\u002Fp>\n\u003Cp>For edits on the highest-fidelity model, the \u003Ca href=\"\u002Fblog\u002Fnano-banana-pro-api\">Nano Banana Pro API guide\u003C\u002Fa> has more examples.\u003C\u002Fp>\n\u003Ch2 id=\"batches-four-images-billed-per-success\">Batches: four images, billed per success\u003C\u002Fh2>\n\u003Cp>\u003Ccode>n\u003C\u002Fcode> 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. The generation counts as \u003Ccode>succeeded\u003C\u002Fcode> when at least one image did; an image that failed shows \u003Ccode>status: &quot;failed&quot;\u003C\u002Fcode> with its reason, and its share of the hold goes back to your balance.\u003C\u002Fp>\n\u003Cdiv class=\"blog-table box blog-table-wide\">\u003Ctable class=\"tbl\">\u003Cthead>\u003Ctr>\u003Cth scope=\"col\">Model\u003C\u002Fth>\u003Cth scope=\"col\">1 image\u003C\u002Fth>\u003Cth scope=\"col\">2 images\u003C\u002Fth>\u003Cth scope=\"col\">4 images\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\u003Ctbody>\u003Ctr>\u003Ctd>GPT Image 2.5 Sunburst\u003C\u002Ftd>\u003Ctd>$0.085\u003C\u002Ftd>\u003Ctd>$0.17\u003C\u002Ftd>\u003Ctd>$0.34\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Nano Banana Pro\u003C\u002Ftd>\u003Ctd>$0.16\u003C\u002Ftd>\u003Ctd>$0.32\u003C\u002Ftd>\u003Ctd>$0.64\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Frameport Image 1\u003C\u002Ftd>\u003Ctd>$0.025\u003C\u002Ftd>\u003Ctd>$0.05\u003C\u002Ftd>\u003Ctd>$0.10\u003C\u002Ftd>\u003C\u002Ftr>\u003C\u002Ftbody>\u003C\u002Ftable>\u003C\u002Fdiv>\n\u003Cp>To check a batch before it runs, send the same body without the prompt to \u003Ccode>POST \u002Fv1\u002Fgenerations\u002Fquote\u003C\u002Fcode>. Nothing is held, and the answer says whether your balance covers it:\u003C\u002Fp>",{"type":56,"lang":62,"code":86,"title":87},"q = requests.post(f\"{API}\u002Fgenerations\u002Fquote\", headers=HEADERS, json={\"model\": \"nano-banana-pro\", \"n\": 4}).json()\nprint(q[\"breakdown\"], \"covered:\", q[\"enough_balance\"])","Quote four images",{"type":56,"lang":70,"code":89,"title":90},"{\n  \"object\": \"quote\",\n  \"model\": \"nano-banana-pro\",\n  \"type\": \"image\",\n  \"mode\": \"generate\",\n  \"price_usd\": 0.64,\n  \"reserved_usd\": 0.64,\n  \"breakdown\": \"4 images × $0.16\",\n  \"enough_balance\": true\n}","200 OK",{"type":92,"model":14},"cta",{"type":53,"html":94},"\u003Cp>Model-by-model prices are in \u003Ca href=\"\u002Fblog\u002Fai-image-generation-api-cost\">AI image generation API cost\u003C\u002Fa>.\u003C\u002Fp>\n\u003Ch2 id=\"saving-the-files\">Saving the files\u003C\u002Fh2>\n\u003Cp>Each output that succeeded has a \u003Ccode>url\u003C\u002Fcode>, a signed link that opens without a key for about an hour, and a \u003Ccode>content_type\u003C\u002Fcode>. Stream each one to disk, and skip the ones that failed:\u003C\u002Fp>",{"type":56,"lang":62,"code":96,"title":97},"EXTENSIONS = {\"image\u002Fpng\": \".png\", \"image\u002Fjpeg\": \".jpg\", \"image\u002Fwebp\": \".webp\"}\n\n\ndef save(gen: dict, stem: str) -> list:\n    paths = []\n    for index, output in enumerate(gen[\"outputs\"]):\n        if output[\"status\"] != \"succeeded\" or not output.get(\"url\"):\n            continue\n        path = f\"{stem}-{index}{EXTENSIONS.get(output.get('content_type'), '.img')}\"\n        with requests.get(output[\"url\"], stream=True) as res:\n            res.raise_for_status()\n            with open(path, \"wb\") as file:\n                for chunk in res.iter_content(chunk_size=1 \u003C\u003C 16):\n                    file.write(chunk)\n        paths.append(path)\n    return paths\n\n\nprint(save(shot, \"mug\"))","Save every image of a generation",{"type":53,"html":99},"\u003Cp>If a link has expired, read the generation again for a fresh one, or fetch \u003Ccode>GET \u002Fv1\u002Fgenerations\u002F{id}\u002Fcontent\u002F{index}\u003C\u002Fcode> with your key (the index starts at 0). Files are not stored forever, so copy the ones you keep to your own storage (\u003Ca href=\"\u002Fdocs\u002Ffiles\">files\u003C\u002Fa>).\u003C\u002Fp>\n\u003Ch2 id=\"retries-and-idempotency\">Retries and idempotency\u003C\u002Fh2>\n\u003Cp>A timeout does not tell you whether the request arrived. Send an \u003Ccode>Idempotency-Key\u003C\u002Fcode> with each submit and reuse it on the retry: the same key with the same body returns the first generation for 24 hours, with an \u003Ccode>Idempotent-Replayed: true\u003C\u002Fcode> header, instead of making and charging the images twice. Build the key from your own record, such as an order or a row id:\u003C\u002Fp>",{"type":56,"lang":62,"code":101,"title":102},"def submit_with_retry(body: dict, key: str, attempts: int = 5) -> dict:\n    for attempt in range(1, attempts + 1):\n        try:\n            res = requests.post(\n                f\"{API}\u002Fimages\u002Fgenerations\",\n                headers={**HEADERS, \"Idempotency-Key\": key},\n                json=body,\n                timeout=60,\n            )\n        except requests.RequestException:\n            if attempt == attempts:\n                raise\n            time.sleep(2 ** attempt)\n            continue\n        if res.ok:\n            return res.json()  # 202 the first time, 200 on a replay\n        reason = error_of(res)\n        retry = res.status_code == 429 or res.status_code >= 500 or reason.startswith(\"request_in_progress\")\n        if not retry or attempt == attempts:\n            raise RuntimeError(reason)\n        time.sleep(float(res.headers.get(\"Retry-After\", 2 ** attempt)))\n\n\ngen = submit_with_retry({\"model\": \"nano-banana-pro\", \"prompt\": \"A lighthouse on a cliff at dawn, soft fog\", \"n\": 4}, key=\"row-1842\")","Retry safely",{"type":53,"html":104},"\u003Cp>The same key with a different body is refused with \u003Ccode>409 idempotency_conflict\u003C\u002Fcode>, and a \u003Ccode>400\u003C\u002Fcode> is never worth retrying: its message names the field to fix. The \u003Ca href=\"\u002Fdocs\u002Fidempotency\">idempotency reference\u003C\u002Fa> covers each case, and the \u003Ca href=\"\u002Fdocs\u002Fimages\">images reference\u003C\u002Fa> lists every field.\u003C\u002Fp>\n\u003Cp>Frameport&#39;s own engines, such as Frameport Image 1, render without a content filter once a workspace owner or admin aged 18 or older turns it off in Settings. Third-party models keep their makers&#39; policies and may refuse a prompt; a refused job costs nothing. The \u003Ca href=\"\u002Fblog\u002Funcensored-image-generation-api\">uncensored image generation API\u003C\u002Fa> guide has the details. For video, the \u003Ca href=\"\u002Fblog\u002Fai-video-generation-api-python\">video generation API in Python\u003C\u002Fa> uses the same steps. The same calls in JavaScript and TypeScript are in the \u003Ca href=\"\u002Fblog\u002Fimage-generation-api-javascript\">image generation API in JavaScript\u003C\u002Fa> guide. To serve the images in a chat, see the \u003Ca href=\"\u002Fblog\u002Fdiscord-bot-ai-image-generation\">Discord bot image generation\u003C\u002Fa> guide. Your own pictures as references are sent as shown in \u003Ca href=\"\u002Fblog\u002Fupload-files-to-ai-generation-api\">upload image to API\u003C\u002Fa>.\u003C\u002Fp>",{"type":49,"id":49,"title":50,"items":106},[107,111,115,119,123],{"q":108,"html":109,"text":110},"Is there a free image generation API for Python?","\u003Cp>Frameport is prepaid: you add funds from $10 and pay per image that succeeds, from $0.025. Listing the models and quoting a request are free, and a failed image costs nothing.\u003C\u002Fp>","Frameport is prepaid: you add funds from $10 and pay per image that succeeds, from $0.025. Listing the models and quoting a request are free, and a failed image costs nothing.",{"q":112,"html":113,"text":114},"Can I use GPT Image from Python with this API?","\u003Cp>Yes. \u003Ccode>gpt-image-2-5-sunburst\u003C\u002Fcode> and \u003Ccode>gpt-image-2-5-flare\u003C\u002Fcode>, made by OpenAI, take the same request as every other model here, with your Frameport key. They work from text alone; for edits from pictures, use Nano Banana Pro or Frameport Image 1.\u003C\u002Fp>","Yes. gpt-image-2-5-sunburst and gpt-image-2-5-flare, made by OpenAI, take the same request as every other model here, with your Frameport key. They work from text alone; for edits from pictures, use Nano Banana Pro or Frameport Image 1.",{"q":116,"html":117,"text":118},"How do I send a local image to an image generation API in Python?","\u003Cp>Either upload it with \u003Ccode>POST \u002Fv1\u002Fuploads\u003C\u002Fcode> and pass the \u003Ccode>upl_…\u003C\u002Fcode> id, or encode it as a \u003Ccode>data:image\u002Fpng;base64,…\u003C\u002Fcode> URI in \u003Ccode>reference_images\u003C\u002Fcode>. The upload keeps large files out of your request bodies.\u003C\u002Fp>","Either upload it with POST \u002Fv1\u002Fuploads and pass the upl_… id, or encode it as a data:image\u002Fpng;base64,… URI in reference_images. The upload keeps large files out of your request bodies.",{"q":120,"html":121,"text":122},"Am I charged for the images that fail in a batch?","\u003Cp>No. Each image of a batch is charged only if it succeeds. The generation&#39;s \u003Ccode>cost_usd\u003C\u002Fcode> is the sum of the images that did, and the rest of the hold goes back to your balance.\u003C\u002Fp>","No. Each image of a batch is charged only if it succeeds. The generation's cost_usd is the sum of the images that did, and the rest of the hold goes back to your balance.",{"q":124,"html":125,"text":126},"How many images can I generate at once?","\u003Cp>Up to 4 per request with \u003Ccode>n\u003C\u002Fcode>, and up to 20 generations running at once in a workspace, with 60 new requests a minute. Queue the rest and submit as they finish.\u003C\u002Fp>","Up to 4 per request with n, and up to 20 generations running at once in a workspace, with 60 new requests a minute. Queue the rest and submit as they finish.",[128,129,130,131,132],{"q":108,"html":109,"text":110},{"q":112,"html":113,"text":114},{"q":116,"html":117,"text":118},{"q":120,"html":121,"text":122},{"q":124,"html":125,"text":126},[134,141,147],{"slug":135,"path":136,"title":137,"description":138,"category":9,"categoryLabel":10,"date":11,"updated":11,"readingMinutes":139,"models":140,"featured":17},"cursor-mcp-image-generation","\u002Fblog\u002Fcursor-mcp-image-generation","Cursor MCP Image Generation: Make Assets in the Editor","Cursor MCP image generation from one mcp.json entry: prompts for heroes, icons and illustrations, a model per asset, and caps on what the agent spends.",6,[14,16,15],{"slug":142,"path":143,"title":144,"description":145,"category":9,"categoryLabel":10,"date":11,"updated":11,"readingMinutes":12,"models":146,"featured":17},"image-generation-api-javascript","\u002Fblog\u002Fimage-generation-api-javascript","Image Generation API in JavaScript and TypeScript","An image generation API JavaScript guide: one fetch call from Node, Deno, Bun or a Worker, TypeScript types from OpenAPI, references, batches, a safe key.",[14,16,15],{"slug":148,"path":149,"title":150,"description":151,"category":9,"categoryLabel":10,"date":11,"updated":11,"readingMinutes":152,"models":153,"featured":17},"n8n-image-generation","\u002Fblog\u002Fn8n-image-generation","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.",4,[14,15,154,16],"seedream-5-0-pro","\u002Fstudio",[157,175,184,193,219,237,257,273,288,303,318,332,343,357,370,383,396,406,414,423,432,440,450,458,477],{"id":158,"type":159,"name":160,"description":161,"maker":162,"family":162,"own":163,"image":164,"private":174},"fp-image-2","image","Frameport Image 2","Photoreal renders, up to 4 reference images.","Frameport",true,{"pricing":165,"options":167},{"per_image":166,"per_extra_reference_image":-1},0.025,{"aspect_ratios":168,"max_images":152},[169,170,171,172,173],"1:1","3:4","4:3","9:16","16:9",{},{"id":176,"type":159,"name":177,"description":178,"maker":162,"family":162,"own":163,"image":179,"private":183},"fp-image-3","Frameport Image 3","Clean photoreal renders for characters.",{"pricing":180,"options":181},{"per_image":166,"per_extra_reference_image":-1},{"aspect_ratios":182,"max_images":152},[169,170,171,172,173],{},{"id":16,"type":159,"name":185,"description":186,"maker":162,"family":162,"own":163,"image":187,"private":192},"Frameport Image 1","Generation and reference-driven renders, up to 10 reference images.",{"pricing":188,"options":190},{"per_image":166,"per_extra_reference_image":189},0.0025,{"aspect_ratios":191,"max_images":152},[169,170,171,172,173],{},{"id":194,"type":195,"name":196,"description":197,"maker":162,"family":198,"own":163,"video":199,"private":217},"fp-motion-1","video","Frameport Motion 1","Our video engine, with native sound.","Frameport Motion",{"pricing":200,"options":207},{"default_resolution":201,"per_second":202,"per_second_with_audio":-1,"aspect_ratio_multiplier":-1,"per_reference_image":-1,"per_frame_image":-1},"768p",{"480p":203,"768p":204,"1080p":205,"2K":206},0.02,0.06,0.08,0.095,{"resolutions":208,"durations":212,"aspect_ratios":215,"audio_toggle":163,"start_frame":163,"end_frame":163,"max_reference_images":152,"identity_resolutions":216,"seed":17,"negative_prompt":17},[209,201,210,211],"480p","1080p","2K",{"min":12,"max":213,"step":214},15,1,[173,172,169,171,170],[201,210],{"resolutions":218},[209,201],{"id":220,"type":195,"name":221,"description":222,"maker":223,"family":224,"own":17,"video":225},"seedance-2-5","Seedance 2.5","The long-take flagship — up to 30 seconds with sound","ByteDance","Seedance",{"pricing":226,"options":231},{"default_resolution":227,"per_second":228,"per_second_with_audio":-1,"aspect_ratio_multiplier":-1,"per_reference_image":-1,"per_frame_image":-1},"720p",{"480p":229,"720p":230},0.12,0.27,{"resolutions":232,"durations":233,"aspect_ratios":235,"audio_toggle":163,"start_frame":163,"end_frame":163,"max_reference_images":152,"identity_resolutions":-1,"seed":163,"negative_prompt":17},[209,227],{"min":152,"max":234,"step":214},30,[173,171,169,170,172,236],"21:9",{"id":238,"type":195,"name":239,"description":240,"maker":241,"family":242,"own":17,"video":243},"veo-3-1","Veo 3.1","Google’s flagship — up to 4K with native audio","Google","Veo",{"pricing":244,"options":250},{"default_resolution":210,"per_second":245,"per_second_with_audio":248,"aspect_ratio_multiplier":-1,"per_reference_image":-1,"per_frame_image":-1},{"720p":246,"1080p":246,"4K":247},0.235,0.465,{"720p":247,"1080p":247,"4K":249},0.695,{"resolutions":251,"durations":253,"aspect_ratios":255,"audio_toggle":163,"start_frame":163,"end_frame":163,"max_reference_images":256,"identity_resolutions":-1,"seed":163,"negative_prompt":163},[227,210,252],"4K",{"min":152,"max":254,"step":32},8,[173,172],3,{"id":258,"type":195,"name":259,"description":260,"maker":223,"family":224,"own":17,"video":261},"seedance-2-0","Seedance 2.0","Character consistency, up to 4K",{"pricing":262,"options":269},{"default_resolution":227,"per_second":263,"per_second_with_audio":-1,"aspect_ratio_multiplier":267,"per_reference_image":-1,"per_frame_image":-1},{"480p":205,"720p":264,"1080p":265,"4K":266},0.175,0.435,0.9,{"21:9":268},1.32,{"resolutions":270,"durations":271,"aspect_ratios":272,"audio_toggle":163,"start_frame":163,"end_frame":163,"max_reference_images":152,"identity_resolutions":-1,"seed":163,"negative_prompt":17},[209,227,210,252],{"min":152,"max":213,"step":214},[173,171,169,170,172,236],{"id":274,"type":195,"name":275,"description":276,"maker":277,"family":278,"own":17,"video":279},"hailuo-3","Hailuo 3","2K cinematic physics, subject references","MiniMax","Hailuo",{"pricing":280,"options":284},{"default_resolution":211,"per_second":281,"per_second_with_audio":-1,"aspect_ratio_multiplier":-1,"per_reference_image":283,"per_frame_image":-1},{"2K":282},0.15,0.047,{"resolutions":285,"durations":286,"aspect_ratios":287,"audio_toggle":163,"start_frame":163,"end_frame":163,"max_reference_images":256,"identity_resolutions":-1,"seed":17,"negative_prompt":17},[211],{"min":12,"max":213,"step":214},[236,173,171,169,170,172],{"id":289,"type":195,"name":290,"description":291,"maker":292,"family":292,"own":17,"video":293},"runway-gen-4-5","Runway Gen-4.5","Cinematic motion, strong prompt adherence","Runway",{"pricing":294,"options":297},{"default_resolution":227,"per_second":295,"per_second_with_audio":-1,"aspect_ratio_multiplier":-1,"per_reference_image":-1,"per_frame_image":-1},{"720p":296},0.14,{"resolutions":298,"durations":299,"aspect_ratios":301,"audio_toggle":17,"start_frame":163,"end_frame":17,"max_reference_images":302,"identity_resolutions":-1,"seed":163,"negative_prompt":17},[227],{"min":32,"max":300,"step":214},10,[173,172],0,{"id":304,"type":195,"name":305,"description":306,"maker":241,"family":242,"own":17,"video":307},"veo-3-1-fast","Veo 3.1 Fast","Veo quality, faster and a quarter of the price",{"pricing":308,"options":314},{"default_resolution":227,"per_second":309,"per_second_with_audio":312,"aspect_ratio_multiplier":-1,"per_reference_image":-1,"per_frame_image":-1},{"720p":310,"1080p":229,"4K":311},0.093,0.29,{"720p":229,"1080p":296,"4K":313},0.35,{"resolutions":315,"durations":316,"aspect_ratios":317,"audio_toggle":163,"start_frame":163,"end_frame":163,"max_reference_images":256,"identity_resolutions":-1,"seed":163,"negative_prompt":163},[227,210,252],{"min":152,"max":254,"step":32},[173,172],{"id":319,"type":195,"name":320,"description":321,"maker":223,"family":224,"own":17,"video":322},"seedance-2-0-fast","Seedance 2.0 Fast","Seedance references and sound, faster",{"pricing":323,"options":328},{"default_resolution":227,"per_second":324,"per_second_with_audio":-1,"aspect_ratio_multiplier":327,"per_reference_image":-1,"per_frame_image":-1},{"480p":325,"720p":326},0.063,0.145,{"21:9":268},{"resolutions":329,"durations":330,"aspect_ratios":331,"audio_toggle":163,"start_frame":163,"end_frame":163,"max_reference_images":152,"identity_resolutions":-1,"seed":163,"negative_prompt":17},[209,227],{"min":152,"max":213,"step":214},[173,171,169,170,172,236],{"id":333,"type":195,"name":334,"description":335,"maker":277,"family":278,"own":17,"video":336},"hailuo-3-max","Hailuo 3 Max","Fast Hailuo motion, 768p",{"pricing":337,"options":339},{"default_resolution":201,"per_second":338,"per_second_with_audio":-1,"aspect_ratio_multiplier":-1,"per_reference_image":-1,"per_frame_image":-1},{"480p":204,"768p":310},{"resolutions":340,"durations":341,"aspect_ratios":342,"audio_toggle":17,"start_frame":163,"end_frame":163,"max_reference_images":302,"identity_resolutions":-1,"seed":17,"negative_prompt":17},[209,201],{"min":12,"max":213,"step":214},[236,173,171,169,170,172],{"id":344,"type":195,"name":345,"description":346,"maker":347,"family":345,"own":17,"video":348},"grok-imagine","Grok Imagine","Quick clips from a prompt or a start image","xAI",{"pricing":349,"options":353},{"default_resolution":227,"per_second":350,"per_second_with_audio":-1,"aspect_ratio_multiplier":-1,"per_reference_image":-1,"per_frame_image":352},{"480p":310,"720p":351,"1080p":311},0.165,0.014,{"resolutions":354,"durations":355,"aspect_ratios":356,"audio_toggle":17,"start_frame":163,"end_frame":17,"max_reference_images":302,"identity_resolutions":-1,"seed":17,"negative_prompt":17},[209,227,210],{"min":214,"max":213,"step":214},[173,172,169,171,170],{"id":358,"type":195,"name":359,"description":-1,"maker":223,"family":224,"own":17,"video":360},"seedance-2-0-mini","Seedance 2.0 Mini",{"pricing":361,"options":366},{"default_resolution":209,"per_second":362,"per_second_with_audio":-1,"aspect_ratio_multiplier":365,"per_reference_image":-1,"per_frame_image":-1},{"480p":363,"720p":364},0.041,0.088,{"21:9":268},{"resolutions":367,"durations":368,"aspect_ratios":369,"audio_toggle":163,"start_frame":163,"end_frame":163,"max_reference_images":152,"identity_resolutions":-1,"seed":163,"negative_prompt":17},[209,227],{"min":152,"max":213,"step":214},[173,171,169,170,172,236],{"id":371,"type":195,"name":372,"description":373,"maker":241,"family":242,"own":17,"video":374},"veo-3-1-lite","Veo 3.1 Lite","Veo with sound, on every account",{"pricing":375,"options":379},{"default_resolution":227,"per_second":376,"per_second_with_audio":378,"aspect_ratio_multiplier":-1,"per_reference_image":-1,"per_frame_image":-1},{"720p":377,"1080p":204},0.036,{"720p":204,"1080p":310},{"resolutions":380,"durations":381,"aspect_ratios":382,"audio_toggle":163,"start_frame":163,"end_frame":163,"max_reference_images":302,"identity_resolutions":-1,"seed":163,"negative_prompt":163},[227,210],{"min":152,"max":254,"step":32},[173,172],{"id":384,"type":195,"name":385,"description":386,"maker":387,"family":388,"own":17,"video":389},"wan-3","Wan 3.0","Up to 30 seconds, references and sound","Alibaba","Wan",{"pricing":390,"options":392},{"default_resolution":227,"per_second":391,"per_second_with_audio":-1,"aspect_ratio_multiplier":-1,"per_reference_image":-1,"per_frame_image":-1},{"480p":204,"720p":229,"1080p":246},{"resolutions":393,"durations":394,"aspect_ratios":395,"audio_toggle":163,"start_frame":163,"end_frame":17,"max_reference_images":256,"identity_resolutions":-1,"seed":163,"negative_prompt":17},[209,227,210],{"min":32,"max":234,"step":214},[173,171,169,170,172],{"id":15,"type":159,"name":397,"description":398,"maker":399,"family":400,"own":17,"image":401},"GPT Image 2.5 Sunburst","OpenAI's flagship — precise text, composition and control","OpenAI","GPT Image",{"pricing":402,"options":404},{"per_image":403,"per_extra_reference_image":-1},0.085,{"aspect_ratios":405,"max_images":152},[169,170,171,172,173],{"id":407,"type":159,"name":408,"description":409,"maker":399,"family":400,"own":17,"image":410},"gpt-image-2-5-flare","GPT Image 2.5 Flare","OpenAI's image model tuned for expressive, dramatic frames",{"pricing":411,"options":412},{"per_image":403,"per_extra_reference_image":-1},{"aspect_ratios":413,"max_images":152},[169,170,171,172,173],{"id":415,"type":159,"name":416,"description":417,"maker":241,"family":418,"own":17,"image":419},"nano-banana-2-1","Nano Banana 2.1","Google's fast multimodal image model","Nano Banana",{"pricing":420,"options":421},{"per_image":403,"per_extra_reference_image":-1},{"aspect_ratios":422,"max_images":152},[169,170,171,172,173],{"id":154,"type":159,"name":424,"description":425,"maker":223,"family":426,"own":17,"image":427},"Seedream 5.0 Pro","ByteDance's flagship — rich detail and texture","Seedream",{"pricing":428,"options":430},{"per_image":429,"per_extra_reference_image":-1},0.099,{"aspect_ratios":431,"max_images":152},[169,170,171,172,173],{"id":14,"type":159,"name":433,"description":434,"maker":241,"family":418,"own":17,"image":435},"Nano Banana Pro","Google's highest-fidelity image model",{"pricing":436,"options":438},{"per_image":437,"per_extra_reference_image":-1},0.16,{"aspect_ratios":439,"max_images":152},[169,170,171,172,173],{"id":441,"type":159,"name":442,"description":443,"maker":444,"family":445,"own":17,"image":446},"flux-3-image","Flux 3 Image","Black Forest Labs' FLUX.3 — photoreal and typography","Black Forest Labs","Flux",{"pricing":447,"options":448},{"per_image":364,"per_extra_reference_image":-1},{"aspect_ratios":449,"max_images":152},[169,170,171,172,173],{"id":451,"type":159,"name":452,"description":453,"maker":347,"family":345,"own":17,"image":454},"grok-imagine-2-0","Grok Imagine 2.0","xAI's fast, characterful image model",{"pricing":455,"options":456},{"per_image":364,"per_extra_reference_image":-1},{"aspect_ratios":457,"max_images":152},[169,170,171,172,173],{"id":459,"type":195,"name":460,"description":461,"maker":162,"family":462,"own":163,"edit":463,"video":471},"fp-replace-1","Frameport Replace 1","Up to four people in your clip replaced by the faces you send: moves, lips, scene and sound kept.","Frameport Replace",{"tool":464,"formats":465,"min_seconds":32,"max_seconds":300,"min_billed_seconds":32,"max_bytes":468,"max_frames":469,"fps":470,"max_faces":152},"replace",[466,467],"mp4","mov",64000000,600,24,{"pricing":472,"options":475},{"default_resolution":201,"per_second":473,"per_second_with_audio":-1,"aspect_ratio_multiplier":-1,"per_reference_image":-1,"per_frame_image":-1},{"768p":229,"1080p":474},0.25,{"resolutions":476,"durations":-1,"aspect_ratios":-1,"audio_toggle":-1,"start_frame":-1,"end_frame":-1,"max_reference_images":-1,"identity_resolutions":-1,"seed":-1,"negative_prompt":-1},[201,210],{"id":478,"type":195,"name":479,"description":480,"maker":162,"family":481,"own":163,"edit":482,"video":487},"fp-upscale-1","Frameport Upscale 1","Your clip at 1080p or 2K: the same motion, frame rate and sound, sharper detail.","Frameport Upscale",{"tool":483,"formats":484,"min_seconds":214,"max_seconds":234,"min_billed_seconds":12,"max_bytes":485,"max_frames":486,"fps":-1,"max_faces":-1},"upscale",[466,467],100000000,900,{"pricing":488,"options":492},{"default_resolution":210,"per_second":489,"per_second_with_audio":-1,"aspect_ratio_multiplier":-1,"per_reference_image":-1,"per_frame_image":-1},{"1080p":490,"2K":491},0.03,0.05,{"resolutions":493,"durations":-1,"aspect_ratios":-1,"audio_toggle":-1,"start_frame":-1,"end_frame":-1,"max_reference_images":-1,"identity_resolutions":-1,"seed":-1,"negative_prompt":-1},[210,211],1795901825734,"b270fb84-a112-44f2-9801-f99d6c2e889e"]